You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by umk <cp...@biosignia.com> on 2009/09/22 23:03:17 UTC

PDF output includes blank/empty image

Can someone help me understand why the attached FO sample (PNG.fo) generates
a PDF with multiple images. You don't see the images when opening the PDF
with Adobe Reader but if you open it with a text editor, you will find two
"/Image" sections (they also have the same dimensions).

The reason this is a problem is that we run automated tests on our PDFs to
ensure that the correct number of images are found. So, in our case, the
test finds 2 images when reading the PDF instead of 1.

Can anyone shed light on why this is happening? 

Running FOP v0.95 and JDK 1.6

Thank you!

http://www.nabble.com/file/p25530904/PNG.fo PNG.fo 
http://www.nabble.com/file/p25530904/sample.png sample.png 
http://www.nabble.com/file/p25530904/png.pdf png.pdf 

-- 
View this message in context: http://www.nabble.com/PDF-output-includes-blank-empty-image-tp25530904p25530904.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: PDF output includes blank/empty image

Posted by umk <cp...@biosignia.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> 
> The files are no longer accessible under the URLs you posted. But I
> assume what you have here is a transparent image in which case two
> /Image objects are produced: one for the image data and one for the soft
> mask (alpha channel). If one of the image object has a "SMask" entry,
> it's that case and that Image object would be the main one.
> 

Jeremias, thanks for the suggestion - it makes sense. I will look into 
transparency.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: PDF output includes blank/empty image

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The files are no longer accessible under the URLs you posted. But I
assume what you have here is a transparent image in which case two
/Image objects are produced: one for the image data and one for the soft
mask (alpha channel). If one of the image object has a "SMask" entry,
it's that case and that Image object would be the main one.

On 22.09.2009 23:03:17 umk wrote:
> 
> Can someone help me understand why the attached FO sample (PNG.fo) generates
> a PDF with multiple images. You don't see the images when opening the PDF
> with Adobe Reader but if you open it with a text editor, you will find two
> "/Image" sections (they also have the same dimensions).
> 
> The reason this is a problem is that we run automated tests on our PDFs to
> ensure that the correct number of images are found. So, in our case, the
> test finds 2 images when reading the PDF instead of 1.
> 
> Can anyone shed light on why this is happening? 
> 
> Running FOP v0.95 and JDK 1.6
> 
> Thank you!
> 
> http://www.nabble.com/file/p25530904/PNG.fo PNG.fo 
> http://www.nabble.com/file/p25530904/sample.png sample.png 
> http://www.nabble.com/file/p25530904/png.pdf png.pdf 
> 
> -- 
> View this message in context: http://www.nabble.com/PDF-output-includes-blank-empty-image-tp25530904p25530904.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: PDF output includes blank/empty image

Posted by umk <cp...@biosignia.com>.
Venkat Reddy <vanukuri.venkat <at> googlemail.com> writes:
> 
> Hi,
> 
> When I extracted content from the PDF file that you attached in this 
> mail. I have got only one image file from that, which is what expected 
> right?
> I have used Nitro PDF tool to extract text and images from a PDF file. I 
> have got only one image when I extracted from png.pdf file.
> 
> Cheers,
> Venkat.
> umk wrote:
> > Can someone help me understand why the attached FO sample (PNG.fo) generates
> > a PDF with multiple images. You don't see the images when opening the PDF
> > with Adobe Reader but if you open it with a text editor, you will find two
> > "/Image" sections (they also have the same dimensions).
> >
> > The reason this is a problem is that we run automated tests on our PDFs to
> > ensure that the correct number of images are found. So, in our case, the
> > test finds 2 images when reading the PDF instead of 1.
> >
> > Can anyone shed light on why this is happening? 
> >
> > Running FOP v0.95 and JDK 1.6
> >
> > Thank you!
> >
> > http://www.nabble.com/file/p25530904/PNG.fo PNG.fo 
> > http://www.nabble.com/file/p25530904/sample.png sample.png 
> > http://www.nabble.com/file/p25530904/png.pdf png.pdf 
> >
> >   
> 


Venkat, thanks for replying. I have used two tools to extract images from the 
PDF file (PDFBox & iText) and they both find an extra image. 

Please open the PDF with a text editor and notice that there are in fact two 
"/Image" sections. The one has much more data (the valid one) that the other. If 
I remove the fo:external-graphic element from the .fo file, both "/Image" 
sections are removed. And get this: if I reference a different png file, I get 
only ONE "/Image" section in the PDF. Something about the dynamically generated 
png results in two "/Image" sections in the PDF.

Ideas?



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: PDF output includes blank/empty image

Posted by Venkat Reddy <va...@googlemail.com>.
Hi,

When I extracted content from the PDF file that you attached in this 
mail. I have got only one image file from that, which is what expected 
right?
I have used Nitro PDF tool to extract text and images from a PDF file. I 
have got only one image when I extracted from png.pdf file.

Cheers,
Venkat.
umk wrote:
> Can someone help me understand why the attached FO sample (PNG.fo) generates
> a PDF with multiple images. You don't see the images when opening the PDF
> with Adobe Reader but if you open it with a text editor, you will find two
> "/Image" sections (they also have the same dimensions).
>
> The reason this is a problem is that we run automated tests on our PDFs to
> ensure that the correct number of images are found. So, in our case, the
> test finds 2 images when reading the PDF instead of 1.
>
> Can anyone shed light on why this is happening? 
>
> Running FOP v0.95 and JDK 1.6
>
> Thank you!
>
> http://www.nabble.com/file/p25530904/PNG.fo PNG.fo 
> http://www.nabble.com/file/p25530904/sample.png sample.png 
> http://www.nabble.com/file/p25530904/png.pdf png.pdf 
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org