Thanks, Leonard, for pointing out the necessity of use of resources and other bells and whistles that surrounds appearance stream. But your reply has risen another question. Let's assume, that I've retrieved all data stored in the appearance stream : the stream of bytes, the form dictionary of the appearance stream and so forth. Now I have to set normal/rollover/down appearance to the arbitrary annotation. As I can see, this could be done via method PdfAnnotation's method setAppearance(), like in the code below :
PdfAnnotation annot = PdfAnnotation.create...(); ... PdfAppearance appN, appD, appR; ... // Normal appearance annot.annot.setAppearance(PdfName.N, appN); // Rollover appearance annot.setAppearance(PdfName.R, appR); // Down appearance annot.setAppearance(PdfName.D, appD); Main problem is how to fill variables appN, appD and appR by proper data. PdfAppearance could be instantiated via PdfContentByte's method createAppearance() method. In turn, instance of PdfContentByte could be obtained using PdfWriter's method getDirectContent(). But this is the point where I stopped. I cannot find any methods or workarounds how to put neither stream of bytes nor appearance stream dictionary... Obviously I'm lookong in the wrong place, but where is the proper one ? Could you help me ? Any hint will be appresiated, not saying about the solution in common... Thanks in advance. -----Original Message----- From: Leonard Rosenthol [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 07, 2006 8:10 PM To: [EMAIL PROTECTED]; itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Retrieving of the content of stream objects At 08:39 AM 2/7/2006, Alexander Golub wrote: >Now I have PdfStream object. How can I extract the very content of >stream from there ? That is, I can access all the fields of annotation >appearance object stream dictionary, but I cannot retrieve the stream >itself. I want to get the content of stream to store it in the >container object for future recreation of full-featured annotation from >this conainer. > Then you will need a LOT more than JUST the stream! You also need all the resources of that the stream uses - which may or may not be directly connected to the stream's Resource dict. Leonard --------------------------------------------------------------------------- Leonard Rosenthol <mailto:[EMAIL PROTECTED]> Chief Technical Officer <http://www.pdfsages.com> PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions