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.