Fix Producer encoding.
Submitted by: Lapo Luchini <l.luchini@andxor.it>
This commit is contained in:
parent
ea7230ab24
commit
e71ce166ff
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=424682
5 changed files with 33 additions and 17 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= itext
|
||||
PORTVERSION= 4.2.0
|
||||
PORTREVISION= 4
|
||||
PORTREVISION= 5
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= devel java
|
||||
MASTER_SITES= LOCAL/ale
|
||||
|
@ -14,12 +14,12 @@ COMMENT= Java-PDF Library
|
|||
LICENSE= MPL LGPL20
|
||||
LICENSE_COMB= dual
|
||||
|
||||
BUILD_DEPENDS= ${JAVAJARDIR}/bcmail.jar:java/bouncycastle \
|
||||
${JAVAJARDIR}/dom4j.jar:textproc/dom4j \
|
||||
${JAVAJARDIR}/pdf-renderer.jar:print/pdf-renderer
|
||||
RUN_DEPENDS= ${JAVAJARDIR}/bcmail.jar:java/bouncycastle \
|
||||
${JAVAJARDIR}/dom4j.jar:textproc/dom4j \
|
||||
${JAVAJARDIR}/pdf-renderer.jar:print/pdf-renderer
|
||||
BUILD_DEPENDS= ${JAVALIBDIR}/bcmail.jar:java/bouncycastle \
|
||||
${JAVALIBDIR}/dom4j.jar:textproc/dom4j \
|
||||
${JAVALIBDIR}/pdf-renderer.jar:print/pdf-renderer
|
||||
RUN_DEPENDS= ${JAVALIBDIR}/bcmail.jar:java/bouncycastle \
|
||||
${JAVALIBDIR}/dom4j.jar:textproc/dom4j \
|
||||
${JAVALIBDIR}/pdf-renderer.jar:print/pdf-renderer
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
|
||||
|
@ -30,6 +30,7 @@ JAVA_VERSION= 1.6+
|
|||
USE_ANT= yes
|
||||
ALL_TARGET= jar jar.rtf jar.rups
|
||||
MAKE_ENV= ANT_INCLUDE_SHARED_JARS=YES
|
||||
NO_ARCH= yes
|
||||
|
||||
PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME}.jar \
|
||||
%%JAVAJARDIR%%/${PORTNAME}-rtf.jar \
|
||||
|
@ -45,16 +46,16 @@ ALL_TARGET+= javadoc
|
|||
.endif
|
||||
|
||||
do-install:
|
||||
@${INSTALL_DATA} ${WRKDIR}/lib/iText.jar \
|
||||
${INSTALL_DATA} ${WRKDIR}/lib/iText.jar \
|
||||
${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar
|
||||
@${INSTALL_DATA} ${WRKDIR}/lib/iText-rtf.jar \
|
||||
${INSTALL_DATA} ${WRKDIR}/lib/iText-rtf.jar \
|
||||
${STAGEDIR}${JAVAJARDIR}/${PORTNAME}-rtf.jar
|
||||
@${INSTALL_DATA} ${WRKDIR}/lib/iText-rups.jar \
|
||||
${INSTALL_DATA} ${WRKDIR}/lib/iText-rups.jar \
|
||||
${STAGEDIR}${JAVAJARDIR}/${PORTNAME}-rups.jar
|
||||
@${INSTALL_SCRIPT} ${FILESDIR}/${PORTNAME}-rups \
|
||||
${INSTALL_SCRIPT} ${FILESDIR}/${PORTNAME}-rups \
|
||||
${STAGEDIR}${PREFIX}/bin/
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
@${MKDIR} ${STAGEDIR}${DOCSDIR}/apidocs
|
||||
${MKDIR} ${STAGEDIR}${DOCSDIR}/apidocs
|
||||
(cd ${WRKDIR}/build/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/apidocs)
|
||||
.endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--- core/com/lowagie/text/pdf/PRTokeniser.java.orig 2016-06-20 15:02:42 UTC
|
||||
--- core/com/lowagie/text/pdf/PRTokeniser.java.orig 2016-10-26 08:23:27 UTC
|
||||
+++ core/com/lowagie/text/pdf/PRTokeniser.java
|
||||
@@ -281,6 +281,12 @@ public class PRTokeniser {
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--- core/com/lowagie/text/pdf/PdfReader.java.orig 2016-06-20 15:02:42 UTC
|
||||
--- core/com/lowagie/text/pdf/PdfReader.java.orig 2016-10-26 08:23:27 UTC
|
||||
+++ core/com/lowagie/text/pdf/PdfReader.java
|
||||
@@ -1464,7 +1464,7 @@ public class PdfReader implements PdfVie
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- core/com/lowagie/text/pdf/PdfStamperImp.java.orig 2016-06-20 15:02:42 UTC
|
||||
--- core/com/lowagie/text/pdf/PdfStamperImp.java.orig 2016-10-26 08:23:27 UTC
|
||||
+++ core/com/lowagie/text/pdf/PdfStamperImp.java
|
||||
@@ -208,8 +208,17 @@ class PdfStamperImp extends PdfWriter {
|
||||
@@ -208,13 +208,22 @@ class PdfStamperImp extends PdfWriter {
|
||||
}
|
||||
// metadata
|
||||
int skipInfo = -1;
|
||||
|
@ -20,3 +20,18 @@
|
|||
String producer = null;
|
||||
if (iInfo != null)
|
||||
skipInfo = iInfo.getNumber();
|
||||
if (oldInfo != null && oldInfo.get(PdfName.PRODUCER) != null)
|
||||
- producer = oldInfo.getAsString(PdfName.PRODUCER).toString();
|
||||
+ producer = oldInfo.getAsString(PdfName.PRODUCER).toUnicodeString();
|
||||
if (producer == null) {
|
||||
producer = Document.getVersion();
|
||||
}
|
||||
@@ -343,7 +352,7 @@ class PdfStamperImp extends PdfWriter {
|
||||
}
|
||||
}
|
||||
newInfo.put(PdfName.MODDATE, date);
|
||||
- newInfo.put(PdfName.PRODUCER, new PdfString(producer));
|
||||
+ newInfo.put(PdfName.PRODUCER, new PdfString(producer, PdfObject.TEXT_UNICODE));
|
||||
if (append) {
|
||||
if (iInfo == null)
|
||||
info = addToBody(newInfo, false).getIndirectReference();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--- core/com/lowagie/text/xml/xmp/XmpReader.java.orig 2016-06-20 15:02:42 UTC
|
||||
--- core/com/lowagie/text/xml/xmp/XmpReader.java.orig 2016-10-26 08:23:27 UTC
|
||||
+++ core/com/lowagie/text/xml/xmp/XmpReader.java
|
||||
@@ -103,8 +103,19 @@ public class XmpReader {
|
||||
public boolean replace(String namespaceURI, String localName, String value) {
|
||||
|
|
Loading…
Reference in a new issue