You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Andreas Lehmkuehler <an...@lehmi.de> on 2013/06/15 13:56:52 UTC

Re: Can you help me ?

Hi,

Am 25.05.2013 09:38, schrieb Franco Fellicò:
> I am using PdfBox with the following code:
>
>      . . . .
>      . . . .
>      createImage(fil, outfile, npag);
>      try {
>        jPanel2.removeAll();
>        File ff = new File(outfile + ".jpg");
>        myimage = ImageIO.read(ff);
>      } catch (Exception e) {
>        System.out.println(e.getMessage());
>      }
>      mypic = new ImagePanel(myimage);
>      jPanel2.add(mypic);
>      . . . .
>      . . . .
>
>
>    private void createImage(String fil, String out, int npag) {
>      PDDocument pdf;
>      try {
>        pdf = PDDocument.load(fil);
>        PDFImageWriter mywri = new PDFImageWriter();
>        mywri.writeImage(pdf, "jpg", null, npag, npag, out,
> BufferedImage.TYPE_3BYTE_BGR, 254);
>        pdf.close();
>      } catch (IOException ex) {
>        System.out.println(ex.getMessage());
>      }
>    }
>
> then if the program run on my iMac or on a windows 7 OS the IMAGE is OK as you
> can see
> in the correct.png I attached here.
Your attachments didn't make it due to some restrictions. Please upload them
somewhere (sharehoster, website ...) so that we can download them.

> if I use it on my macBook pro the IMAGE is incorrect (look at the incorrect.png
> file).
>
> Both the mac computers have OSX mountains and the pdfbox library are the same.
>
> Where is the problem?
Without the pdf in question it's hard to say, but let me guess. You're using
different versions of the jdk (1.6 vs. 1.7) in your environments, aren't you?

> Thank you from Franco Fellico in Italy

BR
Andreas Lehmkühler