our application is a Java webbased application which is used by a number of different organizations and which we host ourselves.
I'm currently struggling with the described issue. In our application we have a mass printing functionality that spits out PDF file's, generated by Apache FOP, which the user can then print. The problem is that sometimes some of those pages need to be printed in one printer(or a tray of one printer), the second one somewhere else and the third page in the same printer/tray as the first one.
My original intent was to use Adobe Javascript because it seems that it allows for a per-page printer selection(unfortunately no tray selection which is currently not supported). I could then solve the tray selection by selecting different printers who each have a different default tray. The last part is the problem:
So my question is, does someone know how, or if it's possible, to create network printers with default trays? This would also mean that a network printer needs to be able to have multiple IPs, each with a different setting.
PS: When writing this, I realized it may be more of a sysadmin type of question. However, considering this problem is programming related I think it's belongs here开发者_运维问答.
Network printers don't need to have different IP addresses; windows printer can point to same IP and use same driver, so what you are trying to achieve is possible (then each printer can have different default settings - trays, etc...)
Alternatively, you can check for Java libraries that would allow you to print PDFs, for example this post talks about one (might not be as stable or complete as you require)
By creating multiple PDFs and printing them directly from Java, your can set all the options you want to route your rpints to the right tray. The "media" parameter lets you choose the tray.
精彩评论