[
https://issues.apache.org/jira/browse/PDFBOX-4490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16800078#comment-16800078
]
Tilman Hausherr edited comment on PDFBOX-4490 at 3/24/19 2:13 PM:
------------------------------------------------------------------
There is a difference but I suspect this is an improvement. The signature when
rendering PDFBOX-3714-2.pdf is no longer visible. However, for the file
PDFBOX-3714-2-fixed.pdf the signature is never visible, i.e. not before and not
after the change. (The annotation flags are gone)
was (Author: tilman):
There is a difference but I suspect this is an improvement. The signature when
rendering [^PDFBOX-3714-2.pdf] is no longer visible. However, for the file
[^PDFBOX-3714-2-fixed.pdf] the signature is never visible, i.e. not before and
not after the change. (The annotation flags are gone)
> .getNumberofPages() returns incorrect value
> -------------------------------------------
>
> Key: PDFBOX-4490
> URL: https://issues.apache.org/jira/browse/PDFBOX-4490
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.14
> Environment: Operating System: Ubuntu 18.04
> Framework: Grails 2.5.6
> Reporter: Spencer
> Assignee: Andreas Lehmkühler
> Priority: Trivial
> Fix For: 2.0.15, 3.0.0 PDFBox
>
> Attachments: NeS1078.pdf
>
>
> Uses the following method to return total page numbers:
> {code:java}
> static int pageCount(byte[] document) { withDocument(document) { PDDocument
> pdf -> pdf.getNumberOfPages() } }
> static Object withDocument(byte[] document, Closure clos) {
> PDDocument doc
> try {
> // Read the PDF file via PdfBox
> ByteArrayInputStream bais = new ByteArrayInputStream(document)
> doc = PDDocument.load(bais, MemoryUsageSetting.setupTempFileOnly())
> // Clone the Closure as a security measureee
> Closure clone = clos.clone()
> // Execute the custom processing on the PDDocument
> clone(doc)
> } finally {
> doc?.close()
> }
> }
> {code}
> When using the attached PDF, it returns a total of two pages.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]