PdfDictionary oldInfo = reader.getTrailer().getAsDict(PdfName.INFO);
String producer = null;
if (oldInfo != null && oldInfo.get(PdfName.PRODUCER) != null) {
producer = oldInfo.getAsString(PdfName.PRODUCER).toUnicodeString();
}
Version version = Version.getInstance();
if (producer == null || version.getVersion().indexOf(version.getProduct()) == -1) {
producer = version.getVersion();
}
else {
int idx = producer.indexOf("; modified using");
StringBuffer buf;
if (idx == -1)
buf = new StringBuffer(producer);
else
buf = new StringBuffer(producer.substring(0, idx));
buf.append("; modified using ");
buf.append(version.getVersion());
producer = buf.toString();
}
PdfIndirectReference info = null;
PdfDictionary newInfo = new PdfDictionary();
if (oldInfo != null) {