0
在嘗試包括利用iText我得到一個錯誤的一些JPEG文件轉換成PDF:讀取JPG過早EOF同時讀取JPG利用iText
圖像是從Android手機上加載和最可 過早的EOF嵌入到PDF文件中,但有些不能。
PushbuttonField ad = pdfForm.getNewPushbuttonFromField(fieldName);
if(ad != null) {
ad.setLayout(PushbuttonField.LAYOUT_ICON_ONLY);
ad.setProportionalIcon(true);
try {
ad.setImage(Image.getInstance(basePath + "/" + r.value));
} catch (Exception e) {
log.log(Level.SEVERE, "Image error detail", e);
}
pdfForm.replacePushbuttonField(fieldName, ad.getField());
}
錯誤發生在setImage期間:com.itextpdf.text.Jpeg.processParameters(Jpeg.java:219) iText的版本是:5.5.5
我已經把使所述圖像錯誤到公共保管箱文件夾中:https://dl.dropboxusercontent.com/u/46349359/image.jpg 圖像爲1.6 MB,在html中顯示沒有問題或使用其他圖像顯示工具。
但是圖像存在於指定位置? – EJP
是的,它存在。 – nap
繼續我以前的評論,我跑了一些測試,我重命名文件,所以它不會被發現。報告的錯誤是java.io.FileNotFoundException。 – nap