Hi,
Am 15.02.2013 14:34, schrieb Glen Peterson:
I ran into this same exception last weekend. You may be getting this
for a slightly different reason than I was, but I will relate my
experience in case it helps you. It really stumped me for a while.
My problem was that I could build only one PDF file with JPEGs in it.
If I tried to build a second document, I would have to recycle my JVM,
or I'd get the exception you report. It turned out that I was caching
PDJpeg's and I forgot to invalidate my cache between PDDocument's.
The PDF files I was making used certain images many times and caching
them brought the document size from 13MB down to 1MB, so I didn't want
to give up caching. My problem was that I passed drawXObject() a
PDJpeg that was associated with a different document. Of course, this
would never work, but the exception that gets thrown didn't make any
sense to me. Anyway I hope that helps.
I fixed the origin issue in the current trunk. It occured because of
an inconsistent usage of generics which led to the described ClassCastException.
I'm new to this list. Hi. My name is Glen Peterson and PDFBox is
working great for me - reliably building 300+ page PDFs in about 3
seconds on a single-processor 3GHz machine (the database queries take
probably half of that time). I have written a few wrapper-classes for
PDFBox that do line breaking, page breaking, tables, and
transliterations of some Unicode characters to the default PDF
character set.
The transliterations should be a trivial patch to existing PDFBox
code. They make PDFBox support "smart quotes," "em-dashes," and the
Euro Symbol pasted from office, plus a few dozen languages encoded
with Unicode (as Java does internally). I also mapped Cyrillic
letters to their closest Romanizations according to ISO 9:1995, so it
should be fairly complete.
I have permission from my employer to contribute these extensions to
PDFBox under the Apache License, copyright myself and my employer.
Maybe someone can let me know how to proceed?
Sounds really interesting, please create an issue on JIRA an give us
some more information. Maybe it'll be a good idea to split this up
into 2 parts, one for the wrappers and one for the transliterations.
The code should be provided as patch (diff, based on the current trunk).
SNIP
--
Glen K. Peterson
(828) 393-0081
BR
Andreas Lehmkühler