paulo,
thanks for the reply.
i'm not sure if this is the best solution to the PdfSmartCopy pantone
problem, but it does seem to help.
ideas on when this or some other fix will be available? not using
smart-copy isn't a great option, since the number of duplicated fonts makes
the resultant file unmanageably large.
thanks much!
-bo
diff -Naur com-original/lowagie/text/pdf/PdfSmartCopy.java
com/lowagie/text/pdf/PdfSmartCopy.java
--- com-original/lowagie/text/pdf/PdfSmartCopy.java 2007-09-09 01:12:
58.000000000 -0700
+++ com/lowagie/text/pdf/PdfSmartCopy.java 2008-01-08 14:09:59.000000000-0800
@@ -133,15 +133,28 @@
private int hash;
ByteStore(PRStream str) throws IOException {
+ ByteBuffer bb = new ByteBuffer();
+ getContents(str, bb);
+ this.b = bb.toByteArray();
+ }
+
+ private void getContents(PRStream str, ByteBuffer bb) throws
IOException {
byte[] streamContent = PdfReader.getStreamBytesRaw(str);
Object[] keys = str.getKeys().toArray();
Arrays.sort(keys);
- ByteBuffer bb = new ByteBuffer();
for (int k = 0; k < keys.length; ++k) {
bb.append(keys[k].toString());
+ PdfObject o = str.get((PdfName)keys[k]);
+ if(o != null) {
+ if(o.isStream() && !((PRStream)o).contains(PdfName.BBOX))
{
+ getContents((PRStream)o, bb);
+ } else {
+ bb.append(o.toString());
+ }
+ }
}
+
bb.append(streamContent);
- this.b = bb.toByteArray();
}
public boolean equals(Object obj) {
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/