List of usage examples for com.itextpdf.text Document plainRandomAccess
boolean plainRandomAccess
To view the source code for com.itextpdf.text Document plainRandomAccess.
Click Source Link
From source file:com.github.albfernandez.joinpdf.JoinPdf.java
License:Open Source License
private static RandomAccessSource createRamdomAccessSource(final File file) throws IOException { RandomAccessSource source = new RandomAccessSourceFactory().setForceRead(false) .setUsePlainRandomAccess(Document.plainRandomAccess).createBestSource(file.getAbsolutePath()); return source; }
From source file:org.h819.commons.file.MyPDFUtils.java
/** * PdfReader ? pdf pdf ???/*from w ww .j a v a2 s . c om*/ * * @param pdfFile ? pdf * @return PdfReader * @throws IOException */ public static PdfReader getPdfReader(File pdfFile) throws IOException { Document.plainRandomAccess = true; FileInputStream fileStream = new FileInputStream(pdfFile); return new PdfReader( new RandomAccessFileOrArray(new FileChannelRandomAccessSource(fileStream.getChannel())), null); }