New Forum | Previous | Next | (P-PDF) Beginners
Topic: non-interactive printing (AVDocPrintPagesWithPar)
Conf: (P-PDF) Beginners, Msg: 70662
Date: 8/16/2002 08:31 AM
I am trying get some degree of control over printing a document from Acrobat to a PS and/or non-PS printer.
The goal is to be able to change the printer settings (DEVMODE) from an external application.
I tried two things: one was to use the WinAppGetPrinterHDC in a PDDocWillPrintPage notification. I expected that if I perform a ResetDC on the HDC, I can change the printer settings. The ResetDC made no difference.
After that I settled for less. Instead of trying to get different settings for each page in the job I tried at least to be able to control to which printer the job goes and with what settings.
I found the AVDocPrintPagesWithParams function. The AVDocPrintParams parameter as a field ASPlatformPrinterSpec printerSpec. One of the fields of this ASPlatformPrinterSpec structure is a HDC. I thought that if I create the HDC the way I want it to be and pass it in the printerSpec, I'll get the right output. But again, whatever changes to the printer defaults I made were not reflected in the output. I red some more and I noted that the HDC is used only for embedded printing (weird decision!). So I put the ebmeded flag to true and I filled the embeddedRect. Now I either get a crash (GPF) or I get a message box stating "Invalid Parameter".
I am pretty sure I'm missing something. Does anybody have and care to share code using the AVDocPrintPagesWithParams function?