Can i use wPDF Canvas HDC as hPrinterDC?

  • Hi Julian, i use an external DLL to view and print CAD draw.
    I need to print the CAD draw into a PDF, the DLL have a function as this:

    BOOL CadPrint (
    VDWG hDwg, // handle to CAD object
    BOOL bPrintStamp, // stamp's visibility
    HDC hPrinterDC // handle to printer device context
    );

    Can i pass wPDF canvas HDC as hPrinterDC ?
    I tryied to do that but i don't see nothing on the PDF, i need to set something else or what i try to do it's simply 'stupid'?

    Best regards,
    Enrico.

    • Offizieller Beitrag

    Hi,

    You need to use StartPage to make wPDf.Canvas valid. The page must be big enough.

    I would suggest to use CanvasReference = Printer.

    If you don't see anthing the the PDF it does not mean it is empty. Create it without compression and check the file with a file viewer if there is anything in the contents of the created page.

    Julian

  • Hi Julian
    i write the code below but nothing appear into the PDF file.
    The produced PDF files are alwais (2.244 byte) big, the same size if i don't do the CadPrint ( hDwg, false, DC ); instruction.

    I attach here my simple code any help would be appreciated.

    Best regards,
    Enrico