I found the solution myself. Here it is in C# code

PRStream prs = (PRStream)PdfReader.GetPdfObject(formatScript.Get(PdfName.JS));  
                                      byte[] b = PdfReader.GetStreamBytes(prs);
string s = System.Text.ASCIIEncoding.ASCII.GetString(b);

Kind regards

Alex

Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Alex Bech Jensen
Sendt: 4. september 2008 12:09
Til: itext-questions@lists.sourceforge.net
Emne: [iText-questions] Get javascript from flateCompress format back to String

Hello!

Im trying to return a javascript from within a field. It is easy when the 
script is below 50 characters as it is then saved as a string, but when the 
javascript exceeds 50 characters it is saved as a special stream with 
pdfstream.flateCompress(). Is there any way to decompress this stream back to a 
known format for example a byte[] or even better a string?

Kind regards

Alex Jensen, System developer
Bording Data, Denmark
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to