Thanks for quick response and Yes , the difference between ConvertUrl() and ConvertHtml() doesn't make sense to us either.
we already upload sample file to dropbox.com(because we don't know how to upload to forum). can you take a look?
https://www.dropbox.com/sh/a779qcmyay4zt1c/ILsjmbxFVD#/in this link,
scale_html.pdf - the PDF generate by ConvertHtml()
scale_url.pdf - the PDF generate by ConvertUrl()
scale.html - the source html file.
screen.jpg - the screen shot show the difference between ConvertHtml() and ConvertUrl()
our sample code
static void TestConvertUrl()
{
HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(16.01F, 13.86F);
HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0F,0F,16.01F,13.86F);
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit;
HtmlToPdf.Options.AutoFitY = HtmlToPdfAutoFitMode.ScaleToFit;
HtmlToPdf.Options.MinLoadWaitTime = 1000;
string htmlFile = "scale.html";
//using ConvertUrl to get PDF
HtmlToPdf.ConvertUrl(htmlFile, "scale_url.pdf");
}
static void TestConvertHtml()
{
HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(16.01F, 13.86F);
HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0F,0F,16.01F,13.86F);
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit;
HtmlToPdf.Options.AutoFitY = HtmlToPdfAutoFitMode.ScaleToFit;
HtmlToPdf.Options.MinLoadWaitTime = 1000;
string htmlFile = "scale.html";
//using ConvertHtml to get PDF
PdfDocument pdfDoc = new PdfDocument();
string text = System.IO.File.ReadAllText(htmlFile);
HtmlToPdf.ConvertHtml(text, pdfDoc);
pdfDoc.Save("scale_html.pdf");
}