Save Page as PDF: Large page sizes and UserUnit?
-
strivingJuno last edited by
I love Opera's feature of saving a web page as a custom format / single page PDF. This is just great for saving content in a readable form, as web pages are not usually designed to fit into pages. I work a lot with Jupyter notebooks. Again, page breaks generated by other HTML to PDF converters interfere much with readability.
However, there is one significant problem. Some PDF readers (notably Acrobat) have a size limitation for PDFs with custom page format. When I open the generated PDF file in Adobe Acrobat, the following error is reported:
The dimensions of this page are out-of-range. Page content might be truncated.
In my case, it truncates a considerable portion of the file (more than 50%)!
Question: How to recover from this?
Here's how far I've come. According to the PDF reference, the page size limit is:
The minimum page size should be 3 by 3 units in default user space; the maximum should be 14,400 by 14,400 units. In versions of PDF earlier than 1.6, the size of the default user space unit was fixed at 1 ⁄ 72 inch, yielding a minimum of approximately 0.04 by 0.04 inch and a maximum of 200 by 200 inches. Beginning with PDF 1.6, the size of the unit may be set on a page-by-page basis; the default remains at 1/ 72 inch.
Apparently, if a PDF exceeds 200 by 200 inches, it should set the
\UserUnit
attibute on a page-by-page basis. The attribute was added in PDF 1.6. Again from the reference:(Optional; PDF 1.6) A positive number that shall give the size of default user space units, in multiples of 1 ⁄ 72 inch. The range of supported values shall be implementation-dependent. Default value: 1.0 (user space unit is 1 ⁄ 72 inch).
I see that that Opera creates PDFs of version 1.4. A fix would require to first upgrade to PDF 1.6 and then to set the
\UserUnit
. How can this be done?It would be fantastic if the problem was solved within Opera, as it is not uncommon that a web page will be converted into large PDFs.
This problem has already been discussed elsewhere. For example: