PrintHDC outputs a blank page

  • Hi

    I am using V1.46 of WPViewPDF and am trying to use the PrintHDC method to output a pdf to the printer canvas as shown below but I always get a blank page being output

    Printer.BeginDoc;
    WPViewPDF1.PrintHDC(1, Printer.Canvas.Handle, 600, 600);
    Printer.EndDoc;

    However the PrintPages method as shown below works fine.

    WPViewPDF1.BeginPrint('Microsoft Office Document Image Writer');
    WPViewPDF1.PrintPages(0, 0);
    WPViewPDF1.EndPrint;

    I need to use the PrintHDC as I want the contents of a pdf file to be output in the current print job, not a new print job.

    Any ideas?

    Regards

    Stephen

  • H

    PrintHDC(0,..) doesn't output anything either. What do you do internally that is different between the PrintHDC command and the PrintPages command. Does PrintPages use the same code as PrintHDC ?

    Stephen

  • Hi

    I have gotten around this problem by using the GetMetaFilePrn method and then doing PlayEnhMetaFile(Printer.Canvas.Handle, MetaFile.Handle, Rect(0,0,Printer.PageWidth,Printer.PageHeight))

    Regards

    Stephen