Printing duplex/source tray selection

I am investigating PDF products, and I am wondering if the following is possible with Aspose PDF: I would write an application that creates PDF files with embedded codes (such as or <select source tray 2>). I would then create a second application that reads the PDF file and prints it using the previously embedded codes. The separation between the functions is due to our product being modular, and the application that prints the PDF file is common across all of our installations, while the application that creates the PDF varies by site.

@jasonawarner

Could you please explain a bit more about how you want to embed the codes? Do you want to add JavaScript code in the document that can execute while printing? Can you please share a sample PDF document for our reference along with some more details of the functionality that you want to achieve? We will further proceed to assist you accordingly.

I have not actually gotten to the point where I have figured out how to embed the codes. I was thinking of using an old trick where you “print” the commands, as “white-on-white” text or “zero-font-size” text so they don’t appear on the paper. Another option is using the annotation layer in the PDF, which does not print. The idea being that the “creator” of the PDF knows the rules about HOW it needs to print (source tray, duplex) and communicates it to the “consumer”. The “consumer” (which is a different app) then reads the embedded codes and prints the PDF following the instructions provided by the “creator”.

@jasonawarner

Your requirements seem possible by using Aspose.PDF. Sure, you can add Annotation/Text or any marker in the PDF document and later on retrieve it using the API to decide how the file should be printed. Please check below article(s) for adding and reading annotations from PDF file.