Benjamin Ettori created PDFBOX-4905:
---------------------------------------
Summary: Getting IllegalArgumentException when extracting
telemetry from PDF: PDLayoutDontCare
Key: PDFBOX-4905
URL: https://issues.apache.org/jira/browse/PDFBOX-4905
Project: PDFBox
Issue Type: Bug
Components: PDModel
Affects Versions: 2.0.19, 2.0.18, 2.0.17
Reporter: Benjamin Ettori
Given the following code
{code:java}
val catalog: PDDocumentCatalog = pdf.getDocumentCatalog
catalog.getPageLayout
{code}
For a specific document, catalog.getPageLayout throws an
IllegalArgumentException with the following trace
{code:java}
Error Detail:java.lang.IllegalArgumentException: PDLayoutDontCare
at org.apache.pdfbox.pdmodel.PageLayout.fromString(PageLayout.java:54)
at
org.apache.pdfbox.pdmodel.PDDocumentCatalog.getPageLayout(PDDocumentCatalog.java:479)
{code}
Looking at the source code for PageLayout we have the following values
{code:java}
SINGLE_PAGE("SinglePage"),
/** Display the pages in one column. */
ONE_COLUMN("OneColumn"),
/** Display the pages in two columns), with odd numbered pages on the left. */
TWO_COLUMN_LEFT("TwoColumnLeft"),
/** Display the pages in two columns), with odd numbered pages on the right. */
TWO_COLUMN_RIGHT("TwoColumnRight"),
/** Display the pages two at a time), with odd-numbered pages on the left. */
TWO_PAGE_LEFT("TwoPageLeft"),
/** Display the pages two at a time), with odd-numbered pages on the right. */
TWO_PAGE_RIGHT("TwoPageRight");
{code}
The PDLayoutDontCare option is not present. However according to the pdf spec
it is a valid value
[https://help.adobe.com/pdfl_sdk/15/PDFL_SDK_HTMLHelp/PDFL_SDK_HTMLHelp/API_References/PDFL_API_Reference/PD_Layer/General.html#PDLayoutModePDLayoutDontCare]
Can you please fix this case?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]