Adding page numbers to PDF output

We have been using the product and hoping there would be a way to stamp each page of out put with a page number on either the header or footer.  Is this possible and if so how?




1 Like

Of course is this possible. You cann add page number with a function (AddPageNumberToPDFFile) from the pdfforge.dll coming with PDFCreator and a script.

 Best regards,

Thanks Frank...that is grand news!

I have checked the site and forums and cannot find help files/ reference documents for pdfforge.dll nor documentation for the function.  Is there any formal doc or examples on how to get this going?

Also is it possible to have the pages stamped PageNumber / TotalPages?  So 1/3, 2/3 and 3/3



I found the folder "C:\\Program Files (x86)\\PDFCreator\\PlugIns\\pdfforge" which includes the dlls and a readme.txt.

I am working through the samples but cannot get them to run.  Specifically, the line:

Set pdfforge = Wscript.CreateObject("pdfforge.pdf.pdf")

That line gives the error "Could not create object name "pdfforge.pdf.PDF" 80040154.

My vbs file is in the same folder with the .dll.  I am running Windows 7 pro 64-bit.  When I tried to regsvr32 the dll I received the message "module "pdfforge.dll" was loaded but the entry-point DllRegisterServer was not found."  Anything else I should be doing?


I 'm experiencing the same problem as scott while attempting using "MergePdffiles.vbs". The script fails at the same step.

I'm using Windows 7 64 bits too.



I´m going to post the solution that I´ve found:


Option Explicit

Dim pdf, pdfText, WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Set pdf = WScript.CreateObject("pdfforge.pdf.pdf")

Set pdfText  = Wscript.CreateObject("pdfforge.pdf.pdfText")

pdfText.Text = "[PAGE]/[PAGES]"
pdf.AddPageNumberToPDFFile "input.pdf", "output_pag.pdf", 1, 0, 1, 0, 6, 10.0, 10.0, (pdfText)

Set pdfText = Nothing
Set pdf = Nothing


Thank you for the vbs code but I'm having some trouble getting it to work correctly.  Could you please provide some instructions?  It would be nice if the program had this functionality built in as an option.


I know that this is a mega-old discussion but was anyone ever able to get this to work? and if so, how did you do it?


I know this is super old but did anyone ever come up with a solution for this? Since version 3.0 the dll has changed alot.