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,
Using this code to convert HTML to PDF via SynPdf component, the PNG image is not rendered ; JPG does.
function THtmlPager.SynPdf:TBytes; label Clear; var OK : Boolean; Size : TSize; PDF : TPdfDocumentGDI; Stream : TMemoryStream; begin PDF := nil; PDF := TPdfDocumentGDI.Create; OK := True; Size := FullDisplaySize(Width); try {PDF.UseUniscribe := True;} PDF.DefaultPaperSize := psUserDefined; PDF.ScreenLogPixels := Screen.PixelsPerInch; PDF.Info.Author := EditorOrgName; PDF.Info.CreationDate := Now; PDF.Info.Creator := ApplicationName; PDF.Info.Keywords := ''; PDF.GeneratePDF15File := True; PDF.DefaultPageWidth := Round(Size.cx*72/PDF.ScreenLogPixels); PDF.DefaultPageHeight := Round(Size.cy*72/PDF.ScreenLogPixels); PDF.AddPage; HTMLPaint(PDF.VCLCanvas,Rect(0,0,Size.cx,Size.cy)); except OK := False; end; if (not OK) then goto Clear; Stream := TMemoryStream.Create; try PDF.SaveToStream(Stream); except Stream.Clear; end; SetLength(Result,Stream.Size); Stream.Position := 0; Stream.Read64(Result,0,Length(Result)); FreeAndNil(Stream); Clear: if Assigned(PDF) then FreeAndNil(PDF); end;
Would real rendered Width and Height determined without the default width parameter provided to FullDisplaySize function?
Would margins set to 0 so document and control widths will be identical by introducing paraemetrs to the function:
procedure THtmlViewer.UpdateSize; begin if AutoSize then begin HScrollBar.Visible := False; VScrollBar.Visible := False; SetBounds(Left, Top, ScrollWidth + 2, MaxVertical + 2); end; end;
which would be:
procedure THtmlViewer.UpdateSize; begin if AutoSize then begin HScrollBar.Visible := False; VScrollBar.Visible := False; SetBounds(Left, Top, ScrollWidth + WidthMargin, MaxVertical + HeightMargin); end; end;
Best regards.
The text was updated successfully, but these errors were encountered:
Hello, The Width attribute is not parsed inside CSS body (210mm). The real Width of the html is set ignoring this attribute.
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Residence information</title> <style> body { font-family: "Courier New", Courier, monospace; font-size: small; position: absolute; width:210mm; margin:0mm; }
Please note that the Height is set to its correct value.
Sorry, something went wrong.
Sorry,
The PNG rendering problem is caused by the SynPdf component! https://github.com/synopse/SynPDF
No branches or pull requests
Hello,
Using this code to convert HTML to PDF via SynPdf component, the PNG image is not rendered ; JPG does.
Would real rendered Width and Height determined without the default width parameter provided to FullDisplaySize function?
Would margins set to 0 so document and control widths will be identical by introducing paraemetrs to the function:
which would be:
Best regards.
The text was updated successfully, but these errors were encountered: