You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Olivier DOREMIEUX <ol...@doremieux.org> on 2011/02/02 21:01:10 UTC

Is it just me?

With the latest code from SVN, I am getting an Uncompilable source code 
exception when doing page.getMediaBox().
Here is a small example. I tryed with different pdf, same problem. I can 
create pdf, do other stuff, but not getMediaBox().

try {
             PDDocument doc = PDDocument.load(new File(startDir, 
"mypdf.pdf"));
             List allPages = doc.getDocumentCatalog().getAllPages();
             for (int i = 0; i < allPages.size(); i++) {
                 System.out.println("Page " + i);
                 PDPage page = (PDPage) allPages.get(i);
                 PDRectangle pageSize = page.getMediaBox();
             }
         } catch (IOException ex) {
             Logger.getLogger(Test1.class.getName()).log(Level.SEVERE, 
null, ex);
         }

Am I the only one to have this problem?

Thanks,

Olivier

Re: Is it just me?

Posted by Olivier DOREMIEUX <ol...@doremieux.org>.
Hi,

I did switch back to 1.4 for the moment. Once I'll work again with 1.5, 
I'll let you know.

Thanks,

Olivier
Le 03/02/11 19:42, Andreas Lehmkuehler a écrit :
> Hi,
>
> Am 03.02.2011 08:25, schrieb Olivier DOREMIEUX:
>> HI,
>>
>> It's a Runtime error.
>> Actually compiling the code, on the command line doing "mvn -e 
>> install", shows
>> the same kind of exception when it tries to do the test.
>> The exception is at the same place, when it tries to do a getMediaBox.
> Hmmm, did you try to clean your build first like "mvn clean install"
>
>> I don't know if it's helps but, I am on Mac OSX 10.6.
> Shouldn't matter
>
>> Let me know if you need anything else from me.
> Please post the stack trace of the exception.
>
> BR
> Andreas Lehmkühler


Re: Is it just me?

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 03.02.2011 08:25, schrieb Olivier DOREMIEUX:
> HI,
>
> It's a Runtime error.
> Actually compiling the code, on the command line doing "mvn -e install", shows
> the same kind of exception when it tries to do the test.
> The exception is at the same place, when it tries to do a getMediaBox.
Hmmm, did you try to clean your build first like "mvn clean install"

> I don't know if it's helps but, I am on Mac OSX 10.6.
Shouldn't matter

> Let me know if you need anything else from me.
Please post the stack trace of the exception.

BR
Andreas Lehmkühler

Re: Is it just me?

Posted by Olivier DOREMIEUX <ol...@doremieux.org>.
HI,

It's a Runtime error.
Actually compiling the code, on the command line doing "mvn -e install", 
shows the same kind of exception when it tries to do the test.
The exception is at the same place, when it tries to do a getMediaBox.

I don't know if it's helps but, I am on Mac OSX 10.6.

Let me know if you need anything else from me.

Thanks,

Olivier


Le 03/02/11 08:15, Andreas Lehmkuehler a écrit :
> Hi,
>
> Am 02.02.2011 21:01, schrieb Olivier DOREMIEUX:
>> With the latest code from SVN, I am getting an Uncompilable source code
>> exception when doing page.getMediaBox().
>> Here is a small example. I tryed with different pdf, same problem. I 
>> can create
>> pdf, do other stuff, but not getMediaBox().
>>
>> try {
>> PDDocument doc = PDDocument.load(new File(startDir, "mypdf.pdf"));
>> List allPages = doc.getDocumentCatalog().getAllPages();
>> for (int i = 0; i < allPages.size(); i++) {
>> System.out.println("Page " + i);
>> PDPage page = (PDPage) allPages.get(i);
>> PDRectangle pageSize = page.getMediaBox();
>> }
>> } catch (IOException ex) {
>> Logger.getLogger(Test1.class.getName()).log(Level.SEVERE, null, ex);
>> }
>>
>> Am I the only one to have this problem?
> Sorry, but I didn't get the point. What exactly is your problem? Do 
> you get a compile or a runtime error?
>
> BR
> Andreas Lehmkühler
>


Re: Is it just me?

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 02.02.2011 21:01, schrieb Olivier DOREMIEUX:
> With the latest code from SVN, I am getting an Uncompilable source code
> exception when doing page.getMediaBox().
> Here is a small example. I tryed with different pdf, same problem. I can create
> pdf, do other stuff, but not getMediaBox().
>
> try {
> PDDocument doc = PDDocument.load(new File(startDir, "mypdf.pdf"));
> List allPages = doc.getDocumentCatalog().getAllPages();
> for (int i = 0; i < allPages.size(); i++) {
> System.out.println("Page " + i);
> PDPage page = (PDPage) allPages.get(i);
> PDRectangle pageSize = page.getMediaBox();
> }
> } catch (IOException ex) {
> Logger.getLogger(Test1.class.getName()).log(Level.SEVERE, null, ex);
> }
>
> Am I the only one to have this problem?
Sorry, but I didn't get the point. What exactly is your problem? Do you get a 
compile or a runtime error?

BR
Andreas Lehmkühler