Earlier quoted context omitted.
Or, please do? I use PDF's so I can send them to my iPad to read offline, highlight them, annotate them, and then send them back to my filesystem with highlights and annotations intact. I sure can't do that with any "nice formats" like HTML or TXT or EPUB or MOBI.
You could, though. What you are describing are features of an editor, not a file format. I can imagine a browser addon performing the same tasks.
Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
51–60 of 170 posts
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#52Just print to PDF in a browser, or automate that using a browser automation tool. For a non-browser-based open source solution, WeasyPrint. https://weasyprint.org/ For a proprietary solution, try Prince XML: https://www.princexml.com/
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#53A reverse of this question; what is the best way to convert pdf to html? We are required by accessibility law to make our PDFs WCAG compliant however it would be easier to convert these to HTML.
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#54chrome --headless --disable-gpu --print-to-pdf https://example.com
with an elaborate script that relies on xdotool
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#55Just print to PDF in a browser, or automate that using a browser automation tool. For a non-browser-based open source solution, WeasyPrint. https://weasyprint.org/ For a proprietary solution, try Prince XML: https://www.princexml.com/
Yes it costs money. So does developer time.
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#56Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#57Earlier quoted context omitted.
Curious why that matters to you? I mean everything has dependencies (some of the solutions elsewhere require Chrome and other common solutions require the JVM). At least Pandoc is GPL.
It matters because pandoc is not rendering the website to pdf, it converts the html to latex and then uses a latex engine to render the pdf.
Because lots of things work this way. For example compilers built on LLV uses an intermediate language and Python uses byte code.
I suspect some html to pdf tools go through postScript.
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#58If your HTML is simply an intermediary to get you to a PDF, you could consider just skipping straight to building the PDF directly: https://pdfbox.apache.org This would be far more efficient than spinning up an entire browser and printing PDFs to disk.
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#59Earlier quoted context omitted.
Curious why that matters to you? I mean everything has dependencies (some of the solutions elsewhere require Chrome and other common solutions require the JVM). At least Pandoc is GPL.
There are multiple ways to "depend", so if pandoc executes some external tool all of the work then might as well use that external tool directly. You will get more control over how the conversion happens, know for what search for when in trouble etc.
Of course Latex gives you fine control to hand tune the engine…but that doesn’t seem like what the OP is looking for.
Re: Ask HN: What is nowadays (opensource) way of converting HTML to PDF?
#60Earlier quoted context omitted.
You could, though. What you are describing are features of an editor, not a file format. I can imagine a browser addon performing the same tasks.
PDF annotations sit within the file.