| Sneese 2005-02-25, 9:42 pm |
| I have a huge problem that I cannot solve.....the tight deadline makes it a huge problem.
I have a Delphi application that is handling our printing....we use the Delphi TPrinter object to draw all the boxes, text, ect. that we need. The printers we are using are Postscript-enabled printers.
Problem:
I need to pass in Postscript commands directly to the printer to instruct it to change source trays. I can pass in all of the "%%DocumentMedia" definitions ok....but when I pass in the "setpagedevice" command to switch trays, it invariably screws up the page it is on when it gets the command. Now, I realize that I should change media types when I'm in-between the pages, so I send in the GDI API call to EndPage({printerhandle}), and then call the ExtEscape function with the POSTSCRIPT_PASSTHROUGH specification to pass my setpagedevice command. But when I look at the spool file that gets created, there is a %%BeginPageSetup - %%EndPageSetup before the POSTSCRIPT_PASSTHROUGH block. I have manually edited these, and it works just like it's supposed to. But if I send it in as is, then whatever is on the page gets printed extremely huge and backwards!
Does anybody have any clue what's happenening here? Is the print huge and backwards because I sent a setpagedevice command when I was already on a new page? Where is the %%BeginPageSetup - %%EndPageSetup coming from? I am POSITIVE I send in the StartPage command. Is the EndPage API call assuming I want to start a new page and is inserting for me?
I am really at my wit's end...and I hope this makes sense. Please email me if you would like. |