Hi Paulo,
great, that nearly works (changed the second PdfName() to PdfLiteral()). The
only thing that still seems to be problematic is that this is not a pdf
update block but part of a single catalog. Do you think any low level
functions of itext could be reused to implement something to generate
document update blocks?
Thank you very much,
Best regards,
Carsten



"Paulo Soares" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Here's some code to add an hanging stream:

import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;

public class oce_block {
    public static void main(String args[]) {
        try {
            PdfReader originalPDF = new PdfReader( "c:\\file.pdf" );
            FileOutputStream os = new FileOutputStream( "c:\\oce_block.pdf"
);
            PdfStamper stamper = new PdfStamper(originalPDF, os);
            PdfWriter writer = stamper.getWriter();
            byte b[] = "Something to put inside the stream.".getBytes();
            PdfStream stream = new PdfStream(b);
            stream.put(new PdfName("INFOBLOCK"), new PdfName("INTERN"));
            stream.flateCompress();
            writer.addToBody(stream);
            stamper.close();
        }
        catch ( Exception e ) {
            e.printStackTrace();
        }
    }
}






-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to