Hi, thank you very much for making such a great library as Html To Pdf for dotnet.
Project: Dotnet 5.0, Webapi
I have got an HTML table like the below:
CREDIT NOTE
|
CUSTOMER |
Customer Name |
FROM |
from |
|
ATTENTION |
att |
DATE |
date |
|
ADDRESS |
add |
CONTACT PERSON |
contact |
|
PHONE |
phone |
||
|
PHONE |
phone |
|
|
|
|
SZ OFFIC |
add |
|
|
Document NO. |
doc |
PI NO. |
pi |
On my windows 11 dev PC, with QtBinariesWindows, the outcome pdf is perfect like so:
However, without any code changes, when I publish to Ubuntu 18.04 server, with QtBinariesLinux, the table in the pdf is like this:
I would be grateful if you could please help and point me in the right direction.
Thank you!
Rex
Thank you!
I tried to replace the engine to Blink, everything else stays exactly the same.
With Blink, Remote images(not loaded) and font(in the css, not applied) are not working correctly while Webkit engine are doing fine.
Is there anything extra I need to do differently for Blink engine please?
Best,
Rex
Hi, sorry, the remote images not loading problem is because my firewall blocked chome. Solved.
Thank you!
Rex
I ignored the font problem and tried to publish to the Ubuntu server with Blink engine.
It fails, stating "Syncfusion.Pdf.PdfException: Failed to convert webpage".
|
//Set command line arguments to run without sandbox.
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
|
Hi Gowthamraj,
Thank you very much for your help.
I did what you advised but still got the same error message.
However, I tumbled on to this blog post: https://www.syncfusion.com/kb/11299/how-to-convert-html-to-pdf-using-blink-in-linux-docker and solved the problem.
It turns out that I missed the dependencies on Linux. After installing a whole bunch of libs as stated in the blog post, shown below, everything worked. Fonts are also applied correctly on Linux, table border is fixed, awesome!
The official doc for blink prerequisites for linux https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/blink#prerequisites-for-linux have missed the above requirement of libs while WebKit documents have not.
I have submitted a PR for the doc: https://github.com/syncfusion/fileformat-docs/pull/5, hope it helps.
Thank you,
Rex