'Syncfusion.Pdf.PdfException: 'Blink files are missing at' Error in HtmlTOPdf convertor

Hi @all

I have a .net project, which runs in docker-compose.

So that I'm using  `Syncfusion.HtmlToPdfConverter.Net.Linux`for the .net core application.


```

using Microsoft.AspNetCore.Mvc;

using Syncfusion.HtmlConverter;

using Syncfusion.Pdf;

using System;

using System.IO;

using Ucdp.Common.Controller;


namespace Catalog.Api.Controllers.V5

{

    [ApiController]

    [Route("v5/pdf-generate")]

    public class PdfGenerateController : UCDPApiController

    {

        public PdfGenerateController()

        {


        }


        [HttpGet]

        public IActionResult UrlToPdf()

        {

            try

            {

                //Initialize HTML to PDF converter.

                HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();


                //Convert URL to PDF document.

                PdfDocument document = htmlConverter.Convert("https://www.google.com");


                //Create memory stream.

                MemoryStream stream = new MemoryStream();


                //Save and close the document.

                document.Save(stream);

                document.Close(true);


                //return Ok("su");


                return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "HTML-to-PDF.pdf");

            }

            catch(Exception ex)

            {

                return HandleException(ex);

            }

        }

    }

}

```

this is my controller.

I run this controller and got the error.

```

Syncfusion.Pdf.PdfException: 'Blink files are missing at /root/.nuget/packages/syncfusion.htmltopdfconverter.net.linux/21.2.9/lib/netstandard2.0/runtimes/linux/native'

```


PLEASE ANYONE HELP ME?


3 Replies

SN Santhiya Narayanan Syncfusion Team June 9, 2023 10:54 AM UTC

We have checked the reported issue on our end but it is working properly.so we have attached the sample for your reference. Kindly try the sample on your end and let us know the result

Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebAPIDockerTest-500059707

On further analysis, if you set the runtime identifier, please remove it and try the conversion, or set the application folder to the blink path, then perform the conversion.

Please find the below link

https://help.syncfusion.com/cr/file-formats/Syncfusion.HtmlConverter.BlinkConverterSettings.html#Syncfusion_HtmlConverter_BlinkConverterSettings_BlinkPath

Already, we have identified and fixed this issue, and it will be available on Volume 2 2023 release..



DA Dilakshan Antony Thevathas June 10, 2023 02:43 AM UTC

Thanks @Santhiya Narayanan


I run your sample project. That works fine.

But I have a project in .net core 2.0.

I set the controller like your controller.

And, I change my Dockerfile like your Docker.

BUT, I just run my project, and Its returned an error


```

failed to solve: process "/bin/sh -c apt-get update && apt-get install -yq --no-install-recommends libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3 libgbm1" did not complete successfully: exit code: 100

```

Why we should add the 'lib' package on Dockerfile?

I think this error comes because of the different .net core Versions.

HOW TO SOLVE THIS?



SN Santhiya Narayanan Syncfusion Team June 13, 2023 02:53 PM UTC

On our further analysis, the .net 2.0 is out of support. So could you please try the conversion with latest version of .NET Core and let us know the result?

Please find the UG link

https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/docker

Please find the KB link

https://support.syncfusion.com/kb/article/7651/how-to-convert-html-to-pdf-in-linux-docker-container


Loader.
Up arrow icon