PDA

View Full Version : Print directly to a specific printer


Buebber
March 7th, 2007, 01:02 AM
Hello,

we bought the ActiveX control. Now I want to print a pdf to a specific printer WITHOUT opening the print-dialog.

Is this possible? (Yes it is, with the new Version of the SDK)

Can you give me an example how to realize it with C++?

Thanks

Buebber


I use the direct print function to print out a PDF to a specific printer. This works fine but how can I change the printer settings? Documents in landscape are scaled to fix the paper.
Can I tell it to the ActiveX or can I only set this settings using the PrinterDevice (Document Settings)?

tree
March 21st, 2007, 07:05 PM
CPrintDialog Dlg(false, PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS
| PD_HIDEPRINTTOFILE | PD_NOSELECTION, NULL);

if(Dlg.DoModal()==IDOK)
{
UpdateData(false); //shows printer information in the textbox
HDC hDc=Dlg.GetPrinterDC();
m_FoxitReader.Print((long)hDc,1,1,1,1,100,0,0); //m_FoxitReader is type of CFoxitReaderSDK
}