Skip to main content

PDFRenderer unknown pattern type 2?

5 replies [Last post]
sialivi
Offline
Joined: 2005-08-13

I'm just trying out the PDFRenderer for the first time and even though it works I'm getting some exceptions I would appreciate if someone could explain:

The first one is:

com.sun.pdfview.PDFParseException: Unknown pattern type 2
at com.sun.pdfview.pattern.PDFPattern.getPattern(PDFPattern.java:85)
at com.sun.pdfview.colorspace.PatternSpace.getPaint(PatternSpace.java:103)
at com.sun.pdfview.PDFParser.doPattern(PDFParser.java:999)
at com.sun.pdfview.PDFParser.iterate(PDFParser.java:660)
at com.sun.pdfview.BaseWatchable.run(BaseWatchable.java:103)

I'm getting this exception on pages containing bitmap images, images which are not showing up. Is this some unimplemented feature?

The second one is far more frequent and happens several times on each page:

sun.awt.image.ImageFormatException: Unsupported color conversion request
at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:119)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joshua Marinacci

Could you provide a sample PDF which triggers this behavior?

Thanks,
Josh
On Jun 16, 2008, at 2:24 PM, jdnc-interest@javadesktop.org wrote:

> I'm just trying out the PDFRenderer for the first time and even
> though it works I'm getting some exceptions I would appreciate if
> someone could explain:
>
> The first one is:
>
> com.sun.pdfview.PDFParseException: Unknown pattern type 2
> at
> com.sun.pdfview.pattern.PDFPattern.getPattern(PDFPattern.java:85)
> at
> com.sun.pdfview.colorspace.PatternSpace.getPaint(PatternSpace.java:
> 103)
> at com.sun.pdfview.PDFParser.doPattern(PDFParser.java:999)
> at com.sun.pdfview.PDFParser.iterate(PDFParser.java:660)
> at com.sun.pdfview.BaseWatchable.run(BaseWatchable.java:103)
>
> I'm getting this exception on pages containing bitmap images, images
> which are not showing up. Is this some unimplemented feature?
>
> The second one is far more frequent and happens several times on
> each page:
>
> sun.awt.image.ImageFormatException: Unsupported color conversion
> request
> at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
> at
> sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:119)
> at
> sun
> .awt
> .image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
> at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
> at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
> [Message sent by forum member 'sialivi' (sialivi)]
>
> http://forums.java.net/jive/thread.jspa?messageID=280551
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

sialivi
Offline
Joined: 2005-08-13

Hi Josh,

I could but there are two problems though, the pdf's in question are all over 70mb each (size is no issue for me though, but it might be for wherever I'm suppused to send it) and secondly it's a commercial pdf so someone might object to that

I did try to split the pdf to just get a single page from it, but then the pdfrenderer wouldn't accept the file, so I guess the splitting tool has some issues.

Any suggestions? The files are available at a very well known swedish website which a certain four letter organization is working hard on shutting down, but I'm not sure I should post the link in the forum.

bitkidoku
Offline
Joined: 2008-02-28

I am having the same problem here.
Try http://files.avast.com/files/eng/bart.pdf

Joshua Marinacci

I've created a bug here:
https://pdf-renderer.dev.java.net/issues/show_bug.cgi?id=54

I may have a solution. I'll look into it tomorrow.

On Dec 30, 2008, at 3:45 AM, jdnc-interest@javadesktop.org wrote:

> I am having the same problem here.
> Try http://files.avast.com/files/eng/bart.pdf
> [Message sent by forum member 'bitkidoku' (bitkidoku)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323604
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

bastian1
Offline
Joined: 2011-01-06

We've got exactly the same problem.

If I want to open pdf's with vector based graphics (Scalable Vector Graphics) in it, we've got the PDFParseException

(Unknown pattern type 2). So, I think the DCT transformation is not the only reason for this problem.

I'm using Java 6 on a windows machine, so in my opinion this is not only a Java 5 / MAC Problem!

The created bug #54 was opened in 2008. But until now there is no solution or workaround for this problem.

Is there any workaround or fix in sight, because at the moment we're evaluating pdf libraries and this point

is very important for us.

best regards,

bastian