Good day I've wrote this code in python to convert any website into an PDF:
import pdfkit
# Define Path of wkhtmltopdf.exe
pathToWkhtmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe'
# Point pdfkit configuration to wkhtmltopdf.exe
config = pdfkit.configuration(wkhtmltopdf=pathToWkhtmltopdf)
# Convert HTML file to PDF File
pdfkit.from_url('http://127.0.0.1:8050/', 'test.pdf', configuration=config)
It works perfectly well on any URL I enter into the pdfkit.from_url('<url_path_name>'), but as soon as I try to render a local dash app it comes out like this:
Here is what my test dash app looks like:
and that should be converted into a pdf that should look something this:
Meanwhile when I use my localhost URL it comes out like this:
I'm not sure How to fix this problem. Please note that the pdf that has to be rendered needs to be static and not image based