Dear all,
I have a suggestion for PDFCopy.java.
Give it an extra constructor:
public PdfCopy(OutputStream os) throws DocumentException {
super(new PdfDocument(), os);
}
This way you can subclass it and manipulate your copied documents, for
example:
/**
* Constructor
*
* @param document
* @param os outputstream
* @exception DocumentException
*/
public PdfCopyWithNewBoxes( Document document, OutputStream os )
throws DocumentException {
super( os );
document.addDocListener( pdf );
pdf.addWriter( this );
indirectMap = new HashMap();
}
/**
* Add an imported page to our output
*
* @param iPage an imported page
* @param annotationsToDictionary a dictionary to be added to the
copied dictionary
* @throws IOException, BadPdfFormatException
*/
public void addPage( PdfImportedPage iPage, PdfDictionary
annotationsToDictionary )
throws IOException, BadPdfFormatException {
this.annotationsToDictionary = annotationsToDictionary;
super.addPage( iPage );
}
/**
* Call super and add the annotationsToDictionary if it is not null
*
* @param in
* @return not yet described
*/
protected PdfDictionary copyDictionary( PdfDictionary in )
throws IOException, BadPdfFormatException {
PdfDictionary out = super.copyDictionary( in );
if ( this.annotationsToDictionary != null) {
out.putAll( this.annotationsToDictionary );
}
return out;
}
Keep up the great work!
Eduard Drenth
begin:vcard
fn:Eduard Drenth
n:Drenth;Eduard
org:Alfabase;System Development
adr:;;;Alphen aan den Rijn;;;Nederland
email;internet:[EMAIL PROTECTED]
title:ir
tel;work:+31 172 466141
tel;cell:+31 06 20943428
x-mozilla-html:FALSE
url:http://www.alfabase.nl
version:2.1
end:vcard