PDF SDK Code Samples

Below you will find some sample scripts (vbs) which demonstrates how to use the Aloaha PDF SDK. The SDK is part of the Aloaha PDF Suite Enterprise Edition. An evaluation license can be requested at our support department (aloaha@wrocklage.de).


Extract PDF Page as Image


The script below allows SDK users to render any page of a PDF document to an image.
Formats supported are GIF, JPG, PNG, WMF, EMF, EPS and BMP


dim pdf 

'create object
set pdf = createobject("aloahapdf.edit")

   pdf.pdfpath="c:\pdf\massensignatur.pdf" 
   'first parameter is the target image, second the page to extract and the last is DPI
   call pdf.export_page(cstr("c:\pdf\massensignatur.png"),clng(1), clng(150))

set pdf = nothing


Text Stamp an existing PDF Document


dim pdf
'create object
set pdf = createobject("aloahapdf.edit")

          pdf.pdfpath="c:\pdf\massensignatur.pdf"
         if pdf.textstamp_pdf(clng(1), _           'pagenumber
                                           cdbl(10), _        'left positon in percentage of pagewidth
                                           cdbl(99), _        'top positon in percentage of pageheight
                                           cdbl(30), _        'stamp width in percentage of pagewidth
                                           cdbl(15), _        'stamp height in percentage of pageheight
                                           cstr("Stamped by Aloaha")) =true then 

                                  msgox "PDF File stamped"

         end if

set pdf = nothing  


Add Sticky Notes / Annotations to any existing PDF Document



Please note that Aloaha Sticky Notes / Annotations do not invalidate any existing digital signature!

dim pdf
'create object
set pdf = createobject("aloahapdf.edit")

pdf.pdfpath="c:\pdf\massensignatur.pdf"
if pdf.add_note_to_pdf_file(clng(1), _                                'pagenumber
                                             true, _                                     'inlcude date
                                             cstr("This is the body"), _       'body string
                                             cstr("Subject"), _                    'subject string
                                             true, _                                     'show opened 
                                             clng(30), _                              'x position in percent
                                             clng(90), _                              'y position in percent
                                             clng(100), _                            'width in pixel
                                             clng(100)) =true then             'height in pixel

                            msgbox "Success"

end if

set pdf = nothing


Please check download below as a digitally signed "Sticky Note" example:
Aspekte digitaler Massensignatur (1.032,41 KB)


Please ask...

Although we really tried hard, there are always questions left open.

Please send us your question.
We would be glad to answer it.
PDF SDKPDF Signature APICertificate PropertiesSample CodeText StampsPDF AttachmentsImage 2 PDFPDF to Multipage TIFFAppend PDFInsert Blank PageRender ImageStamp PDF with PDFDraw PDF as LetterheadApply LetterheadPDF BackgroundsAdd NotesURL HotspotSecure PDF ViewerPDF OptimizerPDF Encryption APIPDF Printing APIPDF BookmarksPDF BarcodingMerge PDF DocumentsSample APIsResize PDFCrop PDF PagePDF InformationPDF2TXTNormalize PagesDirect PDF ConversionPDF Form Saver SDKSmart Card APIAloaha Web ServicesAloaha Print MonitorAloaha Remote ConfigurationWebDAVLDAP ClientProgramming Office MacrosIIS Event Sinks