I tried to convert an html to pdf and I get a strange result.
The text is clipped because the library don't understand the "zoom" parameter in the inline css
more, it puts everything on one page even though I told him to use the A4 format.
Where am I wrong?
The attachment shows the html I used for the test, the pdf is too big and I can't attach it.
Thank you
- Code: Select all
var doc=new PdfDocument();
var pgSt=new PdfPageSettings();
pgSt.Size=PdfPageSize.A4;
pgSt.Orientation=PdfPageOrientation.Portrait;
var htmlLayoutFormat=new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting=false;
htmlLayoutFormat.WaitingTime=2000;
htmlLayoutFormat.Layout=Spire.Pdf.Graphics.PdfLayoutType.Paginate;
var htmlpath=@"c:\tmp\x.html";
var source=File.ReadAllText(htmlpath);
doc.LoadFromHTML(source,false,pgSt,htmlLayoutFormat);
doc.SaveToFile(@"c:\tmp\x.pdf");
doc.Close();