Use command line to convert files to PDF
I want to write a makefile and convert changed MD file to
PDF.
Does Marked support command line convert?
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
Support Staff 1 Posted by Brett on 11 Mar, 2013 11:49 AM
No. You'll need to look into dedicated command line apps like wkhtmltopdf
or wkpdf in combination with the multimarkdown CLI.
2 Posted by Torsten Grust on 12 Oct, 2013 01:32 PM
When I use Marked2.app's export to HTML (*Include preview template in output* is selected) and then use
wkpdf
orwkhtmltopdf
— the two give essentially the same result — to convert to PDF, I get output that closely resembles the output generated by Marked2's PDF export.Text in both outputs differs in size, though: in the Marked2-generated PDF output, text appears to be noticeably smaller (about a factor of 2).
Does Marked2 shrink text on PDF export or otherwise treat text size specially? What could be an explanation for these considerable text size differences?
Thanks,
—Torsten
Support Staff 3 Posted by Brett on 12 Oct, 2013 04:43 PM
I'll have to do some testing, but it's likely because there are certain settings included in the Marked preview that aren't exported as part of the stylesheet (in order to avoid overriding certain custom styles). I'll check and see if there's something amiss, though.
-Brett
4 Posted by Torsten Grust on 12 Oct, 2013 04:49 PM
Thanks, Brett. That would be great!
—Torsten
Support Staff 5 Posted by Brett on 13 Oct, 2013 01:49 PM
@Torsten : I'm actually unable to replicate this issue. Do you have a custom style or are your zoom settings non-default?
6 Posted by Torsten Grust on 14 Oct, 2013 11:47 AM
Well yes, I am using a custom style. But that's why I use Marked2's "Include preview template in output" option: Marked2 and the external conversion to PDF use the same stylesheet.
I dig deeper into this in the course of this week and then get back.
And: Thanks for taking a look at this in the first place!
Cheers,
—Torsten
P.S. My use case for this: provide in-text-editor (here: Sublime Text) feedback to the user when a page of HTML-formatted Markdown will exceed the size of a printed page. Implementation: on save, editor sends relevant section of Markdown source to `mmd` and then through the external HTML-to-PDF converter to measure page count. For this to work sensibly, I need the external HTML-to-PDF conversion to create the same number of pages as Marked2's own PDF export.