Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 27, 2016 9:20 pm

when converting an HTML document to PDF on my local machine it looks fine. When deployed to another server the formatting of the entire document is larger--fonts, divs, spacing, etc. Is this a known issue or is there a work around? Here is the code...

PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting = false;
htmlLayoutFormat.LoadHtmlTimeout = 5000;
PdfPageSettings setting = new PdfPageSettings();
setting.Size = PdfPageSize.A4;
setting.Margins = new PdfMargins(10f, 10f, 10f, 0f);
PdfDocument pdfPage = new PdfDocument(PdfConformanceLevel.Pdf_A1A);
.
.
.
Thread thread = new Thread(() =>
{ pdfPage.LoadFromHTML(html.ToString(), false, setting, htmlLayoutFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();

ralph.maynard
 
Posts: 2
Joined: Tue Sep 27, 2016 9:09 pm

Wed Sep 28, 2016 3:55 am

Hi,

Thanks for your inquiry. Please make sure whether the DPI settings are the same in different machines.

Sincerely,
Alan
E-iceblue support team
User avatar

Alan.Li
 
Posts: 35
Joined: Mon Sep 05, 2016 2:51 am

Wed Sep 28, 2016 6:14 pm

Is there a way to ignore DPI so that it is consistent across platforms? How else can we convert HTML to a PDF document and keep the format consistent across platforms?

ralph.maynard
 
Posts: 2
Joined: Tue Sep 27, 2016 9:09 pm

Thu Sep 29, 2016 9:36 am

Hi,

Thanks for your feedback. Please try another method.
http://www.e-iceblue.com/Tutorials/Spir ... lugin.html

Sincerely,
Alan
E-iceblue support team
User avatar

Alan.Li
 
Posts: 35
Joined: Mon Sep 05, 2016 2:51 am

Return to Spire.PDF