Hello Bruno!
I got great help from you and Paulo in creating pdf:
Thanks for all your valuable time.
I am trying to create a compressed pdf using
FlateDecode .. paulo gave me some useful tips and
finally I am stuck with just one issue .. paulo told
me see PdfStream class in iText and learned how you
guys do the compression using DeflateOutputStream..
I am trying to compress a stream
I have the contents of the stream in a string and
passing it produce2
from there I call produce2 which can take a byte array
where I compressed the data and calculated the length
do you find anything wrong with the calculation of
length? kindly let me know
private long produce2(String s)
{
try
{ return produce2(s.getBytes("8859_1"));
}
catch(UnsupportedEncodingException e)
{
return produce("Error Occured".getBytes());
}
}
private long produce2(byte [] b) {
try
{
ByteArrayOutputStream streamBytes = new
ByteArrayOutputStream();
streamBytes.write(b);
ByteArrayOutputStream stream = new
ByteArrayOutputStream();
System.out.println("here for
compression");
DeflaterOutputStream zip = new
DeflaterOutputStream(stream);
if (streamBytes != null)
streamBytes.writeTo(zip);
zip.close();
// update the object
streamBytes = stream;
streamBytes.writeTo(out);
return fileOffset += streamBytes.size();
when i do this.. adobe is able to see only BT and a
character from the stream and the remaining data in
the sream is not seen by acrobat ==> a pdf expert gave
me this info after seeing my pdf out put file , thanks
to aandi! Unfortunately he knows only C and I know
only java.. that too I am not a expert in java.. so he
suggested to post this question to Bruno/Paluo & Co
is any one know if i make anything wrong with
calculation of length of the stream after the
compression
Your help is highly appreciated!
Anis
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Caffeinated soap. No kidding.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions