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 Jan 11, 2024 8:58 am

While converting from html to pdf, the text in html is rendered as image in pdf.

If you observe in the files attached,
The html file content is in text and can be selected.
The PDF file content -header is in text, and the table content is image instead of text

Totally I need, images as images and text as text.

Please help me in this regard.

Thanks in Advance.

SwethaKalva
 
Posts: 9
Joined: Thu Mar 30, 2023 11:46 am

Thu Jan 11, 2024 9:56 am

Hello,

Thank you for your inquiry.
We appreciate your interest in our products and services. However, we regret to inform you that the code you provided is too complex and contains numerous interfaces and classes that are not provided, making it difficult for us to test and simplify it effectively.
To better assist you, we kindly request that you provide us with a simplified version of the code that we can directly run and replicate the issue you are facing. Please ensure that the simplified code does not contain any external dependencies or additional libraries that are not included.
Additionally, if there are any HTML files related to your code, please provide them as well so that we can better understand the context of your problem. You could attach them here or send them to us via email ([email protected]). Thanks in advance.
Thank you for your cooperation, and we look forward to receiving your simplified code and related files soon.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Jan 30, 2024 4:48 am

Please check the attached zip as you required.
I have placed html document is converting in to pdf (specially the table in html is becoming the image in PDF, which we need to solve)

SwethaKalva
 
Posts: 9
Joined: Thu Mar 30, 2023 11:46 am

Tue Jan 30, 2024 6:41 am

Hello,

Thank you for providing the information.
I have tested the code you provided and was able to reproduce the issue you mentioned. Upon further investigation, I noticed that you used the "LoadFromHTML()" method, which we currently do not maintain.
To address this issue, I suggest using our QT plugin method to test your HTML file. I have performed the test using the QT plugin, and the resulting file appears to be functioning correctly. I have attached the tested result file and a sample code snippet for your reference.
Code: Select all
Dim htmlString As String = File.ReadAllText("test.html")
Dim pluginPath As String = "F:\\Libraries\\Plugin\\plugins-windows-x64\\plugins"
Spire.Additions.Qt.HtmlConverter.PluginPath = pluginPath
Spire.Additions.Qt.HtmlConverter.Convert(htmlString, "output.pdf", True, 10 * 1000, New SizeF(594, 650), New PdfMargins(0, 50), LoadHtmlType.SourceCode)

Please refer to the tutorial on how to use the QT plugin method for more details.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Jan 30, 2024 9:27 am

Thanks for your prompt response.

Using QT plugin solves the issue as we have seen in many forums. But what actually happening is we are creating an header template , if you check my code. While using this createheadertemplate() the QT plugin is not working. Check my recent files once and give me the best possible working solution.

SwethaKalva
 
Posts: 9
Joined: Thu Mar 30, 2023 11:46 am

Wed Jan 31, 2024 10:03 am

Hello,

Thank you for your feedback.
Based on your description, I have modified the code you provided and implemented your requirements. Please refer to the attached code. However, the latest version of QT is required, and this version only supports Windows 10 and above. Linux is not yet supported. Please download the QT plugin through this link:https://www.e-iceblue.com/downloads/plugins/qt-6.5.3-plugins-windows-x64.zip

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Thu Feb 01, 2024 11:42 am

Thanks for your response and our issue image to text has been resolved with QT plugin.
But I am sorry to say we are facing another issue with page height and margins in PDFDOC.
Here I am attaching the code and sample pdf of the same .
The problem is my <th></th> is printing in middle or somewhere of the each page before as it is image the <th> has been rendered properly at starting of each page.
Please help me in this regard.

SwethaKalva
 
Posts: 9
Joined: Thu Mar 30, 2023 11:46 am

Fri Feb 02, 2024 6:56 am

Hello,

Thank you for your feedback.
Please note that the html file you provided about the table sets "page-break-before: always;" to force a page break. The QT plugin you downloaded from our website does not recognize this setting correctly. Please use the QT plugin I provided in my last post, this is the latest version, which can recognize "page-break-before: always;" and paginate correctly.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Mon Feb 05, 2024 10:53 am

We are thanking you for the support you have provided so far and our issue got resolved.

SwethaKalva
 
Posts: 9
Joined: Thu Mar 30, 2023 11:46 am

Tue Feb 06, 2024 1:34 am

Hello,

Glad to hear that the issue has been resolved.
If you encounter other issues related to our products in the future, please feel free to contact us.
Have a nice day.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF