[ 
https://issues.apache.org/jira/browse/PDFBOX-2026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13968321#comment-13968321
 ] 

shaun neal commented on PDFBOX-2026:
------------------------------------

On this particular document, I am adding some text and then adding the image.  
The text always works perfectly.  This is a great library by the way!

So on the image - on all variations for me - when opening the PDF in Acrobat X, 
I got one of three scenarios:

1 - Text displayed, and a message came up in Acrobat "message cannot be 
displayed"
2 - Text did not display and a message came up "out of memory"
3 - Text did not display and another message (which I didn't make note of) came 
up, different from the above two

I wasn't able to directly correlate the color pallet or image type to any 
particular sequence.  However, I never did get any image, color or grayscale, 
to display properly under 1.8.4.

I did limited testing under 1.8.5 and 2.0.0 after reading somewhere that a DCT 
color filter fix had been released, however I wasn't able to get my mainline 
code to work under either of those.

> cannot load jpg into new pdf
> ----------------------------
>
>                 Key: PDFBOX-2026
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2026
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.4
>         Environment: Java 1.7, eclipse, also tried 1.8.5 and 2.0.0
>            Reporter: shaun neal
>              Labels: JPG, pdjpeg, pdxobjectimage
>         Attachments: logo.jpg
>
>
> When trying to load jpg, tif or png get error below.  Document is created but 
> either gives "out of memory error" or "cannot display image" when document is 
> opened.
> Tried: jpg or jpeg
> multiple resolutions
> compression or no compression
> creating a fresh image in gimp
> grayscale or rgb
> downloading an image from google images
> reading data into byte array and using byteinput stream
> nothing will allow me to load an image into the doc - all same result as below
> Apr 13, 2014 1:50:02 PM 
> org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage getColorSpace
> INFO: About to return NULL from unhandled branch. filter = COSName{DCTDecode}
>                       doc = new PDDocument();         
>                       PDPage page = new PDPage();
>                       FileInputStream in = new FileInputStream ("logo.jpg");
> DEBUG OUTPUT APPEARS AFTER EXEC OF THIS LINE:                 
>                       PDXObjectImage  img = new PDJpeg (doc, in);             
>         
>                       PDPageContentStream cs = new PDPageContentStream(doc, 
> page);            
>                       cs.drawImage(img, 72.0f, 720.0f);



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

Reply via email to