diff options
author | ale <ale@FreeBSD.org> | 2012-07-12 16:32:12 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2012-07-12 16:32:12 +0800 |
commit | 473122d0946f4ff06654a0798b566705dde76f45 (patch) | |
tree | da6b7976c43c16c9982196727718a3fcea282f82 /devel/itext | |
parent | 302039c3bcb2939b475b3d22a961c425cbb84907 (diff) | |
download | freebsd-ports-gnome-473122d0946f4ff06654a0798b566705dde76f45.tar.gz freebsd-ports-gnome-473122d0946f4ff06654a0798b566705dde76f45.tar.zst freebsd-ports-gnome-473122d0946f4ff06654a0798b566705dde76f45.zip |
Add a patch to process broken PDFs (Info dictionary shall be an indirect reference).
Diffstat (limited to 'devel/itext')
-rw-r--r-- | devel/itext/Makefile | 2 | ||||
-rw-r--r-- | devel/itext/files/patch-core_com_lowagie_text_pdf_PdfStamperImp.java | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/devel/itext/Makefile b/devel/itext/Makefile index 4c1336c17edd..5a6e3db81fe1 100644 --- a/devel/itext/Makefile +++ b/devel/itext/Makefile @@ -8,7 +8,7 @@ PORTNAME= itext PORTVERSION= 4.2.0 -PORTREVISION= 3 +PORTREVISION= 4 PORTEPOCH= 1 CATEGORIES= devel java MASTER_SITES= ${MASTER_SITE_LOCAL} diff --git a/devel/itext/files/patch-core_com_lowagie_text_pdf_PdfStamperImp.java b/devel/itext/files/patch-core_com_lowagie_text_pdf_PdfStamperImp.java new file mode 100644 index 000000000000..611d5122a57b --- /dev/null +++ b/devel/itext/files/patch-core_com_lowagie_text_pdf_PdfStamperImp.java @@ -0,0 +1,22 @@ +--- core/com/lowagie/text/pdf/PdfStamperImp.java.orig 2009-11-16 13:48:42.000000000 +0100 ++++ core/com/lowagie/text/pdf/PdfStamperImp.java 2012-07-12 10:27:01.000000000 +0200 +@@ -208,8 +208,17 @@ + } + // metadata + int skipInfo = -1; +- PRIndirectReference iInfo = (PRIndirectReference)reader.getTrailer().get(PdfName.INFO); +- PdfDictionary oldInfo = (PdfDictionary)PdfReader.getPdfObject(iInfo); ++ PRIndirectReference iInfo = null; ++ PdfDictionary oldInfo; ++ PdfObject dictInfo = reader.getTrailer().get(PdfName.INFO); ++ // Info dictionary in the trailer shall be an indirect reference, ++ // but a few broken softwares put it inline ++ if (dictInfo instanceof PdfDictionary) { ++ oldInfo = (PdfDictionary) dictInfo; ++ } else { ++ iInfo = (PRIndirectReference) dictInfo; ++ oldInfo = (PdfDictionary)PdfReader.getPdfObject(iInfo); ++ } + String producer = null; + if (iInfo != null) + skipInfo = iInfo.getNumber(); |