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.

Thu Jul 13, 2023 6:09 pm

Hello I'm trying to convert a url to pdf using the new pulgin

HtmlConverter.Convert(url, filePathPdf, true, 10000000, new Size(1080, 1000), new PdfMargins(0));

the issue that I'm facing out is. in the url (page) we have some ajax call to get some dynamic data, pdf is printing correctly but not waiting for the ajax call to be completed and printing out without the dynamic data, any thoughs on how we can resolve this?

dankings
 
Posts: 2
Joined: Thu Jul 13, 2023 5:56 pm

Fri Jul 14, 2023 5:48 am

Hi,

Thanks for your inquiry.
We would like to inform you that when using the Qt plugin, it is not recommended to have dynamic data retrieval in the HTML itself. The conversion process is triggered after the page has finished loading, and at that point, dynamic requests may not have been initiated or might still be in progress. To ensure the completeness of the converted PDF, we suggest avoiding dynamic calls or ensuring that any dynamic calls are made before the Loaded event of the HTML.

If you have any further questions or concerns, please feel free to let us know. We are here to assist you.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue Jul 18, 2023 11:34 pm

[quote="Triste.Dai"]Hi,

Thank you for the reply, yes I do have another concern, using the plugin I'm not able to generate the pdf in landscape

trying to use
HtmlConverter.Convert(url, filePathPdf, true, int.MaxValue, PdfPageSize.A4, new PdfMargins(0), Spire.Pdf.HtmlConverter.LoadHtmlType.URL);

and changing the PdfPageSize.A4 option looks like it does not matter and do not have any affect into the pdf

dankings
 
Posts: 2
Joined: Thu Jul 13, 2023 5:56 pm

Wed Jul 19, 2023 1:46 am

Hi,

Thank you for reaching out to us regarding the issue with the Qt plugin for converting HTML to PDF. We have met and investigated the problem before and found that it is related to the page size settings specified within the HTML itself, which overrides the page size settings in our code.

We kindly request you to check if your HTML document specifies a page size. You can refer to the last reply in this forum thread for more information: https://www.e-iceblue.com/forum/convert-html-to-pdf-margins-and-font-size-not-accurate-t12305.html

If you continue to experience difficulties, please provide us with the HTML file or URL along with any relevant information. Our team will analyze the issue to assist you further.

Thank you for your cooperation, and we look forward to resolving this matter promptly.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF

cron