JazzCore / python-pdfkit

Wkhtmltopdf python wrapper to convert html to pdf
MIT License
1.99k stars 329 forks source link

Issue with HTML to PDF Translation - Images Getting Cut Off #249

Open amanshitta-crossml opened 1 year ago

amanshitta-crossml commented 1 year ago

I am encountering an issue while attempting to translate HTML content into PDF format. The content includes tables and images, but there is a specific problem where images are being cut in half when the content flows onto the next page. I am seeking guidance on how to resolve this issue.

image

amanshitta-crossml commented 1 year ago

Here's additional information on how I am generating the PDF and the available options for PDF creation.

`pdf_options = { 'page-size': 'Letter', 'margin-top': '1in', 'margin-right': '0.75in', 'margin-bottom': '0.75in', 'margin-left': '0.75in', 'encoding': 'UTF-8', 'header-line': None, 'header-html': 'header.html', 'footer-html': 'footer.html', 'disable-external-links': None, 'quiet': None }

pdfkit.from_string(html_content, output_file, options=pdf_options)`