[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987661#comment-13987661
 ] 

Tilman Hausherr commented on PDFBOX-2055:
-

I can't reproduce this with 1.8.5, so maybe it has been fixed in that version. 
However you won't like the output. The output is fine with the unreleased 2.0 
version, get it here (where you can also find the 1.8.5 and 1.8.6 versions):
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/



 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Hong-Thai Nguyen (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987671#comment-13987671
 ] 

Hong-Thai Nguyen commented on PDFBOX-2055:
--

Thank your feedback. For some reasons, we can use snapshot versions.
I didn't follow recently feeds, but why we must in concurrently 1.8.5  1.8.6 
version ? Do you have any idea when these version will be released ?

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987741#comment-13987741
 ] 

Tilman Hausherr commented on PDFBOX-2055:
-

I assume you meant to write can't. The 1.8.5 version will be released very 
soon. Very soon as in within a few hours or days. The cut has already been 
done. I mentioned both versions just in case you want to test them.

Btw I just tested with 1.8.4 and it works fine?! (I used the PDFReader command 
line application)

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Hong-Thai Nguyen (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987751#comment-13987751
 ] 

Hong-Thai Nguyen commented on PDFBOX-2055:
--

Thank [~tilman], as you guessed, I mean effectively 'can't' ;)
For the test, I'm  generating first page to an Image via API:
{code}
@VisibleForTesting
  ImageResult generateImage(File localFile, int width, int height) throws 
Exception {
BufferedImage image;
PDDocument document = PDDocument.load(localFile);
try {
  image = computeImage(document);
} finally {
  document.close();
  document = null;
}

byte[] bytes = ImageResizer.resize(image, width, height);
if (bytes != null  image != null) {
  return new ImageResult(bytes, image/png, image.getWidth(), 
image.getHeight());
} else {
  return null;
}
  }

  private BufferedImage computeImage(PDDocument document) throws IOException {
PDPage page = (PDPage) document.getDocumentCatalog().getAllPages().get(0);
try {
  BufferedImage image = page.convertToImage(BufferedImage.TYPE_INT_RGB, 
resolution);
  return image;
} finally {
  page = null;
}
  }
{code}

I confirm that this exception is real on 1.8.4

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987772#comment-13987772
 ] 

Tilman Hausherr commented on PDFBOX-2055:
-

I can confirm that it is happening on 1.8.6 :-( No idea yet why it didn't 
happen with the pdfbox command line app.

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Tilman Hausherr (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987807#comment-13987807
 ] 

Tilman Hausherr commented on PDFBOX-2055:
-

Use loadNonSeq(localFile, null) instead of load(localFile).

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4, 1.8.5, 1.8.6, 2.0.0
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (PDFBOX-2055) IOException when converting PDF to image

2014-05-02 Thread Hong-Thai Nguyen (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987818#comment-13987818
 ] 

Hong-Thai Nguyen commented on PDFBOX-2055:
--

Great. I heard alot about noSeq with many improvement. First  time, we got a 
PDF which can not be handled by traditional loader method, but success with 
noSeq :). Can close issue.

Thanks

 IOException when converting PDF to image
 

 Key: PDFBOX-2055
 URL: https://issues.apache.org/jira/browse/PDFBOX-2055
 Project: PDFBox
  Issue Type: Bug
Affects Versions: 1.8.4, 1.8.5, 1.8.6, 2.0.0
Reporter: Hong-Thai Nguyen
Priority: Critical
 Attachments: eu_competition_newsletter_04_june_-_10_june_2010.pdf


 With attach PDF file, we got IO Exception when using PDPage.convertToImage():
 {code}
 java.io.IOException
   at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:138)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:336)
   at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:248)
   at 
 org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:183)
   at 
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:107)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
   at 
 org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
   at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127)
   at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
   at 
 com.polyspot.connector.imageservice.generators.PDFBoxImageGenerator.computeImage(PDFBoxImageGenerator.java:75)
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)