error trying to create pdf with Syncfusion.Pdf on netcore 3.1 ubuntu 20.04

When trying to create a pdf it is generating an exception on the platform I use netcore 3.0 on ubuntu20.04 server.

I see that it marks it when trying to do the PdfDocument document = htmlConverter.Convert(url);


      An unhandled exception has occurred while executing the request.
Syncfusion.Pdf.PdfException: xvfb-run: error: Xvfb failed to start

7 Replies

GK Gowthamraj Kumar Syncfusion Team May 24, 2022 10:22 AM UTC

Hi Dan padilla,


Our WebKit rendering engine internally makes use of the Syncfusion WebKitWrapper file for converting HTML to PDF. It requires read/write/execute permission in order to perform the conversion. We suspect that the file does not have the required permission. Kindly provide the read/write/execute permission for Syncfusion.WebKitWrapper file inside the QtBinariesLinux folder and temp folder on the machine. You can also set the read, write and execute permissions and let us know the result. Can you please add the below command to your machine and try the conversion.


chmod 777 /app/QtBinaries/QtBinariesLinux/Syncfusion.WebKitWrapper


chmod a+rwx -R /usr/bin/xvfb-run 


The reported exception may also occur due to missing prerequisites and dependent packages, kindly ensure that all the dependent packages are installed in the machine.

Please refer to the below link for dependency packages for converting HTML to PDF in Linux. 

Prerequisiteshttps://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#prerequisites-for-linux 

Troubleshooting - https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf#troubleshooting   

KB: https://www.syncfusion.com/kb/8481/how-to-convert-html-to-pdf-in-asp-net-core-linux


Kindly provide the read/write/execute permission for Syncfusion.WebKitWrapper file inside the QtBinariesLinux folder on the machine.  Please refer to the below KB documentation, 


 


Please let us know if you need any further assistance in this.


Regards,

Gowthamraj K



DP Dan padilla May 24, 2022 02:49 PM UTC



yes, I already had it working correctly.

Only this error just started throwing at me this week.


I tried what you mentioned but it didn't work :(



GK Gowthamraj Kumar Syncfusion Team May 25, 2022 01:10 PM UTC

Hi Dan,

Could you please try the below troubleshooting steps to overcome this issue on our end.


  • Please revert the changes have you done in your machine recently?
  • Make sure the root permission to install the package.
  • It seems the Server is already active, we suspect the running process in system with name Xvfb. If yes, please close it pkill Xvfb.
  • Remove the Xvfb package and install the package again with enough permission.

Regards,

Gowthamraj K



DP Dan padilla May 30, 2022 07:27 PM UTC

didn't work,

I reconfigured another server equal to the productive Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-1025-aws x86_64) and the same thing happens.

Already replace References.

Change the permissions.

Also pkill Xvfb.

Reinstall all https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#prerequisites-for-linux


It keeps throwing on the new server Syncfusion.Pdf.PdfException: xvfb-run: error: Xvfb failed to start



GK Gowthamraj Kumar Syncfusion Team May 31, 2022 02:12 PM UTC

Hi Dan padilla

Currently, we are trying to reproducing the reported issue in a same environment machine on our end and we will update the further details on June 2nd 2022.

Meanwhile, we request you to share the complete code snippet, Linux environment details to replicate the issue on our end. So that it will helpful for us.



Regards,

Gowthamraj K



DP Dan padilla May 31, 2022 02:21 PM UTC

I attach a screenshot of the example code.

this is the method that builds the pdf receives a website url to convert it to pdf


examplee.JPG



GK Gowthamraj Kumar Syncfusion Team June 2, 2022 04:42 PM UTC

Hi Dan padilla,


We have created a same Ubuntu 20.04 environment and ensure the HTML to PDF conversion using Net Core 3.1 application, but it is working properly. We have attached the sample for your reference, please try the sample on your end and let us know the result.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/HtmlToPdfSampleMVC1615834384


Please refer to the below link for dependency packages for converting HTML to PDF in Linux.  

UGhttps://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#prerequisites-for-linux 

Please try to install the commands in your server machine. 

sudo apt-get update

sudo apt-get install xvfb

sudo apt-get install libssl-dev

sudo apt-get install libx11-dev libx11-xcb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xfixes0-dev libxcb-xkb-dev libxcb1-dev libxfixes-dev libxrandr-dev libxrender-dev  

Regards,

Gowthamraj K


Loader.
Up arrow icon