Closed djplaner closed 3 years ago
Comparison of XHTML2PDF, WeasyPrint and UnoConv
Python - source code Documentation
Seems to be able to be provided a HTML string.
Perhaps not as complete.
Is based on using OpenOffice. COuld be interetsing, but heavyweight.
pip install Weasyprint
weasyprint URL PDFFile Failure on Windows with default install
success somewhat. Still need to run the Javascript on it.
FAILURE The javascript is not handled by Weasyprint - at least default
Suggestion is to use a Javascript pre-processor first.
Apparently PhantomJS is an option. But it isn't being maintained. The alternative is headless chrome or similar. i.e. something that works on the completed DOM after Javascript has run. e.g. Python + Selenium
Basically working. However, by default accordions can create some issues. Remove them and all ok.
What about expandAll? Could get selenium to click the expandAll button
These don't seem to working too well.
Explore if Javascript librararies might provide a way to produce offline versions of Content Interface.
And/or Python libraries that might be combined with screen scraping.
Rationale
The Word documents can contain styling and embedded documents that don't print well. They are applied on the web. If we're able to use those to generate PDF/DOC the styling will be applied
Current status
Weasyprint with Python script can produce a PDF that's close, but