We are using PDF-XChange SDK (PDFXEditSimple DLL) in our C# Windows Service
application to print PDF files programmatically. We are experiencing an issue
where printed output comes out as blank pages with a specific printer driver.
Environment:
- SDK: PDFXEditSimple.x86.dll (via P/Invoke)
- OS: Windows (x86 service process)
- Printer Driver: Canon Generic Plus LIPSLX
- PDF: Label layout PDF (A4 size)
Printing Method:
We use System.Drawing.Printing.PrintDocument with the OnPrintPage event handler.
In the handler, we call PXCV_DrawPageToDC to render the PDF page to the
printer's device context (HDC).
Code summary:
Code: Select all
// Render parameters
crp.Flags = (int)PXV_CommonRenderParametersFlags.pxvrpf_UseVectorRenderer; // 0x0004
crp.RenderTarget = PXCV_RenderMode.pxvrm_Printing; // 1
crp.WholePageRect = // calculated scaled RECT
// Render to printer DC
IntPtr hDC = e.Graphics.GetHdc();
PXCV_DrawPageToDC(hDoc, pageNum, hDC, ref crp);