#1 2014-09-18 09:31:51

Gundur
Member
Registered: 2014-09-18
Posts: 2

Printing

Hi

im not the delphi pro, so i used the sample html2pdf code to convert a html page into a pdf.
This works fine, now i like to directly print the pdf with a specific printer (or send it directly to a printer) from the application.
Can someone give me some hints?
Do i have to use SaveToStream und print the stream? If yes how?

regards
Matthias

Offline

#2 2014-09-18 10:52:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Printing

You have to use a PDF reader to print the content.
For instance, you can use Acrobat Reader from the command line.
Just search in Stack Overflow, e.g. http://stackoverflow.com/q/2055307/458259

The easiest is to print directly from the THmlViewer component, if you can.
smile

Offline

#3 2014-09-18 11:45:11

Gundur
Member
Registered: 2014-09-18
Posts: 2

Re: Printing

The problem is i have to print formatted cards generated from HTML.
The HTML is only on the right side of the card so the best way for me was to use htmlt2pdf and place the converted html on the right side and print.
I formerly used debenu quickpdf but this library does not support font-face and things like that.
Is there no possibility to get the pdfcanvas printed directly in delphi?

Offline

#4 2014-09-18 11:56:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Printing

I still can't get it, sorry.
If you use html2pdf you have access to the THtmlView instance, so you can print directly from it, without using the pdf generation.

Gundur wrote:

Is there no possibility to get the pdfcanvas printed directly in delphi?

No, by design.

But if you use TPdfDocumentGDI, its VCLCanvas CAN be printed directly.

Offline

Board footer

Powered by FluxBB