If the objective is to encrypt the whole document it can be done with the
class PdfEncryptor and all the links and fields are kept. Example usage:

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

public class encrypt_pdf {

    public static void main (String args[]) {
        System.out.println("PDF document encryptor");
        if (args.length < 2) {
            System.out.println("usage: input_file output_file");
            return;
        }
        try {
            System.out.println("Reading " + args[0]);
            PdfReader reader = new PdfReader(args[0]);
            System.out.println("Writing " + args[1]);
            PdfEncryptor.encrypt(reader, new FileOutputStream(args[1]),
null, null, 0, false);
            System.out.println("Done.");
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Bruno [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 7:42
> To:   [EMAIL PROTECTED]
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: [iText-questions] Encryption -> links gone
> 
> Quoting Ralf Terdic <[EMAIL PROTECTED]>:
> 
> > Hi,
> > 
> > I'm trying to encrypt a file generated by pdflib which contains some
> links.
> > The encryption works well with the Encrypt.java example, but then the
> links
> > are gone. How can I avoid this?
> 
> You can't: for the moment this is not supported.
> Leonard Rosenthol is working on an iText version that will support this.
> 
> Bruno
> 
> 
> -------------------------------------------------------
> 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


-------------------------------------------------------
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