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.

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?

Thank you from Franco Fellico in Italy

Reply via email to