Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Custom page size #75

Closed
fenstrat opened this issue Nov 3, 2016 · 3 comments
Closed

Custom page size #75

fenstrat opened this issue Nov 3, 2016 · 3 comments

Comments

@fenstrat
Copy link

fenstrat commented Nov 3, 2016

The allowed options to --pagesize are fixed at (A3|A4|A5|Legal|Letter|Tabloid). Just wondering if I'm missing something simple to allow a custom page size?

I've tried inline css width: 300mm; height: 300mm; on the html/body/element being rendered, also tried params like --page-width 300mm from wkhtmltopdf - all with no luck.

@MrSaints
Copy link
Collaborator

MrSaints commented Nov 3, 2016

Yes, the pagesize flag was added before support for custom sizes arrived. This definitely needs to be added, but for now, it is not supported.

@fenstrat
Copy link
Author

Turns out there is a workaround for this available right now. Custom page sizes can be achieved with the use of the css @page rule. E.g. <style type="text/css" media="all">@page {size: 300mm 300mm;}. Big hat tip to @jaymiejones86 for this.

@MrSaints
Copy link
Collaborator

The page size should be configurable in v3 (https://github.com/arachnys/athenapdf/tree/cdp). But for v2, and below, please refer to @fenstrat's solution :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants