2

I am just using the app engine python file conversion api for the first time. I am converting html to PDF. It seems to work well, and pretty fast too, but even though the html page is set to 960px width the resulting PDF crops off the content, because the PDF seems to be formatted to output portrait in A4 size.

Looking at the docs I can't see any options for this. If I could make it landscape it should fit.

Am I missing something obvious or is it always A4 portrait?

Justin Grayston
  • 352
  • 2
  • 10

1 Answers1

3

While I haven't tried this myself, the GAE Conversion API supports Paged Media CSS for customization of the HTML->PDF conversion, and it may be that the page 'size' property ( http://dev.w3.org/csswg/css3-page/#page-size-prop ) is what you need.

Amy U.
  • 2,227
  • 11
  • 11
  • Thank you Amy!! You know, no matter how many times I read that my brain never actually took it in. Just adding these lines worked a treat. @page { margin: 1cm; size: A4 landscape; } PDF Looks perfect. – Justin Grayston Feb 16 '12 at 20:32