itextpdf 上传下载


itextpdf 上传下载

                     

         

****************

相关类与接口

          

PdfTextExtractor:读取pdf文档内容

public final class PdfTextExtractor {
    private PdfTextExtractor() {
    }

    public static String getTextFromPage(PdfPage page, ITextExtractionStrategy strategy, Map<String, IContentOperator> additionalContentOperators) {
        PdfCanvasProcessor parser = new PdfCanvasProcessor(strategy, additionalContentOperators);
        parser.processPageContent(page);
        return strategy.getResultantText();
    }

    public static String getTextFromPage(PdfPage page, ITextExtractionStrategy strategy) {
        return getTextFromPage(page, strategy, new HashMap());
    }

    public static String getTextFromPage(PdfPage page) {
        return getTextFromPage(page, new LocationTextExtractionStrategy());
    }
}

          

PdfReader:PdfDocument构造参数,通过PdfDocument执行很多pdf操作

public class PdfReader implements Closeable {
    public static final PdfReader.StrictnessLevel DEFAULT_STRICTNESS_LEVEL;
    private static final String endstream1 = "endstream";
    private static final String endstream2 = "\nendstream";
    private static final String endstream3 = "\r\nendstream";
    private static final String endstream4 = "\rendstream";
    private static final byte[] endstream;
    private static final byte[] endobj;
    protected static boolean correctStreamLength;
    private boolean unethicalReading;
    private boolean memorySavingMode;
    private PdfReader.StrictnessLevel strictnessLevel;
    private PdfIndirectReference currentIndirectReference;
    protected PdfTokenizer tokens;
    protected PdfEncryption decrypt;
    protected PdfVersion headerPdfVersion;
    protected long lastXref;
    protected long eofPos;
    protected PdfDictionary trailer;
    protected PdfDocument pdfDocument;
    protected PdfAConformanceLevel pdfAConformanceLevel;
    protected ReaderProperties properties;
    protected boolean encrypted;
    protected boolean rebuiltXref;
    protected boolean hybridXref;
    protected boolean fixedXref;
    protected boolean xrefStm;


********
构造方法

    public PdfReader(IRandomAccessSource byteSource, ReaderProperties properties) throws IOException {
    public PdfReader(InputStream is, ReaderProperties properties) throws IOException {
    public PdfReader(File file) throws FileNotFoundException, IOException {
    public PdfReader(InputStream is) throws IOException {

    public PdfReader(String filename, ReaderProperties properties) throws IOException {
    public PdfReader(String filename) throws IOException {

    PdfReader(IRandomAccessSource byteSource, ReaderProperties properties, boolean closeStream) throws IOException {


********
普通方法

    public voi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值