-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public final class PdfDocument implements Closeable
PdfDocument represents a PDF file and allows you to load pages from it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPdfDocument.Metapublic final classPdfDocument.Bookmarkpublic final classPdfDocument.Linkpublic final classPdfDocument.PageCountpublic classPdfDocument.Companion
-
Field Summary
Fields Modifier and Type Field Description private BooleanisClosedprivate ParcelFileDescriptorparcelFileDescriptorprivate final LongmNativeDocPtr
-
Constructor Summary
Constructors Constructor Description PdfDocument(Long mNativeDocPtr)
-
Method Summary
Modifier and Type Method Description final BooleangetIsClosed()final UnitsetIsClosed(Boolean isClosed)final ParcelFileDescriptorgetParcelFileDescriptor()final UnitsetParcelFileDescriptor(ParcelFileDescriptor parcelFileDescriptor)final LonggetMNativeDocPtr()final IntegergetPageCount()Get the page count of the PDF document final IntArraygetPageCharCounts()Get the page character counts for every page of the PDF document final PdfPageopenPage(Integer pageIndex)Open page and store native pointer in PdfDocument final UnitdeletePage(Integer pageIndex)Delete page final List<PdfPage>openPages(Integer fromIndex, Integer toIndex)Open range of pages and store native pointers in PdfDocument final PdfDocument.MetagetDocumentMeta()Get metadata for given document final List<PdfDocument.Bookmark>getTableOfContents()Get table of contents (bookmarks) for given document final PdfTextPageopenTextPage(PdfPage page)Open a text page final List<PdfTextPage>openTextPages(Integer fromIndex, Integer toIndex)Open a range of text pages final BooleansaveAsCopy(PdfWriteCallback callback, Integer flags)Save document as a copy Unitclose()Close the document -
-
Constructor Detail
-
PdfDocument
PdfDocument(Long mNativeDocPtr)
-
-
Method Detail
-
getIsClosed
final Boolean getIsClosed()
-
setIsClosed
final Unit setIsClosed(Boolean isClosed)
-
getParcelFileDescriptor
final ParcelFileDescriptor getParcelFileDescriptor()
-
setParcelFileDescriptor
final Unit setParcelFileDescriptor(ParcelFileDescriptor parcelFileDescriptor)
-
getMNativeDocPtr
final Long getMNativeDocPtr()
-
getPageCount
final Integer getPageCount()
Get the page count of the PDF document
-
getPageCharCounts
final IntArray getPageCharCounts()
Get the page character counts for every page of the PDF document
-
openPage
final PdfPage openPage(Integer pageIndex)
Open page and store native pointer in PdfDocument
- Parameters:
pageIndex- the page index
-
deletePage
final Unit deletePage(Integer pageIndex)
Delete page
- Parameters:
pageIndex- the page index
-
openPages
final List<PdfPage> openPages(Integer fromIndex, Integer toIndex)
Open range of pages and store native pointers in PdfDocument
- Parameters:
fromIndex- the start index of the rangetoIndex- the end index of the range
-
getDocumentMeta
final PdfDocument.Meta getDocumentMeta()
Get metadata for given document
-
getTableOfContents
final List<PdfDocument.Bookmark> getTableOfContents()
Get table of contents (bookmarks) for given document
-
openTextPage
final PdfTextPage openTextPage(PdfPage page)
Open a text page
- Parameters:
page- the PdfPage
-
openTextPages
final List<PdfTextPage> openTextPages(Integer fromIndex, Integer toIndex)
Open a range of text pages
- Parameters:
fromIndex- the start index of the rangetoIndex- the end index of the range
-
saveAsCopy
final Boolean saveAsCopy(PdfWriteCallback callback, Integer flags)
Save document as a copy
- Parameters:
callback- the PdfWriteCallback to be called with the dataflags- must be one of FPDF_INCREMENTAL, FPDF_NO_INCREMENTAL or FPDF_REMOVE_SECURITY
-
-
-
-