wkhtmltopdf - Exit with code 1 due to network error: ContentNotFoundError

12,136

Solution 1

SOLUTION: This is for those with the error:

Exit with code 1 due to network error: ProtocolUnknownError

If you get an error when uploading an image/media, you have to upload that image to your own http server or hosting, for example in XAMPP. Put the complete link of the image in the html, example:

<img src='https://127.0.0.1/web/chart.jpg'>

In this way the images will be loaded well at the time of passing them to pdf. When creating the pdf, you can already delete the image from the hosting or remove the server.

Solution 2

This is happening when the renderer could not load a/some javascript/image/font file. After resolving missing resource, the issue was fixed.

Share:
12,136
Muneer Muhammed
Author by

Muneer Muhammed

Updated on June 04, 2022

Comments

  • Muneer Muhammed
    Muneer Muhammed almost 2 years

    I am trying to build a PDF file out of the HTML file. When I run the command to convert the HTML file the response was

    Counting pages (2/6)                                               
    Resolving links (4/6)                                                       
    Loading headers and footers (5/6)                                           
    Printing pages (6/6)
    Done                                                                      
    Exit with code 1 due to network error: ContentNotFoundError