Printing a PDF to a PDF using Excel VBA

  • I have a routine that assembles a set of PDF documents into a single document. The original documents are a combination of landscape and portrait. After assembling the document, I insert page numbers at the bottom and center of every page. When I open the document the page numbers are in the correct position on the portrait pages, but on the landscape pages the page numbers are positioned based on the landscape orientation, so if looking at the whole document as a bound document in portrait orientation, the page numbers for the landscape pages are at the right side centered vertically. I want all the page numbers at the bottom of the document when held in portrait orientation so the numbers are always in the same spot on every page. This is particularly an issue if the document winds up being printed double-sided because then the page number on landscape pages winds up in the binding on the backside.

    I toyed around with opening the combined PDF, and PRINTING to another PDF, and when I do that and then insert the page numbers they are all in the correct spot. The problem is I cannot figure out how to print a PDF to a new PDF using VBA, and this is something that needs to be done for 10-15 sets of documents every quarter so I really don't want to have a break in the action for this as a manual step.

    Thanks for considering.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!