Use @page CSS for exporting to PDF

Jonathan Wheeer's Avatar

Jonathan Wheeer

03 Sep, 2020 01:56 PM

Hi Brett,

I was using weasyprint to convert html into PDFs. It was nice because it would use the @media print and @page CSS to get just the right styling in the PDF.

Is there any functionality or plans for this functionality in marked? Is there a way to custom postprocess generated html using something like weasyprint?

  1. Support Staff 1 Posted by Brett on 03 Sep, 2020 03:26 PM

    Brett's Avatar

    I’m afraid @page isn’t available in the version of WebKit that Marked has to use, and it appears there will be no future development on that version. Hopefully Apple will fix some issues in the new version that will allow Marked to make use of it.

    As far as post processing, it’s not currently an option but I’m considering it for the future. One option is to use tee in a custom processor to output to a file in parallel with the preview.

    - Brett

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac