package com.tanling.act;
import java.io.FileOutputStream;
import com.lowagie.text.pdf.PdfEncryptor;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.pdf.PdfReader;
public class PdfEncrytor {
public PdfEncrytor(){
}
/**
* pdf文件加密
*
* @param filePath 文件路径
* @param outPath 输出路径
*/
public void PdfEncryptor(String filePath, String outPath){//@date 2008-8-22
System.out.println(filePath);
try {
PdfReader reader = new PdfReader("ChapterSection.pdf");
PdfEncryptor.encrypt(reader,
new FileOutputStream(outPath),
null,
null,
PdfWriter.ALLOW_PRINTING,
false);
}
catch(Exception e) {
e.printStackTrace();
}
}
}