ggrossetie / asciidoctor-web-pdf

Convert AsciiDoc documents to PDF using web technologies
https://asciidoctor.org
MIT License
455 stars 92 forks source link

Use page.setContent to load the HTML page instead of writing an HTML page and use page.goto #654

Open ggrossetie opened 2 years ago

ggrossetie commented 2 years ago

It might be possible to use page.setContent to load the HTML page: https://github.com/puppeteer/puppeteer/blob/v13.6.0/docs/api.md#pagesetcontenthtml-options

This strategy would allow to avoid writing an HTML file on disk.

Related: https://github.com/Mogztter/asciidoctor-web-pdf/issues/130

ggrossetie commented 2 years ago

It only works when the HTML document does not contain any linked local ressources (even if the path is absolute). It's also not possible to refresh a preview 😞