Methods Summary |
---|
public void | close()Closes this renderer. You should not use this instance
after this method is called.
throwIfClosed();
throwIfPageOpened();
doClose();
|
private void | doClose()
if (mCurrentPage != null) {
mCurrentPage.close();
}
nativeClose(mNativeDocument);
try {
mInput.close();
} catch (IOException ioe) {
/* ignore - best effort */
}
mInput = null;
mCloseGuard.close();
|
protected void | finalize()
try {
mCloseGuard.warnIfOpen();
if (mInput != null) {
doClose();
}
} finally {
super.finalize();
}
|
public int | getPageCount()Gets the number of pages in the document.
throwIfClosed();
return mPageCount;
|
private static native void | nativeClose(long documentPtr)
|
private static native void | nativeClosePage(long pagePtr)
|
private static native long | nativeCreate(int fd, long size)
|
private static native int | nativeGetPageCount(long documentPtr)
|
private static native long | nativeOpenPageAndGetSize(long documentPtr, int pageIndex, android.graphics.Point outSize)
|
private static native void | nativeRenderPage(long documentPtr, long pagePtr, long destPtr, int destLeft, int destTop, int destRight, int destBottom, long matrixPtr, int renderMode)
|
private static native boolean | nativeScaleForPrinting(long documentPtr)
|
public android.graphics.pdf.PdfRenderer$Page | openPage(int index)Opens a page for rendering.
throwIfClosed();
throwIfPageOpened();
throwIfPageNotInDocument(index);
mCurrentPage = new Page(index);
return mCurrentPage;
|
public boolean | shouldScaleForPrinting()Gets whether the document prefers to be scaled for printing.
You should take this info account if the document is rendered
for printing and the target media size differs from the page
size.
throwIfClosed();
return nativeScaleForPrinting(mNativeDocument);
|
private void | throwIfClosed()
if (mInput == null) {
throw new IllegalStateException("Already closed");
}
|
private void | throwIfPageNotInDocument(int pageIndex)
if (pageIndex < 0 || pageIndex >= mPageCount) {
throw new IllegalArgumentException("Invalid page index");
}
|
private void | throwIfPageOpened()
if (mCurrentPage != null) {
throw new IllegalStateException("Current page not closed");
}
|