You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/09/02 07:20:46 UTC
[jira] [Comment Edited] (PDFBOX-2953) PDFBox shows the wrong page
number
[ https://issues.apache.org/jira/browse/PDFBOX-2953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14726765#comment-14726765 ]
Tilman Hausherr edited comment on PDFBOX-2953 at 9/2/15 5:20 AM:
-----------------------------------------------------------------
I suspect you have logs disabled.
Anyway, the file is encrypted and a message should come up. What you should do is either:
- do this after load()
{code}
if (doc.isEncrypted())
{
StandardDecryptionMaterial sdm = new StandardDecryptionMaterial(PDF_USER_PASSWORD);
doc.openProtection("");
}
{code}
- or make your life even easier, by using {{loadNonSeq(new File(...), null);}} no call to openProtection is needed then.
The current version is 1.8.10.
Does it work now?
was (Author: tilman):
I suspect you have logs disabled.
Anyway, the file is encrypted and a message should come up. What you should do is either:
- do this after load()
{code}
if (doc.isEncrypted())
{
StandardDecryptionMaterial sdm = new StandardDecryptionMaterial(PDF_USER_PASSWORD);
doc.openProtection("");
}
{code}
- or make your life even easier, by using {{loadNonSeq(new File(...), null);}} no call to openProtection is needed then.
The current version is 1.8.10.
> PDFBox shows the wrong page number
> ----------------------------------
>
> Key: PDFBOX-2953
> URL: https://issues.apache.org/jira/browse/PDFBOX-2953
> Project: PDFBox
> Issue Type: Bug
> Reporter: RuhongCai
> Attachments: ms12_TIM.pdf
>
>
> The following code could prove that there is a bug in getting the number of the pages
> PDDocument pdf1 = PDDocument.load("C:\\ms12_TIM.pdf");
> int count = pdf1.getNumberOfPages();
> count return “0” , the file has a page.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org