WPCubed Product Support

PrintHDC outputs a blank page

In my case the problem has been caused by multithreading. Accessing a single viewer in a single Thread has fixed the problem.

Jonas

#5 ♥ 0
9.7k Views 3 users read 1 min

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

#4 ♥ 0

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

#3 ♥ 0
support

Hi,

Did You try PrintHDC(0, ..)

(Page number starting with 0)

Julian

#2 ♥ 0

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

#1 ♥ 0