Open nikkicantrell opened 3 years ago
Hi @nikkicantrell. Thanks for your report.
Do you happen to have examples for the three cases that you could provide us so we can investigate further?
If so, would you mind if we use these samples in our test suit to avoid future regression?
It would also be great if you could send us a minimal working code that reproduces these issues.
Giving this snippet of HTML in file file_name to PreviewManager.get_pdf_preview() generates a 2-page pdf without NAME anywhere in the file. That's first line cut and empty page at the beginning
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>look it up yourself</title>
</head>
<body>
NAME<br>
look it up yourself<br><br>
LINK<br>
<a href="https://www.google.com">https://www.google.com</a><br>
DESCRIPTION<br>
test file<br>
</body>
With the above html in the same directory as the below python script as simple.html, running this generates the failed pdf.
from preview_generator.manager import PreviewManager
PREVIEW_OUTPUT_FOLDER = '.'
def main():
proof_file = 'simple.html'
preview_manager = PreviewManager(PREVIEW_OUTPUT_FOLDER, create_folder=False)
preview_manager.get_pdf_preview(proof_file)
if __name__ == '__main__':
main()
Generating a PDF preview for an HTML document has a couple problems: