pdf文件加密(iText)
2008-09-05 15:46
302 查看
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();
}
}
}
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();
}
}
}
相关文章推荐
- iText使用入门,打开加密的pdf文件(itext Bad user Password的解决方法)
- Itext生成PDF文件加密与加水印
- iText系列(三) Itext生成PDF文件加密与加水印
- JAVA代理破解口令加密的PDF文件(iText)
- iText简单加密pdf文件
- Itext生成PDF文件加密与加水印 ( 2008-07-17 11:35:33| 分类: java 技术)
- Itext生成PDF文件加密与加水印
- Freemarker+IText生成pdf文件
- 如何将已经加密的PDF文件进行第二次的更改
- 加密的pdf文件怎样打开
- java使用itext合并pdf文件
- pdfbox加密解密PDF文件
- php生成PDF格式文件并且加密
- itextpdf为pdf文件添加目录(可跳转)
- java中用itext写PDF文件并输出下载
- itext使用模板生成pdf文件
- IText --- PDF文件生成工具
- iText创建pdf文件里,解决ClassNotFoundException错误
- Java开源工具iText在PDF文件中创建表格
- android下用itext修改pdf模板文件