Draw PDF on PDF Letterhead

The function Draw_A_as_Layer_on_B is the ideal function to merge two (or 3) PDF documents on top of each other so that one PDF acts like a letterhead.

First you need to create the Aloaha PDF Object with 

set pdf = CreateObject("aloahapdf.edit")

Once the object is created you can directly merge two documents. The function call is:

Draw_A_as_Layer_on_B(A_PDF As String, B_PDF As String, OutputPDF As String, Allpages As Boolean) As Boolean

If Allpage is set to true the function will apply the letterhead only to the first page of the document.

You can point the aloahapdf.edit property AdditionalPDFLetterhead to a third PDF document.

In that case Aloaha will render on the first Page the document specified in the function call. The PDF specified in AdditionalPDFLetterhead will be rendered to all further pages.




Please ask...

Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question?
Please check!
  • Attempting to overlay a report over our company letterhead. The resulting pdf looks like I expect, except the overlayed letterhead only appears on the first page of my report. Here’s, some sample code I’m using. Please note that I ran this code passing both true & false to the last parameter and received the same results. I've also tried function merge_A_and_B.

    Dim strFileName As String
    Dim pdfDocument As aloahapdf.edit
    Dim blnReturn As Boolean

    Set pdfDocument = New aloahapdf.edit
    strFileName = "J:\Report.pdf"
    blnReturn = pdfDocument.Draw_A_as_Layer_on_B(strFileName, "J:\NusilLogoLetterhead.pdf", strFileName, True)
    Set pdfDocument = Nothing

    Thanks,
    Ron

    I just modified your sample a bit to VBS and tried it out. It works perfectly.

    Here the modified code:

    Dim strFileName
    Dim pdfDocument
    Dim blnReturn

    Set pdfDocument = createobject("aloahapdf.edit")

    strFileName = cstr("c:\in.pdf")
    blnReturn = pdfDocument.Draw_A_as_Layer_on_B(cstr(strFileName), cstr("c:\letterhead.pdf"), cstr(strFileName), cbool(True))


    Set pdfDocument = Nothing

    If you still do not get it working it might be that your PDFs are a bit strange. Please send them to info@aloaha.com
    Answered 12.12.2011
If not, please do not hesitate to 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