microtronx 38 Posted May 10, 2022 Hi folks, after searching a lot for different possibilities, Alexander remembered me that we can use his components (https://delphihtmlcomponents.com/) to create very simply pdf files on the fly. If you search for a component to create PDF files without much code from HTML (incl. using images files) use this code: thtdocument.HTMLtoPDFFile(ahtmlstring:string; aPDFfile:string); Thanks to @Alexander Sviridenkov for his wonderfull components. 2 Share this post Link to post
Der schöne Günther 316 Posted May 10, 2022 WebView2 (used by TEdgeBrowser) can directly print to PDF, just saying. Share this post Link to post
microtronx 38 Posted May 10, 2022 43 minutes ago, Der schöne Günther said: WebView2 (used by TEdgeBrowser) can directly print to PDF, just saying. Yes, but with thtdocument you do not have any dependencies to other libs/dll's ... Share this post Link to post
Alexander Sviridenkov 357 Posted May 12, 2022 On 5/10/2022 at 8:49 AM, Der schöne Günther said: WebView2 (used by TEdgeBrowser) can directly print to PDF, just saying. Browsers do not support page headers and footers, different page sizes/orientation, printing page number and count of pages, repeated table headers, etc. 1 Share this post Link to post
Der schöne Günther 316 Posted May 13, 2022 Not sure where you got that from, browsers can do that perfectly fine. Here is an example with TEdgeBrowser and no additional libraries in Delphi: Printed, for example, in landscape orientation: Share this post Link to post
Alexander Sviridenkov 357 Posted May 13, 2022 Thanks, I didn't know Edge supports header/footer customization. Are header/footer embedded into page or passed separately? Does it support different headers/footers for different pages? Share this post Link to post