Html To Pdf: Border for merged cell is missing using Webkit Linux on Ubuntu 18.04, but works ok using Webkit Windows on Windows

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

EMAIL

email

EMAIL

email

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


7 Replies 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team September 3, 2021 12:27 PM UTC

Hi Rex, 

Thank you for contacting Syncfusion support. 

You can overcome this issue by using our latest Blink rendering engine which is internally using chrome headless for printing PDF document. So it will preserve the PDF document as like the chrome print preview. This rendering engine support more styles and HTML features when comparing to WebKit rendering engine. Can you please try the conversion in latest Blink rendering engine which supports latest features from web. Please refer below links for more information about Blink rendering engine.  
 
Please try the above suggestions in your end and let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K 



RE rex replied to Gowthamraj Kumar September 3, 2021 01:25 PM UTC

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



RE rex replied to rex September 3, 2021 02:31 PM UTC

Hi, sorry, the remote images not loading problem is because my firewall blocked chome. Solved.

Thank you!

Rex



RE rex September 3, 2021 07:18 PM UTC

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".

  1. I copied BlinkBinariesLinux to the server and made sure chrome is given all permissions. This error appears.
  2. Then I gave chrome_wrapper and the specified temp folder all permissions, error persist.
  3. Revert the engine back to Webkit(everything else stays the same), it works on both platforms with the same table border problem as described eariler.
As I mentioned above, on windows, Blink engine works with the exception of font not being applied, but on Linux, it doesn't work and the error message is not helpful. 

I am grateful for your help.

Best regards,

Rex


GK Gowthamraj Kumar Syncfusion Team September 6, 2021 10:45 AM UTC

Hi Rex, 

Thank you for your update.

We did not faced the unhandled exception in Linux with our Blink converter. However, Please make sure have you provide the execute permission for chrome and chrome-wrapper, chrome_sandbox file inside the BlinkBinaries folder. 

 

 

Also, please try to add the below command line arguments in our converter setting, 

//Set command line arguments to run without sandbox. 
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox"); 
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox"); 



If still you are facing issue in Blink, kindly provide more details such as complete input HTML file/URL (with all resources styles, scripts, etc.,), complete code snippet, environment details (OS, Bit version, RAM, etc) ,product version to check the issue in our end. So, that it will be helpful for us to analyze and assist you further on this. 

Regards, 
Gowthamraj K 



RE rex replied to Gowthamraj Kumar September 6, 2021 12:07 PM UTC

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



Marked as answer

GK Gowthamraj Kumar Syncfusion Team September 7, 2021 06:14 AM UTC

Hi Rex, 

Thank you for your update. We are glad to know that your problem has been solved. 

We will include the prerequisites details for Linux in our Blink UG documentation and update the details.
  
Regards, 
Gowthamraj K 


Loader.
Up arrow icon