开发者

mkd2pdf, wkhtmltopdf, how to make PDF for slide

开发者 https://www.devze.com 2023-03-09 10:38 出处:网络
I want to make PDF by mkd2pdf which base on wkhtmltopdf It can generate PDF from markdown, it use a css file to control the style. just like this

I want to make PDF by mkd2pdf which base on wkhtmltopdf

It can generate PDF from markdown, it use a css file to control the style. just like this

h1 {
  page-break-before: always;
}

so, I can make a slide, and each # h1 # will be a new page. It has close to my goals that generate slide from markdown.

but the output PDF is A4 ratio, I need a 4:3 ratio which fit page to full screen. I think wkhtmltopdf have some option, or some print开发者_开发知识库 control css can control this, but I don't know how.


the output PDF is A4 ratio, I need a 4:3 ratio which fit page to full screen. I think wkhtmltopdf have some option, or some print control css can control this, but I don't know how.

See: http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

The default page size of the rendered document is A4, but using the --page-size option this can be changed to almost anything else, such as: A3, Letter and Legal. For a full list of supported pages sizes please see http://doc.trolltech.com/4.6/qprinter.html#PageSize-enum.

For a more fine grained control over the page size the --page-height and --page-width options may be used

And:

--page-height       <unitreal>      Page height (default unit millimeter)
--page-size         <size>          Set paper size to: A4, Letter, etc.
--page-width        <unitreal>      Page width (default unit millimeter)

UPD: Docs by this URL might be less outdated: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号