[ 
https://issues.apache.org/jira/browse/PDFBOX-911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nielsen updated PDFBOX-911:
---------------------------

    Attachment: Martijn Brinkers.jpg
                atest.pdf

Hello Adam,

Your right. The file has 4 pages (I forgot) but getNumberOfPages()
still returns 1. The file was used as is (no uncompressing before processing).
The user Martijn Brinkers obviously confirms
this behaviour (see image attached).


I used you test code slightly modified (removed assert and fail) to 
retest.
The input file was attached again with prefix a.

The code used:
        String inputpath = "C:\\Temp\\atest.pdf";
        PDDocument doc = null;
        try {
            doc = PDDocument.load(inputpath);
            int x = doc.getNumberOfPages();
            x = -1;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if(doc != null)
                try { doc.close(); } catch(Exception e) {}
        }
        

Thank you.

Regards
Michael


-------- Original-Nachricht --------


-- 
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl


> Method PDDocument.getNumberOfPages() returns wrong number of pages
> ------------------------------------------------------------------
>
>                 Key: PDFBOX-911
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-911
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Windows XP, Eclipse 3.5.2 Galileo
>            Reporter: nielsen
>         Attachments: atest.pdf, Martijn Brinkers.jpg, test.pdf
>
>
> Hello,
> I use PDFbox and are very pleased.
> For one PDF file however getNumberOfPages() returns the wrong number of pages 
> (1 instead of 2 pages).
> Test code:
>         File xx = new File("c:\\temp\\test.pdf");
>         PDDocument pdoc = PDDocument.load(xx);    
>         int x = pdoc.getNumberOfPages();
> The PDF file could be provided.
> Thanks in advance.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to