Details
-
Improvement
-
Status: Closed
-
Resolution: Fixed
-
None
-
None
-
None
Description
[imported from SourceForge]
http://sourceforge.net/tracker/index.php?group_id=78314&atid=552834&aid=1773675
Originally submitted by nobody on 2007-08-14 00:42.
currently the pdf to image conversion does only work partially. there are a few problems i would like to address with the patch:
- draw ALL jpeg image which are inlined in the pdf doc.
some of the jpeg image have some kind of ".Adobe"
header instead of the "JFIF" header. ImageIO is unable
to read the jpegs starting with the ".adobe" header. - catch a few nullpointer exceptions so that the draw
"flow" is not interrupted - currently the PDType0Font class draws nothing at all,
resp. throws which breaks as well the draw "flow".
because i did not know how the type0 font should be
drawn i simply extended from type1 (which is not cool)
so that at least text is drawn.
a lot more pdfs are drawn as images with this changes in a more or less good quality.
you will find all "touched" files in the attached zip file.
btw: i did the relying on the "PDFBox-0.7.4-dev-20070716" dev load.
for any questions send my an email to: philipp.koch@day.com
[attachment on SourceForge]
http://sourceforge.net/tracker/download.php?group_id=78314&atid=552834&aid=1773675&file_id=241160
pdfbox-patch.zip (application/x-zip-compressed), 13219 bytes
patch
[comment on SourceForge]
Originally sent by danielwilson.
Logged In: YES
user_id=1737686
Originator: NO
This seems to work well – given one more change that Philipp emailed me.
You need to add this overload of write2file to org\pdfbox\pdmodel\graphics\xobject\PDXObjectImage.java
/**
- Writes the image to a file with the filename + an appropriate suffix, like "Image.jpg".
- The suffix is automatically set by the
- @param file the file
- @throws IOException When somethings wrong with the corresponding file.
*/
public void write2file(File file) throws IOException
{
FileOutputStream out = null;
try { out = new FileOutputStream(file); write2OutputStream(out); out.flush(); }finally
Unknown macro: { if( out != null ) { out.close(); } }}