We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I wrote this procedure to convert HTML to PDF. But the Table is not well drawn. HTMLViewer is used for rendering: https://github.com/BerndGabriel/HtmlViewer
procedure THTMLToXForm.HTMLViewerSynPDFClick(Sender: TObject); var Size : TSize; Viewer : THtmlViewer; pdfForm : TForm; pdf : TPdfDocumentGDI; begin pdf := TPdfDocumentGDI.Create; pdfForm := TForm.Create(nil); Viewer := THtmlViewer.Create(pdfForm); Viewer.Parent := pdfForm; Viewer.DefBackground := clWhite; Viewer.LoadFromFile(htmlFile); Size.cx := Round(HTMLWidthFromViewPort(viewer.Text)*pdf.ScreenLogPixels/25.4); Size := viewer.FullDisplaySize(Size.cx); pdf.AddPage; pdf.DefaultPageWidth := Size.cx; pdf.DefaultPageHeight := Size.cy; Viewer.Draw(pdf.VCLCanvas,0,Size.cx,Size.cx,Size.cy); pdf.SaveToFile(ChangeFileExt(htmlFile,'-HTML-To-SYNPDF.pdf')); pdf.Free; pdfForm.Free; end;
var Size : TSize; Viewer : THtmlViewer; pdfForm : TForm; pdf : TPdfDocumentGDI; begin pdf := TPdfDocumentGDI.Create; pdfForm := TForm.Create(nil); Viewer := THtmlViewer.Create(pdfForm); Viewer.Parent := pdfForm; Viewer.DefBackground := clWhite; Viewer.LoadFromFile(htmlFile); Size.cx := Round(HTMLWidthFromViewPort(viewer.Text)*pdf.ScreenLogPixels/25.4); Size := viewer.FullDisplaySize(Size.cx); pdf.AddPage; pdf.DefaultPageWidth := Size.cx; pdf.DefaultPageHeight := Size.cy; Viewer.Draw(pdf.VCLCanvas,0,Size.cx,Size.cx,Size.cy); pdf.SaveToFile(ChangeFileExt(htmlFile,'-HTML-To-SYNPDF.pdf')); pdf.Free; pdfForm.Free; end;
Reporter-HTML-To-SYNPDF.pdf
Reporter.txt
Best regards.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I wrote this procedure to convert HTML to PDF.
But the Table is not well drawn.
HTMLViewer is used for rendering: https://github.com/BerndGabriel/HtmlViewer
Reporter-HTML-To-SYNPDF.pdf
Reporter.txt
Best regards.
The text was updated successfully, but these errors were encountered: