Summary: Nested Classes | Constants | Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# PDFViewCtrl

extends JComponent
implements __Delete AutoCloseable Scrollable

java.lang.Object
↳ | java.awt.Component
| ↳ | java.awt.Container
|  | ↳ | javax.swing.JComponent
|  |  | ↳ | com.pdftron.pdf.PDFViewCtrl

## Class Overview

PDFViewCtrl is a utility class that can be used for interactive rendering of PDF documents.

In .NET environment PDFViewCtrl is derived from System.Windows.Forms.Control and it can be used like a regular form (see PDFViewForm.cs in PDFView sample for C# for a concrete example).

PDFViewCtrl implements some essential features such as double-buffering, multi-threaded rendering, scrolling, zooming, and page navigation that are essential in interactive rendering applications (e.g. in client PDF viewing and editing applications).

PDFView defines several coordinate spaces and it is important to understand their differences:

- Page Space refers to the space in which a PDF page is defined. It is determined by a page itself and the origin is at the lower-left corner of the page. Note that Page Space is independent of how a page is viewed in PDFView and each page has its own Page space.
- Canvas Space refers to the tightest axis-aligned bounding box of all the pages given the current page presentation mode in PDFView. For example, if the page presentation mode is `SINGLE_CONTINUOUS`, all the pages are arranged vertically with one page in each row, and therefore the Canvas Space is rectangle with possibly large height value. For this reason, Canvas Space is also, like Page Space, independent of the zoom factor. Also note that since PDFView adds gaps between adjacent pages, the Canvas Space is larger than the space occupied by all the pages. The origin of the Canvas Space is located at the upper-left corner.
- Screen Space (or Client Space) is the space occupied by PDFView and its origin is at the upper-left corner. Note that the virtual size of this space can extend beyond the visible region.
- Scrollable Space is the virtual space within which PDFView can scroll. It is determined by the Canvas Space and the current zoom factor. Roughly speaking, the dimensions of the Scrollable Space is the dimensions of the Canvas Space timed by the zoom. Therefore, a large zoom factor will result in a larger Scrollable region given the same Canvas region. For this reason, Scrollable Space might also be referred to as Zoomed Canvas Space. Note that since PDFView adds gaps between pages in Canvas Space and these gaps are not scaled when rendered, the scrollable range is not exactly what the zoom factor times the Canvas range. For functions such as setHScrollPos(), setVScrollPos(), getCanvasHeight(), and getCanvasWidth(), it is the Scrollable Space that is involved.

## Summary

Nested Classes
enum | PDFViewCtrl.ColorPostprocessMode |
class | PDFViewCtrl.LinkInfo | A class that holds information for a link.
enum | PDFViewCtrl.PagePresentationMode | PagePresentationMode lists common modes of presenting PDF pages.
enum | PDFViewCtrl.PageViewMode | PageViewMode lists common modes of viewing PDF pages.
class | PDFViewCtrl.Selection | A class representing the current text selection.

Constants
int | e_AnnotMgr_Admin_undoOthers |
int | e_AnnotMgr_Admin_undoOwn |
int | e_AnnotMgr_UserOnly |
int | e_custom | PDFViewCtrl class supports a number of 'built-in' tool modes.
int | e_facing | This constant is deprecated. use `FACING` instead.
int | e_facing_continuous | This constant is deprecated. use `FACING_CONTINUOUS` instead.
int | e_facing_continuous_cover | This constant is deprecated. use `FACING_CONTINUOUS_COVER` instead.
int | e_facing_cover | This constant is deprecated. use `FACING_COVER` instead.
int | e_fit_height | This constant is deprecated. use `FIT_HEIGHT` instead.
int | e_fit_page | This constant is deprecated. use `FIT_PAGE` instead.
int | e_fit_width | This constant is deprecated. use `FIT_WIDTH` instead.
int | e_pan | The Constant e_pan.
int | e_postprocess_invert | This constant is deprecated. use `INVERT` instead.
int | e_postprocess_none | This constant is deprecated. use `NONE` instead.
int | e_single_continuous | This constant is deprecated. use `SINGLE_CONTINUOUS` instead.
int | e_single_page | This constant is deprecated. use `SINGLE_PAGE` instead.
int | e_text_rect_select | The Constant e_text_rect_select.
int | e_text_struct_select | The Constant e_text_struct_select.
int | e_zoom | This constant is deprecated. use `ZOOM` instead.

[Expand] Inherited Constants
From class javax.swing.JComponent
String | TOOL_TIP_TEXT_KEY |
int | UNDEFINED_CONDITION |
int | WHEN_ANCESTOR_OF_FOCUSED_COMPONENT |
int | WHEN_FOCUSED |
int | WHEN_IN_FOCUSED_WINDOW |
From class java.awt.Component
float | BOTTOM_ALIGNMENT |
float | CENTER_ALIGNMENT |
float | LEFT_ALIGNMENT |
float | RIGHT_ALIGNMENT |
float | TOP_ALIGNMENT |
From interface java.awt.image.ImageObserver
int | ABORT |
int | ALLBITS |
int | ERROR |
int | FRAMEBITS |
int | HEIGHT |
int | PROPERTIES |
int | SOMEBITS |
int | WIDTH |

Public Constructors
| PDFViewCtrl() PDFViewCtrl constructor.
| PDFViewCtrl(int preferred_width) Instantiates a new PDFViewCtrl.

Public Methods
int | GetSelectionBeginPage() this method returns the first page number that has text selection on it.
int | GetSelectionEndPage() this method returns the last page number that has text selection on it.
boolean | HasSelectionOnPage(int page) Checks for selection on page.
boolean | canRedo() Returns whether redo operation is available.
boolean | canUndo() Returns whether undo operation is available.
void | cancelAllThumbRequests()
void | cancelRendering() Cancels rendering in progress.
void | cancelRenderingAsync() Cancels rendering in progress and returns immediately, potentially before rendering has actually stopped.
void | clearSelection() Remove any text selection.
void | close() Frees the native memory of the object.
Point2D.Double | convCanvasPtToPagePt(double x, double y, int page_num) Convert a point in canvas space to a point in a page space.
Point2D.Double | convCanvasPtToPagePt(double x, double y) Convert a point expressed in canvas space to a point in the current page space.
Point2D.Double | convCanvasPtToScreenPt(double x, double y) Convert a point expressed in canvas space to a point in screen space.
Point2D.Double | convPagePtToCanvasPt(double x, double y, int page_num) Convert a point in page space to a point in canvas space.
Point2D.Double | convPagePtToCanvasPt(double x, double y) Convert a point in a page space to a point in canvas space.
Point2D.Double | convPagePtToScreenPt(double x, double y) Convert a point from a page space to screen space.
Point2D.Double | convPagePtToScreenPt(double x, double y, int page_num) Convert a point from a page space to a point in screen space.
Point2D.Double | convScreenPtToCanvasPt(double x, double y) Convert a point expressed in screen space to a point in canvas space.
Point2D.Double | convScreenPtToPagePt(double x, double y, int page_num) Convert a point expressed in screen space to a point in a page space.
Point2D.Double | convScreenPtToPagePt(double x, double y) Convert a point expressed in screen space to the current page space.
void | destroy() Frees the native memory of the object.
void | docLock(boolean cancel_thread) Acquires a write lock on the currently open document, optionally canceling all threads accessing the document.
void | docLockRead() Locks the currently open document to prevent competing write threads (using Lock()) from accessing the document at the same time.
boolean | docTryLock(int milliseconds) Try acquiring a write lock on the currently open document, waiting no longer than specified number of milliseconds.
boolean | docTryLockRead(int milliseconds) Try acquiring a read lock on the current document, waiting no longer than specified number of milliseconds.
void | docUnlock() Releases the write lock from the currently open document.
void | docUnlockRead() Releases the read lock from the currently open document.
void | enableUndoRedo() Enable Undo/Redo in this PDFView.
void | findTextAsync(String search_str, boolean match_case, boolean match_whole_word, boolean search_up, boolean reg_exp) Selects text by searching for a given string of text asynchronously, and calling a user callback upon completion
Annot | getAnnotationAt(int x, int y) Gets the annotation at the (x, y) position expressed in screen coordinates.
Annot | getAnnotationAt(int x, int y, double distanceThreshold, double minimumLineWeight) Gets the annotation at the (x, y) position expressed in screen coordinates.
Annot[] | getAnnotationListAt(int x1, int y1, int x2, int y2) Gets the list of annotations at line (x1, y1, x2, y2) expressed in screen coordinates *
Annot[] | getAnnotationsOnPage(int page_num) Gets the list of annotations on a given page.
int | getBufferHeight() Get the width of the rendering buffer in pixels.
int | getBufferStride() Get the stride of the rendering buffer in pixels.
int | getBufferWidth() Get the width of the rendering buffer in pixels.
double | getCanvasHeight() Returns the height of the scrollable space.
double | getCanvasWidth() Returns the width of the scrollable space.
int | getColorPostProcessMode()
int | getCurrentPage() Get the current page.
Matrix2D | getDeviceTransform(int page_num) Get the device transform matrix
Matrix2D | getDeviceTransform() Get the device transformation matrix Note: to obtain a transformation matrix that maps screen coordinates to page coordinates, you can invert the device matrix.
PDFDoc | getDoc() Get the document.
ExternalAnnotManager | getExternalAnnotManager(String author_name) Get the external annot manager belonging to this PDFViewCtrl
ExternalAnnotManager | getExternalAnnotManager(String author_name, int mode) Get the external annot manager belonging to this PDFViewCtrl
int | getH()
double | getHScrollPos()
int | getHeight()
PDFViewCtrl.LinkInfo | getLinkAt(int x, int y) Gets the link info at a given point, specified in client space.
String | getNextRedoInfo() Returns any meta-data associated with the next state in the undo chain.
String | getNextUndoInfo() Returns any meta-data associated with the previous state in the undo chain.
Context | getOCGContext() Get the oCG context.
int | getPageCount() Get the page count.
int | getPageNumberFromScreenPt(double x, double y) Get the page number from screen pt.
int | getPagePresentationMode() Get the page presentation mode.
int | getPageViewMode() Get the page view mode.
Dimension | getPreferredScrollableViewportSize()
Dimension | getPreferredSize()
int | getRotation() Get the rotation.
Rect | getScreenRectForAnnot(Annot annot, int page_num) Gets annotation bounding box in screen points
int | getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
boolean | getScrollableTracksViewportHeight()
boolean | getScrollableTracksViewportWidth()
int | getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
PDFViewCtrl.Selection | getSelection(int page) Get the selection.
Dimension | getSize(Dimension rv)
void | getThumbAsync(int page_num, ThumbAsyncHandler proc, Object data)
int | getToolMode() Get the tool mode.
int | getV()
double | getVScrollPos()
PDFViewScrollPane | getViewPane()
int | getWidth()
double | getZoom() Get the current zoom factor.
boolean | gotoFirstPage() Set the current page to the first page in the document.
boolean | gotoLastPage() Set the current page to the last page in the document.
boolean | gotoNextPage() Set the current page to the next page in the document.
boolean | gotoPreviousPage() Set the current page to the previous page in the document.
boolean | hasChangesSinceSnapshot() Returns whether the document has been modified since the last undo/redo snapshot was taken.
boolean | hasSelection() Checks for selection.
void | hideAnnotation(Annot annot) Disable rendering of a particular annotation.
void | invalidateRect(Rect rect) Invalidate rect.
void | invalidateRect() The InvalidateRect function adds a rectangle to the buffer/window update region.
boolean | isFinishedRendering()
void | onScroll(int pix_dx, int pix_dy) Scrolls the contents of the rendering buffer 'pix_dx' horizontally and 'pix_dy' vertically.
String | redo() Go to the next state in the undo/redo chain.
void | refreshAndUpdate(ViewChangeCollection view_change) Helper function that will refresh annotation and/or field appearances if needed, and then render modified page areas, all based on the contents of the view_change parameter.
void | revertAllChanges() Returns to the initial state in the undo/redo chain.
void | revertChangesSinceSnapshot() Restores the document to the state of the last undo/redo snapshot, if it has been modified since.
void | rotateClockwise() Rotates all pages in the document 90 degrees clockwise.
void | rotateCounterClockwise() Rotates all pages in the document 90 degrees counter-clockwise.
void | scrollRectToVisible(Rectangle r)
void | selectAll() Selects all text on the page.
boolean | selectByHighlights(Highlights hlts) Selects texts by Highlights.
boolean | selectByRect(double x1, double y1, double x2, double y2) Selects all words that intersect the given selection rectangle.
boolean | selectBySelection(PDFViewCtrl.Selection sel) Selects texts by PDFViewCtrl.Selection.
boolean | selectByStruct(double x1, double y1, double x2, double y2) Selects text taking into account page logical structure.
void | setAntiAliasing(boolean enable_aa) Enable or disable anti-aliasing.
void | setBackground(Color c) Set the default background color used to paint the area surrounding each page.
void | setBackgroundColor(byte r, byte g, byte b) Set the default background color used to paint the area surrounding each page.
void | setCaching(boolean enabled) Enables or disables caching.
void | setColorPostProcessMode(int mode) This method is deprecated. use #setColorPostprocessMode()ColorPostprocessMode instead. Set the color post processing transformation. This transform is applied to the rasterized bitmap as the final step in the rasterization process, and is applied directly to the resulting bitmap (disregarding any color space information). Color post processing only supported for RGBA output.
void | setColorPostProcessMode(PDFViewCtrl.ColorPostprocessMode mode) Set the color post processing transformation.
boolean | setCurrentPage(int page_num) Set the current page to the given page.
void | setCurrentPageProc(CurrentPageProc curr_pagenum_proc, Object data) Set the callback function (i.e.
void | setDefaultPageColor(byte r, byte g, byte b) Set the default 'paper' color used to draw background of each page.
void | setDefaultPageColor(Color c) Set the default 'paper' color used to draw background of each page.
void | setDevicePixelDensity(double dpi, double scale_factor) Set device DPI, and scale factor.
void | setDoc(PDFDoc doc) Associates this PDFViewCtrl with a given PDF document.
void | setDrawAnnotations(boolean render_annots) Enable or disable annotation and forms rendering.
void | setErrorReportProc(ErrorReportProc error_proc, Object data) Set the error report process
void | setFieldHighlightColor(ColorPt cp) Set the highlight color for fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`.
void | setFindTextHandler(FindTextProc proc, Object data) Set the callback function (i.e.
void | setGamma(double exp) Set the gamma factor used for anti-aliased rendering.
void | setH(int h)
void | setHScrollPos(double pos) Sets the horizontal scroll position in the scrollable space..
void | setHighlightFields(boolean highlight_fields) Enable or disable highlighting form fields.
void | setHorizontalAlign(int align) Set the horizontal alignment used for rendering pages within the view.
void | setImageSmoothing(boolean smoothing_enabled) Set the image smoothing.
void | setImageSmoothing() Enable or disable image smoothing.
void | setOCGContext(Context ctx) Set the Optional Content Group (OCG) context that should be used when viewing the document.
void | setOverprint(int op) Enable or disable support for overprint.
void | setPageBorderVisibility(boolean border_visible) Enables or disables drawing of a thin border around each page.
void | setPagePresentationMode(PDFViewCtrl.PagePresentationMode mode) Set the current page presentation mode.
void | setPagePresentationMode(int mode) This method is deprecated. use `setPagePresentationMode(PagePresentationMode)` instead. Set the current page presentation mode.
void | setPageSpacing(int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad) Set the vertical and horizontal padding and column spacing between adjacent pages in the view.
void | setPageTransparencyGrid(boolean trans_grid_visible) Enables or disables the transparency grid (check board pattern) to reflect page transparency.
void | setPageViewMode(PDFViewCtrl.PageViewMode mode) Set the page viewing mode.
void | setPageViewMode(int mode) This method is deprecated. use `setPageViewMode(PageViewMode)` instead. Set the page viewing mode. Note: The default PageView mode is e_fit_width.
void | setPathHinting(boolean enable_ph) Enable or disable path hinting.
void | setPreferredSize(int width, int height) Set the preferred size.
void | setPreferredSize(Dimension d)
void | setProgressiveRendering(boolean is_progressive) Enables or disables progressive rendering in PDFViewCtrl.
void | setRasterizer(boolean builtin_rasterizer) Set the core graphics library used for rasterization and rendering.
void | setRequestRenderInWorkerThreadProc(RequestRenderInWorkerThreadProc render_worker_proc, Object data) Sets the RequestRenderInWorkerThread Callback
void | setRequiredFieldBorderColor(ColorPt cp) Set the border color for required fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`.
void | setSignatureHighlightColor(ColorPt cp) Set the highlight color for signature fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`.
void | setSnappingMode(int mode_flags) Set the point snapping mode for the SnapToNearestInDoc method.
void | setThinLineAdjustment(boolean pixel_grid_fit, boolean stroke_adjust) Set thin line adjustment parameters.
void | setToolMode(int mode) Set the new tool mode (such as pan, text select, etc).
void | setUrlExtraction(boolean enabled) Enables or disables URL extraction.
void | setV(int v)
void | setVScrollPos(double pos) Sets the vertical scroll position in the scrollable space..
void | setVerticalAlign(int align) Set the vertical alignment used for rendering pages within the view.
static void | setViewerCache(SDFDoc document, int max_cache_size, boolean on_disk) Sets the cache parameters of the page cache on disk (which caches content streams and mipmapped images) for this specific document.
boolean | setZoom(double zoom) Set the zoom factor to a new value.
boolean | setZoom(int x, int y, double zoom) Set the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center.
void | setupThumbnails(boolean use_embedded, boolean generate_at_runtime, boolean use_disk_cache, int thumb_max_side_length, long max_abs_cache_size, double max_perc_cache_size) Specify the different thumbnail settings for the viewer.
void | showAnnotation(Annot annot) Enable rendering of a particular annotation.
boolean | showRect(int page_num, Rect rect) Changes the viewing area to fit a rectangle on specified page number.
boolean | smartZoom(int x, int y) Set the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center.
Point2D.Double | snapToNearestInDoc(double x, double y) Returns the point within the document geometry that is closest to another arbtrary point in screen space
void | takeSnapshot(String meta_info) Creates a new state at the top of the undo/redo chain by taking a snapshot.
String | undo() Return to the previous state in the undo/redo chain.
void | update(Annot a, int num_page) Redraws the area covered with a given annotation.
void | update() Redraws the contents of the buffer.
void | update(Rect rec) Redraws the given area in the buffer.
void | update(Field field) Redraws all instances (Widgets) of the field.
void | update(Graphics g)
void | updatePageLayout() Updates the page layout within the view.

[Expand] Inherited Methods
From class javax.swing.JComponent
void | addAncestorListener(AncestorListener arg0)
void | addNotify()
synchronized void | addVetoableChangeListener(VetoableChangeListener arg0)
void | computeVisibleRect(Rectangle arg0)
boolean | contains(int arg0, int arg1)
JToolTip | createToolTip()
void | disable()
void | enable()
void | firePropertyChange(String arg0, boolean arg1, boolean arg2)
void | firePropertyChange(String arg0, char arg1, char arg2)
void | firePropertyChange(String arg0, int arg1, int arg2)
ActionListener | getActionForKeyStroke(KeyStroke arg0)
final ActionMap | getActionMap()
float | getAlignmentX()
float | getAlignmentY()
AncestorListener[] | getAncestorListeners()
boolean | getAutoscrolls()
int | getBaseline(int arg0, int arg1)
Component.BaselineResizeBehavior | getBaselineResizeBehavior()
Border | getBorder()
Rectangle | getBounds(Rectangle arg0)
final Object | getClientProperty(Object arg0)
JPopupMenu | getComponentPopupMenu()
int | getConditionForKeyStroke(KeyStroke arg0)
int | getDebugGraphicsOptions()
static Locale | getDefaultLocale()
FontMetrics | getFontMetrics(Font arg0)
Graphics | getGraphics()
int | getHeight()
boolean | getInheritsPopupMenu()
final InputMap | getInputMap(int arg0)
final InputMap | getInputMap()
InputVerifier | getInputVerifier()
Insets | getInsets()
Insets | getInsets(Insets arg0)
<T extends EventListener> T[] | getListeners(Class<T> arg0)
Point | getLocation(Point arg0)
Dimension | getMaximumSize()
Dimension | getMinimumSize()
Component | getNextFocusableComponent()
Point | getPopupLocation(MouseEvent arg0)
Dimension | getPreferredSize()
KeyStroke[] | getRegisteredKeyStrokes()
JRootPane | getRootPane()
Dimension | getSize(Dimension arg0)
Point | getToolTipLocation(MouseEvent arg0)
String | getToolTipText()
String | getToolTipText(MouseEvent arg0)
Container | getTopLevelAncestor()
TransferHandler | getTransferHandler()
String | getUIClassID()
boolean | getVerifyInputWhenFocusTarget()
synchronized VetoableChangeListener[] | getVetoableChangeListeners()
Rectangle | getVisibleRect()
int | getWidth()
int | getX()
int | getY()
void | grabFocus()
void | hide()
boolean | isDoubleBuffered()
static boolean | isLightweightComponent(Component arg0)
boolean | isManagingFocus()
boolean | isOpaque()
boolean | isOptimizedDrawingEnabled()
final boolean | isPaintingForPrint()
boolean | isPaintingTile()
boolean | isRequestFocusEnabled()
boolean | isValidateRoot()
void | paint(Graphics arg0)
void | paintImmediately(int arg0, int arg1, int arg2, int arg3)
void | paintImmediately(Rectangle arg0)
void | print(Graphics arg0)
void | printAll(Graphics arg0)
final void | putClientProperty(Object arg0, Object arg1)
void | registerKeyboardAction(ActionListener arg0, KeyStroke arg1, int arg2)
void | registerKeyboardAction(ActionListener arg0, String arg1, KeyStroke arg2, int arg3)
void | removeAncestorListener(AncestorListener arg0)
void | removeNotify()
synchronized void | removeVetoableChangeListener(VetoableChangeListener arg0)
void | repaint(Rectangle arg0)
void | repaint(long arg0, int arg1, int arg2, int arg3, int arg4)
boolean | requestDefaultFocus()
void | requestFocus()
boolean | requestFocus(boolean arg0)
boolean | requestFocusInWindow()
void | resetKeyboardActions()
void | reshape(int arg0, int arg1, int arg2, int arg3)
void | revalidate()
void | scrollRectToVisible(Rectangle arg0)
final void | setActionMap(ActionMap arg0)
void | setAlignmentX(float arg0)
void | setAlignmentY(float arg0)
void | setAutoscrolls(boolean arg0)
void | setBackground(Color arg0)
void | setBorder(Border arg0)
void | setComponentPopupMenu(JPopupMenu arg0)
void | setDebugGraphicsOptions(int arg0)
static void | setDefaultLocale(Locale arg0)
void | setDoubleBuffered(boolean arg0)
void | setEnabled(boolean arg0)
void | setFocusTraversalKeys(int arg0, Set<? extends AWTKeyStroke> arg1)
void | setFont(Font arg0)
void | setForeground(Color arg0)
void | setInheritsPopupMenu(boolean arg0)
final void | setInputMap(int arg0, InputMap arg1)
void | setInputVerifier(InputVerifier arg0)
void | setMaximumSize(Dimension arg0)
void | setMinimumSize(Dimension arg0)
void | setNextFocusableComponent(Component arg0)
void | setOpaque(boolean arg0)
void | setPreferredSize(Dimension arg0)
void | setRequestFocusEnabled(boolean arg0)
void | setToolTipText(String arg0)
void | setTransferHandler(TransferHandler arg0)
void | setVerifyInputWhenFocusTarget(boolean arg0)
void | setVisible(boolean arg0)
void | unregisterKeyboardAction(KeyStroke arg0)
void | update(Graphics arg0)
void | updateUI()
From class java.awt.Container
void | add(Component arg0, Object arg1, int arg2)
Component | add(Component arg0)
Component | add(String arg0, Component arg1)
void | add(Component arg0, Object arg1)
Component | add(Component arg0, int arg1)
synchronized void | addContainerListener(ContainerListener arg0)
void | addNotify()
void | addPropertyChangeListener(String arg0, PropertyChangeListener arg1)
void | addPropertyChangeListener(PropertyChangeListener arg0)
void | applyComponentOrientation(ComponentOrientation arg0)
boolean | areFocusTraversalKeysSet(int arg0)
int | countComponents()
void | deliverEvent(Event arg0)
void | doLayout()
Component | findComponentAt(int arg0, int arg1)
Component | findComponentAt(Point arg0)
float | getAlignmentX()
float | getAlignmentY()
Component | getComponent(int arg0)
Component | getComponentAt(int arg0, int arg1)
Component | getComponentAt(Point arg0)
int | getComponentCount()
int | getComponentZOrder(Component arg0)
Component[] | getComponents()
synchronized ContainerListener[] | getContainerListeners()
Set<AWTKeyStroke> | getFocusTraversalKeys(int arg0)
FocusTraversalPolicy | getFocusTraversalPolicy()
Insets | getInsets()
LayoutManager | getLayout()
<T extends EventListener> T[] | getListeners(Class<T> arg0)
Dimension | getMaximumSize()
Dimension | getMinimumSize()
Point | getMousePosition(boolean arg0)
Dimension | getPreferredSize()
Insets | insets()
void | invalidate()
boolean | isAncestorOf(Component arg0)
boolean | isFocusCycleRoot()
boolean | isFocusCycleRoot(Container arg0)
final boolean | isFocusTraversalPolicyProvider()
boolean | isFocusTraversalPolicySet()
boolean | isValidateRoot()
void | layout()
void | list(PrintWriter arg0, int arg1)
void | list(PrintStream arg0, int arg1)
Component | locate(int arg0, int arg1)
Dimension | minimumSize()
void | paint(Graphics arg0)
void | paintComponents(Graphics arg0)
Dimension | preferredSize()
void | print(Graphics arg0)
void | printComponents(Graphics arg0)
void | remove(Component arg0)
void | remove(int arg0)
void | removeAll()
synchronized void | removeContainerListener(ContainerListener arg0)
void | removeNotify()
void | setComponentZOrder(Component arg0, int arg1)
void | setFocusCycleRoot(boolean arg0)
void | setFocusTraversalKeys(int arg0, Set<? extends AWTKeyStroke> arg1)
void | setFocusTraversalPolicy(FocusTraversalPolicy arg0)
final void | setFocusTraversalPolicyProvider(boolean arg0)
void | setFont(Font arg0)
void | setLayout(LayoutManager arg0)
void | transferFocusDownCycle()
void | update(Graphics arg0)
void | validate()
From class java.awt.Component
boolean | action(Event arg0, Object arg1)
void | add(PopupMenu arg0)
synchronized void | addComponentListener(ComponentListener arg0)
synchronized void | addFocusListener(FocusListener arg0)
void | addHierarchyBoundsListener(HierarchyBoundsListener arg0)
void | addHierarchyListener(HierarchyListener arg0)
synchronized void | addInputMethodListener(InputMethodListener arg0)
synchronized void | addKeyListener(KeyListener arg0)
synchronized void | addMouseListener(MouseListener arg0)
synchronized void | addMouseMotionListener(MouseMotionListener arg0)
synchronized void | addMouseWheelListener(MouseWheelListener arg0)
void | addNotify()
void | addPropertyChangeListener(String arg0, PropertyChangeListener arg1)
void | addPropertyChangeListener(PropertyChangeListener arg0)
void | applyComponentOrientation(ComponentOrientation arg0)
boolean | areFocusTraversalKeysSet(int arg0)
Rectangle | bounds()
int | checkImage(Image arg0, int arg1, int arg2, ImageObserver arg3)
int | checkImage(Image arg0, ImageObserver arg1)
boolean | contains(Point arg0)
boolean | contains(int arg0, int arg1)
Image | createImage(ImageProducer arg0)
Image | createImage(int arg0, int arg1)
VolatileImage | createVolatileImage(int arg0, int arg1, ImageCapabilities arg2)
VolatileImage | createVolatileImage(int arg0, int arg1)
void | deliverEvent(Event arg0)
void | disable()
final void | dispatchEvent(AWTEvent arg0)
void | doLayout()
void | enable()
void | enable(boolean arg0)
void | enableInputMethods(boolean arg0)
void | firePropertyChange(String arg0, byte arg1, byte arg2)
void | firePropertyChange(String arg0, char arg1, char arg2)
void | firePropertyChange(String arg0, short arg1, short arg2)
void | firePropertyChange(String arg0, double arg1, double arg2)
void | firePropertyChange(String arg0, float arg1, float arg2)
void | firePropertyChange(String arg0, long arg1, long arg2)
AccessibleContext | getAccessibleContext()
float | getAlignmentX()
float | getAlignmentY()
Color | getBackground()
int | getBaseline(int arg0, int arg1)
Component.BaselineResizeBehavior | getBaselineResizeBehavior()
Rectangle | getBounds()
Rectangle | getBounds(Rectangle arg0)
ColorModel | getColorModel()
Component | getComponentAt(int arg0, int arg1)
Component | getComponentAt(Point arg0)
synchronized ComponentListener[] | getComponentListeners()
ComponentOrientation | getComponentOrientation()
Cursor | getCursor()
synchronized DropTarget | getDropTarget()
Container | getFocusCycleRootAncestor()
synchronized FocusListener[] | getFocusListeners()
Set<AWTKeyStroke> | getFocusTraversalKeys(int arg0)
boolean | getFocusTraversalKeysEnabled()
Font | getFont()
FontMetrics | getFontMetrics(Font arg0)
Color | getForeground()
Graphics | getGraphics()
GraphicsConfiguration | getGraphicsConfiguration()
int | getHeight()
synchronized HierarchyBoundsListener[] | getHierarchyBoundsListeners()
synchronized HierarchyListener[] | getHierarchyListeners()
boolean | getIgnoreRepaint()
InputContext | getInputContext()
synchronized InputMethodListener[] | getInputMethodListeners()
InputMethodRequests | getInputMethodRequests()
synchronized KeyListener[] | getKeyListeners()
<T extends EventListener> T[] | getListeners(Class<T> arg0)
Locale | getLocale()
Point | getLocation(Point arg0)
Point | getLocation()
Point | getLocationOnScreen()
Dimension | getMaximumSize()
Dimension | getMinimumSize()
synchronized MouseListener[] | getMouseListeners()
synchronized MouseMotionListener[] | getMouseMotionListeners()
Point | getMousePosition()
synchronized MouseWheelListener[] | getMouseWheelListeners()
String | getName()
Container | getParent()
ComponentPeer | getPeer()
Dimension | getPreferredSize()
PropertyChangeListener[] | getPropertyChangeListeners()
PropertyChangeListener[] | getPropertyChangeListeners(String arg0)
Dimension | getSize()
Dimension | getSize(Dimension arg0)
Toolkit | getToolkit()
final Object | getTreeLock()
int | getWidth()
int | getX()
int | getY()
boolean | gotFocus(Event arg0, Object arg1)
boolean | handleEvent(Event arg0)
boolean | hasFocus()
void | hide()
boolean | imageUpdate(Image arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
boolean | inside(int arg0, int arg1)
void | invalidate()
boolean | isBackgroundSet()
boolean | isCursorSet()
boolean | isDisplayable()
boolean | isDoubleBuffered()
boolean | isEnabled()
boolean | isFocusCycleRoot(Container arg0)
boolean | isFocusOwner()
boolean | isFocusTraversable()
boolean | isFocusable()
boolean | isFontSet()
boolean | isForegroundSet()
boolean | isLightweight()
boolean | isMaximumSizeSet()
boolean | isMinimumSizeSet()
boolean | isOpaque()
boolean | isPreferredSizeSet()
boolean | isShowing()
boolean | isValid()
boolean | isVisible()
boolean | keyDown(Event arg0, int arg1)
boolean | keyUp(Event arg0, int arg1)
void | layout()
void | list()
void | list(PrintStream arg0)
void | list(PrintWriter arg0)
void | list(PrintWriter arg0, int arg1)
void | list(PrintStream arg0, int arg1)
Component | locate(int arg0, int arg1)
Point | location()
boolean | lostFocus(Event arg0, Object arg1)
Dimension | minimumSize()
boolean | mouseDown(Event arg0, int arg1, int arg2)
boolean | mouseDrag(Event arg0, int arg1, int arg2)
boolean | mouseEnter(Event arg0, int arg1, int arg2)
boolean | mouseExit(Event arg0, int arg1, int arg2)
boolean | mouseMove(Event arg0, int arg1, int arg2)
boolean | mouseUp(Event arg0, int arg1, int arg2)
void | move(int arg0, int arg1)
void | nextFocus()
void | paint(Graphics arg0)
void | paintAll(Graphics arg0)
boolean | postEvent(Event arg0)
Dimension | preferredSize()
boolean | prepareImage(Image arg0, int arg1, int arg2, ImageObserver arg3)
boolean | prepareImage(Image arg0, ImageObserver arg1)
void | print(Graphics arg0)
void | printAll(Graphics arg0)
void | remove(MenuComponent arg0)
synchronized void | removeComponentListener(ComponentListener arg0)
synchronized void | removeFocusListener(FocusListener arg0)
void | removeHierarchyBoundsListener(HierarchyBoundsListener arg0)
void | removeHierarchyListener(HierarchyListener arg0)
synchronized void | removeInputMethodListener(InputMethodListener arg0)
synchronized void | removeKeyListener(KeyListener arg0)
synchronized void | removeMouseListener(MouseListener arg0)
synchronized void | removeMouseMotionListener(MouseMotionListener arg0)
synchronized void | removeMouseWheelListener(MouseWheelListener arg0)
void | removeNotify()
void | removePropertyChangeListener(String arg0, PropertyChangeListener arg1)
void | removePropertyChangeListener(PropertyChangeListener arg0)
void | repaint(int arg0, int arg1, int arg2, int arg3)
void | repaint()
void | repaint(long arg0)
void | repaint(long arg0, int arg1, int arg2, int arg3, int arg4)
void | requestFocus()
boolean | requestFocusInWindow()
void | reshape(int arg0, int arg1, int arg2, int arg3)
void | resize(Dimension arg0)
void | resize(int arg0, int arg1)
void | revalidate()
void | setBackground(Color arg0)
void | setBounds(int arg0, int arg1, int arg2, int arg3)
void | setBounds(Rectangle arg0)
void | setComponentOrientation(ComponentOrientation arg0)
void | setCursor(Cursor arg0)
synchronized void | setDropTarget(DropTarget arg0)
void | setEnabled(boolean arg0)
void | setFocusTraversalKeys(int arg0, Set<? extends AWTKeyStroke> arg1)
void | setFocusTraversalKeysEnabled(boolean arg0)
void | setFocusable(boolean arg0)
void | setFont(Font arg0)
void | setForeground(Color arg0)
void | setIgnoreRepaint(boolean arg0)
void | setLocale(Locale arg0)
void | setLocation(Point arg0)
void | setLocation(int arg0, int arg1)
void | setMaximumSize(Dimension arg0)
void | setMinimumSize(Dimension arg0)
void | setName(String arg0)
void | setPreferredSize(Dimension arg0)
void | setSize(int arg0, int arg1)
void | setSize(Dimension arg0)
void | setVisible(boolean arg0)
void | show(boolean arg0)
void | show()
Dimension | size()
String | toString()
void | transferFocus()
void | transferFocusBackward()
void | transferFocusUpCycle()
void | update(Graphics arg0)
void | validate()
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface com.pdftron.pdf.__Delete
abstract void | destroy()
From interface java.awt.MenuContainer
abstract Font | getFont()
abstract boolean | postEvent(Event arg0)
abstract void | remove(MenuComponent arg0)
From interface java.awt.image.ImageObserver
abstract boolean | imageUpdate(Image arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
From interface java.lang.AutoCloseable
abstract void | close()
From interface javax.swing.Scrollable
abstract Dimension | getPreferredScrollableViewportSize()
abstract int | getScrollableBlockIncrement(Rectangle arg0, int arg1, int arg2)
abstract boolean | getScrollableTracksViewportHeight()
abstract boolean | getScrollableTracksViewportWidth()
abstract int | getScrollableUnitIncrement(Rectangle arg0, int arg1, int arg2)

## Constants

#### public static final int e_AnnotMgr_Admin_undoOthers

Constant Value: 1 (0x00000001)

#### public static final int e_AnnotMgr_Admin_undoOwn

Constant Value: 2 (0x00000002)

#### public static final int e_AnnotMgr_UserOnly

Constant Value: 0 (0x00000000)

#### public static final int e_custom

PDFViewCtrl class supports a number of 'built-in' tool modes. ToolMode enumerates tool modes supported by PDFViewCtrl.

Constant Value: 0 (0x00000000)

#### public static final int e_facing

This constant is deprecated.
use `FACING` instead.

only two pages fit in the current view (similar to booklet view).

Constant Value: 3 (0x00000003)

#### public static final int e_facing_continuous

This constant is deprecated.
use `FACING_CONTINUOUS` instead.

pages are displayed sequentially with two pages per row.

Constant Value: 4 (0x00000004)

#### public static final int e_facing_continuous_cover

This constant is deprecated.
use `FACING_CONTINUOUS_COVER` instead.

display the pages in two columns, with odd-numbered pages on the right.

Constant Value: 6 (0x00000006)

#### public static final int e_facing_cover

This constant is deprecated.
use `FACING_COVER` instead.

display the pages two at a time, with odd-numbered pages on the right.

Constant Value: 5 (0x00000005)

#### public static final int e_fit_height

This constant is deprecated.
use `FIT_HEIGHT` instead.

fit height

Constant Value: 2 (0x00000002)

#### public static final int e_fit_page

This constant is deprecated.
use `FIT_PAGE` instead.

fit page

Constant Value: 0 (0x00000000)

#### public static final int e_fit_width

This constant is deprecated.
use `FIT_WIDTH` instead.

fit width

Constant Value: 1 (0x00000001)

#### public static final int e_pan

The Constant e_pan.

Constant Value: 1 (0x00000001)

#### public static final int e_postprocess_invert

This constant is deprecated.
use `INVERT` instead.

invert postprocess

Constant Value: 1 (0x00000001)

#### public static final int e_postprocess_none

This constant is deprecated.
use `NONE` instead.

no prostprocess

Constant Value: 0 (0x00000000)

#### public static final int e_single_continuous

This constant is deprecated.
use `SINGLE_CONTINUOUS` instead.

pages are displayed sequentially (one underneath another).

Constant Value: 2 (0x00000002)

#### public static final int e_single_page

This constant is deprecated.
use `SINGLE_PAGE` instead.

only one page at a time fits in the current view.

Constant Value: 1 (0x00000001)

#### public static final int e_text_rect_select

The Constant e_text_rect_select.

Constant Value: 2 (0x00000002)

#### public static final int e_text_struct_select

The Constant e_text_struct_select.

Constant Value: 3 (0x00000003)

#### public static final int e_zoom

This constant is deprecated.
use `ZOOM` instead.

zoom

Constant Value: 3 (0x00000003)

## Public Constructors

#### public PDFViewCtrl ()

PDFViewCtrl constructor. Create PDFViewCtrl without associating it to any document.

#### public PDFViewCtrl (int preferred_width)

Instantiates a new PDFViewCtrl.

##### Parameters

preferred_width | the preferred PDFViewCtrl width

## Public Methods

#### public int GetSelectionBeginPage ()

this method returns the first page number that has text selection on it. Useful when there are selections on multiple pages at the same time.

##### Returns

- the int

#### public int GetSelectionEndPage ()

this method returns the last page number that has text selection on it. Useful when there are selections on multiple pages at the same time.

##### Returns

- the int

#### public boolean HasSelectionOnPage (int page)

Checks for selection on page.

##### Parameters

page | the page

##### Returns

- returns true if given page number has any text selection on it. Useful when there are selections on multiple pages at the same time.

#### public boolean canRedo ()

Returns whether redo operation is available.

##### Returns

- true if redo operation is available, false otherwise.

##### Throws

PDFNetException |

#### public boolean canUndo ()

Returns whether undo operation is available.

##### Returns

- true if undo operation is available, false otherwise.

##### Throws

PDFNetException |

#### public void cancelAllThumbRequests ()

#### public void cancelRendering ()

Cancels rendering in progress. If PDFViewCtrl is not busy rendering the page, the function has no side effects.

#### public void cancelRenderingAsync ()

Cancels rendering in progress and returns immediately, potentially before rendering has actually stopped.

#### public void clearSelection ()

Remove any text selection.

#### public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

##### Throws

PDFNetException |

#### public Point2D.Double convCanvasPtToPagePt (double x, double y, int page_num)

Convert a point in canvas space to a point in a page space.

##### Parameters

x | x coordinate of the canvas point
y | y coordinate of the canvas point
page_num | the page number for the page used as the origin of the destination coordinate system. Pages are indexed starting from 1.

##### Returns

- converted point in page space.

#### public Point2D.Double convCanvasPtToPagePt (double x, double y)

Convert a point expressed in canvas space to a point in the current page space.

##### Parameters

x | x coordinate of the canvas point
y | y coordinate of the canvas point

##### Returns

- converted point in page space.

#### public Point2D.Double convCanvasPtToScreenPt (double x, double y)

Convert a point expressed in canvas space to a point in screen space.

##### Parameters

x | x coordinate of the canvas point
y | y coordinate of the canvas point

##### Returns

- converted point in screen space.

#### public Point2D.Double convPagePtToCanvasPt (double x, double y, int page_num)

Convert a point in page space to a point in canvas space.

##### Parameters

x | x coordinate of the point on the specified page
y | y coordinate of the point on the specified page
page_num | input page number

##### Returns

- converted point in canvas space.

#### public Point2D.Double convPagePtToCanvasPt (double x, double y)

Convert a point in a page space to a point in canvas space.

##### Parameters

x | x coordinate of point on current page
y | y coordinate of point on current page

##### Returns

- converted point in the canvas space.

#### public Point2D.Double convPagePtToScreenPt (double x, double y)

Convert a point from a page space to screen space.

##### Parameters

x | x coordinate of the point on the current page
y | y coordinate of the point on the current page

##### Returns

- converted point in screen space.

#### public Point2D.Double convPagePtToScreenPt (double x, double y, int page_num)

Convert a point from a page space to a point in screen space.

##### Parameters

x | x coordinate of the point on the specified page
y | y coordinate of the point on the specified page
page_num | input page number

#### public Point2D.Double convScreenPtToCanvasPt (double x, double y)

Convert a point expressed in screen space to a point in canvas space.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point

##### Returns

- converted point in canvas space.

#### public Point2D.Double convScreenPtToPagePt (double x, double y, int page_num)

Convert a point expressed in screen space to a point in a page space.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point
page_num | the input page number

##### Returns

- converted point in the specified page space.

#### public Point2D.Double convScreenPtToPagePt (double x, double y)

Convert a point expressed in screen space to the current page space. page.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point

##### Returns

- converted point in the current page space.

#### public void destroy ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

#### public void docLock (boolean cancel_thread)

Acquires a write lock on the currently open document, optionally canceling all threads accessing the document.

#### public void docLockRead ()

Locks the currently open document to prevent competing write threads (using Lock()) from accessing the document at the same time. Other reader threads however, will be allowed to access the document. Threads attempting to obtain write access to the document will wait in suspended state until the thread that owns the lock calls doc.UnlockRead(). Note: To avoid deadlocks obtaining a write lock while holding a read lock is not permitted and will throw an exception. If this situation is encountered please either unlock the read lock before the write lock is obtained or acquire a write lock (rather than read lock) in the first place.

#### public boolean docTryLock (int milliseconds)

Try acquiring a write lock on the currently open document, waiting no longer than specified number of milliseconds.

##### Returns

- true if the document is locked for multi-threaded access, false otherwise.

#### public boolean docTryLockRead (int milliseconds)

Try acquiring a read lock on the current document, waiting no longer than specified number of milliseconds.

##### Returns

- true if the document is locked for multi-threaded access, false otherwise.

#### public void docUnlock ()

Releases the write lock from the currently open document.

#### public void docUnlockRead ()

Releases the read lock from the currently open document.

#### public void enableUndoRedo ()

Enable Undo/Redo in this PDFView.

##### Throws

PDFNetException |

#### public void findTextAsync (String search_str, boolean match_case, boolean match_whole_word, boolean search_up, boolean reg_exp)

Selects text by searching for a given string of text asynchronously, and calling a user callback upon completion

##### Parameters

search_str | -
match_case | -
match_whole_word | -
search_up | -
reg_exp | - use regular expressions

#### public Annot getAnnotationAt (int x, int y)

Gets the annotation at the (x, y) position expressed in screen coordinates.

Note: For details about client space, please refer to `convScreenPtToCanvasPt(double, double)`.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point

##### Returns

- The annotation found. If no annotation was found, it returns a null pointer.

#### public Annot getAnnotationAt (int x, int y, double distanceThreshold, double minimumLineWeight)

Gets the annotation at the (x, y) position expressed in screen coordinates.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point
distanceThreshold | Maximum distance from the point (x, y) to the annotation for the annot to be considered a hit.
minimumLineWeight | For very thin lines, it is almost impossible to hit the actual line. This specifies a minimum line thickness (in screen coordinates) for the purpose of calculating whether a point is inside the annotation or not.

##### Returns

- The annotation closest to the point. If no annotation was found, it returns a null pointer.

#### public Annot[] getAnnotationListAt (int x1, int y1, int x2, int y2)

Gets the list of annotations at line (x1, y1, x2, y2) expressed in screen coordinates *

##### Parameters

x1 | x coordinate of the screen point at one of the end points of the line
y1 | y coordinate of the screen point at one of the end points of the line
x2 | x coordinate of the screen point at another end point of the line
y2 | y coordinate of the screen point at another end point of the line

##### Returns

- the list of annotations at line (x1, y1, x2, y2).

#### public Annot[] getAnnotationsOnPage (int page_num)

Gets the list of annotations on a given page.

##### Parameters

page_num | The page number, where 1 is the first page.

##### Returns

- the list of annotations on a given page.

#### public int getBufferHeight ()

Get the width of the rendering buffer in pixels.

Note: this method is typically used only in PDFNet for C++

##### Returns

- the buffer height

#### public int getBufferStride ()

Get the stride of the rendering buffer in pixels.

Note: this method is typically used only in PDFNet for C++

##### Returns

- the buffer stride

#### public int getBufferWidth ()

Get the width of the rendering buffer in pixels.

Note: this method is typically used only in PDFNet for C++

##### Returns

- the buffer width

#### public double getCanvasHeight ()

Returns the height of the scrollable space.

#### public double getCanvasWidth ()

Returns the width of the scrollable space.

#### public int getColorPostProcessMode ()

##### Returns

- the current color post processing mode.

#### public int getCurrentPage ()

Get the current page.

##### Returns

- the current page displayed in the view.

#### public Matrix2D getDeviceTransform (int page_num)

Get the device transform matrix

##### Parameters

page_num | the page number for the page used as the origin of the destination coordinate system.

##### Returns

- the device transformation matrix. The device transformation matrix maps the page coordinate system to screen (or device) coordinate system.

#### public Matrix2D getDeviceTransform ()

Get the device transformation matrix

Note: to obtain a transformation matrix that maps screen coordinates to page coordinates, you can invert the device matrix. For example: `Common::Matrix2D scr2page(pdfview.GetDeviceTransform()); scr2page.Inverse();`

##### Returns

- the device transformation matrix. The device transformation matrix maps the page coordinate system to screen (or device) coordinate system.

#### public PDFDoc getDoc ()

Get the document.

##### Returns

- Currently associated document with this PDFViewCtrl.

#### public ExternalAnnotManager getExternalAnnotManager (String author_name)

Get the external annot manager belonging to this PDFViewCtrl

##### Throws

PDFNetException |

#### public ExternalAnnotManager getExternalAnnotManager (String author_name, int mode)

Get the external annot manager belonging to this PDFViewCtrl

##### Parameters

mode | one of the 3 e_AnnotMgr* modes

##### Throws

PDFNetException |

#### public int getH ()

#### public double getHScrollPos ()

##### Returns

- the current horizontal scroll position in scrollable space..

#### public int getHeight ()

#### public PDFViewCtrl.LinkInfo getLinkAt (int x, int y)

Gets the link info at a given point, specified in client space.

Note: To get valid links, `setUrlExtraction(boolean)` must be set to true before setting the document.

##### Parameters

x | the x position in client space
y | the y position in client space

##### Returns

- the `PDFViewCtrl.LinkInfo` object with the link information or null if no link is found in the queried location.

#### public String getNextRedoInfo ()

Returns any meta-data associated with the next state in the undo chain. Note: An empty string means redo is unavailable.

##### Returns

- Any meta-data associated with the next state in the undo chain.

##### Throws

PDFNetException |

#### public String getNextUndoInfo ()

Returns any meta-data associated with the previous state in the undo chain. Note: An empty string or "{\"label\":\"initial\"}" means that undo is unavailable.

##### Returns

- Any meta-data associated with the previous state in the undo chain.

##### Throws

PDFNetException |

#### public Context getOCGContext ()

Get the oCG context.

##### Returns

- the Optional Content Group (OCG) context associated with this PDFViewCtrl, or NULL (i.e. context.IsValid()==false) if there is no OCG context associated with the view. If an OCG context associated with the view, optional content (such as PDF layers) will be selectively rendered based on the states of optional content groups in the given context.

##### Throws

PDFNetException |

#### public int getPageCount ()

Get the page count.

##### Returns

- the total number of pages in the document.

#### public int getPageNumberFromScreenPt (double x, double y)

Get the page number from screen pt.

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point

##### Returns

- the number of the page located under the given screen coordinate. The positive number indicates a valid page, whereas number less than 1 means that no page was found.

#### public int getPagePresentationMode ()

Get the page presentation mode.

##### Returns

- the current page presentation mode.

#### public int getPageViewMode ()

Get the page view mode.

##### Returns

- the current page viewing mode

#### public Dimension getPreferredScrollableViewportSize ()

#### public Dimension getPreferredSize ()

#### public int getRotation ()

Get the rotation.

##### Returns

- The current rotation of this PDFViewCtrl.

##### Throws

PDFNetException |

#### public Rect getScreenRectForAnnot (Annot annot, int page_num)

Gets annotation bounding box in screen points

##### Parameters

annot | target annotation
page_num | the page where the annotation is on

##### Returns

- the rect in screen points

#### public int getScrollableBlockIncrement (Rectangle visibleRect, int orientation, int direction)

#### public boolean getScrollableTracksViewportHeight ()

#### public boolean getScrollableTracksViewportWidth ()

#### public int getScrollableUnitIncrement (Rectangle visibleRect, int orientation, int direction)

#### public PDFViewCtrl.Selection getSelection (int page)

Get the selection.

##### Parameters

page | the page

##### Returns

- Current text selection for a given page. If there is only selection on one page, then page number can be -1

#### public Dimension getSize (Dimension rv)

#### public void getThumbAsync (int page_num, ThumbAsyncHandler proc, Object data)

#### public int getToolMode ()

Get the tool mode.

##### Returns

- Current tool mode.

#### public int getV ()

#### public double getVScrollPos ()

##### Returns

- the current vertical scroll position in scrollable space..

#### public PDFViewScrollPane getViewPane ()

#### public int getWidth ()

#### public double getZoom ()

Get the current zoom factor.

##### Returns

- current zoom (or scaling) component used to display the page content.

#### public boolean gotoFirstPage ()

Set the current page to the first page in the document.

##### Returns

- true if successful, false otherwise.

#### public boolean gotoLastPage ()

Set the current page to the last page in the document.

##### Returns

- true if successful, false otherwise.

#### public boolean gotoNextPage ()

Set the current page to the next page in the document.

##### Returns

- true if successful, false otherwise.

#### public boolean gotoPreviousPage ()

Set the current page to the previous page in the document.

##### Returns

- true if successful, false otherwise.

#### public boolean hasChangesSinceSnapshot ()

Returns whether the document has been modified since the last undo/redo snapshot was taken.

##### Returns

- true if the document was modified since the last snapshot, false otherwise.

##### Throws

PDFNetException |

#### public boolean hasSelection ()

Checks for selection.

##### Returns

- return true if there is selection, false otherwise.

#### public void hideAnnotation (Annot annot)

Disable rendering of a particular annotation. This does not change the annotation itself, just how it is displayed in this viewer instance.

#### public void invalidateRect (Rect rect)

Invalidate rect.

##### Parameters

rect | the rect

#### public void invalidateRect ()

The InvalidateRect function adds a rectangle to the buffer/window update region. The update region represents the portion of the buffer/window's client area that must be redrawn

#### public boolean isFinishedRendering ()

##### Returns

- true is the rendering thread finished rendering the view, false if the rendering is still in progress.

#### public void onScroll (int pix_dx, int pix_dy)

Scrolls the contents of the rendering buffer 'pix_dx' horizontally and 'pix_dy' vertically.

##### Parameters

pix_dx | horizontal scroll offset, in pixels
pix_dy | vertical scroll offset, in pixels

#### public String redo ()

Go to the next state in the undo/redo chain. Returns any meta-data associated with that state.

##### Returns

- Any meta-data associated with the next state.

##### Throws

PDFNetException |

#### public void refreshAndUpdate (ViewChangeCollection view_change)

Helper function that will refresh annotation and/or field appearances if needed, and then render modified page areas, all based on the contents of the view_change parameter.

##### Parameters

view_change | contains all the updated fields and rectangles.

##### Throws

PDFNetException |

#### public void revertAllChanges ()

Returns to the initial state in the undo/redo chain.

##### Throws

PDFNetException |

#### public void revertChangesSinceSnapshot ()

Restores the document to the state of the last undo/redo snapshot, if it has been modified since.

##### Throws

PDFNetException |

#### public void rotateClockwise ()

Rotates all pages in the document 90 degrees clockwise.

#### public void rotateCounterClockwise ()

Rotates all pages in the document 90 degrees counter-clockwise.

#### public void scrollRectToVisible (Rectangle r)

#### public void selectAll ()

Selects all text on the page.

#### public boolean selectByHighlights (Highlights hlts)

Selects texts by Highlights.

##### Parameters

hlts | - the Highlights to be selected.

##### Returns

- true if some text was selected, false otherwise.

#### public boolean selectByRect (double x1, double y1, double x2, double y2)

Selects all words that intersect the given selection rectangle.

##### Parameters

x1 | the x1
y1 | the y1
x2 | the x2
y2 | the y2

##### Returns

- true if some text was selected, false otherwise.

#### public boolean selectBySelection (PDFViewCtrl.Selection sel)

Selects texts by PDFViewCtrl.Selection.

##### Parameters

sel | - the PDFViewCtrl.Selection to be selected.

##### Returns

- true if some text was selected, false otherwise.

#### public boolean selectByStruct (double x1, double y1, double x2, double y2)

Selects text taking into account page logical structure. This type of selection is similar to HTML like selection in web-browsers.

##### Parameters

x1 | the x1
y1 | the y1
x2 | the x2
y2 | the y2

##### Returns

- true if some text was selected, false otherwise.

#### public void setAntiAliasing (boolean enable_aa)

Enable or disable anti-aliasing. Anti-Aliasing is a technique used to improve the visual quality of images when displaying them on low resolution devices (for example, low DPI computer monitors).

Note: Anti-aliasing is enabled by default.

##### Parameters

enable_aa | the new anti aliasing

#### public void setBackground (Color c)

Set the default background color used to paint the area surrounding each page.

##### Parameters

c | the new background

#### public void setBackgroundColor (byte r, byte g, byte b)

Set the default background color used to paint the area surrounding each page.

##### Parameters

r | the r
g | the g
b | the b

#### public void setCaching (boolean enabled)

Enables or disables caching.

Note: by default caching is enabled

##### Parameters

enabled | if true caching is enabled, if false caching is disabled.

#### public void setColorPostProcessMode (int mode)

This method is deprecated.
use #setColorPostprocessMode()ColorPostprocessMode instead. Set the color post processing transformation. This transform is applied to the rasterized bitmap as the final step in the rasterization process, and is applied directly to the resulting bitmap (disregarding any color space information). Color post processing only supported for RGBA output.

##### Parameters

mode | is the specific transform to be applied

#### public void setColorPostProcessMode (PDFViewCtrl.ColorPostprocessMode mode)

Set the color post processing transformation. This transform is applied to the rasterized bitmap as the final step in the rasterization process, and is applied directly to the resulting bitmap (disregarding any color space information). Color post processing only supported for RGBA output.

##### Parameters

mode | is the specific transform to be applied

#### public boolean setCurrentPage (int page_num)

Set the current page to the given page.

##### Parameters

page_num | input page number

##### Returns

- true if successful, false otherwise.

#### public void setCurrentPageProc (CurrentPageProc curr_pagenum_proc, Object data)

Set the callback function (i.e. a delegate) that is called whenever current page number changes. This can be used to update the current page number within GUI applications etc.

##### Parameters

curr_pagenum_proc | Callback function (or a delegate in .NET).
data | Custom data to be passed as a second parameter to 'curr_pagenum_proc'.

#### public void setDefaultPageColor (byte r, byte g, byte b)

Set the default 'paper' color used to draw background of each page.

##### Parameters

r | the r
g | the g
b | the b

#### public void setDefaultPageColor (Color c)

Set the default 'paper' color used to draw background of each page.

##### Parameters

c | the new default page color

#### public void setDevicePixelDensity (double dpi, double scale_factor)

Set device DPI, and scale factor. This affects the rendering of certain content, such as annotations with the no_zoom flag.

##### Parameters

dpi | Scale relative to the internal DPI of 96 (default 1.0).
scale_factor | Some DPI sensitive content, sush as annotations, can be scaled up, to make the content larger, which can make user interaction easier (default 1.0).

#### public void setDoc (PDFDoc doc)

Associates this PDFViewCtrl with a given PDF document.

Note: Acquires a write lock on the document

##### Parameters

doc | A document to be displayed in the view.

#### public void setDrawAnnotations (boolean render_annots)

Enable or disable annotation and forms rendering. By default, all annotations and form fields are rendered.

##### Parameters

render_annots | True to draw annotations, false otherwise.

#### public void setErrorReportProc (ErrorReportProc error_proc, Object data)

Set the error report process

##### Parameters

error_proc | error process
data | custom data

#### public void setFieldHighlightColor (ColorPt cp)

Set the highlight color for fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`. Note that signature fields have their own highlight color, independent of this one (see `setSignatureHighlightColor`).

##### Parameters

cp | the new color, in rgba form.

#### public void setFindTextHandler (FindTextProc proc, Object data)

Set the callback function (i.e. a delegate) that is called when FindTextAsync is completed.

##### Parameters

proc | Callback function (or a delegate in .NET).
data | Custom data to be passed as a parameter to 'findtext_proc'.

#### public void setGamma (double exp)

Set the gamma factor used for anti-aliased rendering.

Note: Gamma correction is used only in the built-in rasterizer.

##### Parameters

exp | is the exponent value of gamma function. Typical values are in the range from 0.1 to 3. Gamma correction can be used to improve the quality of anti-aliased image output and can (to some extent) decrease the appearance common anti-aliasing artifacts (such as pixel width lines between polygons).

#### public void setH (int h)

#### public void setHScrollPos (double pos)

Sets the horizontal scroll position in the scrollable space..

##### Parameters

pos | the new horizontal scroll position. The position should be a number in the range between 0 and GetCanvasWidth().

#### public void setHighlightFields (boolean highlight_fields)

Enable or disable highlighting form fields. Default is disabled.

##### Parameters

highlight_fields | true to highlight, false otherwise.

#### public void setHorizontalAlign (int align)

Set the horizontal alignment used for rendering pages within the view.

##### Parameters

align | an integer specifying the horizontal alignment. Depending of whether align is positive, negative, or zero - pages will be right, left or center aligned: align < 0 -> pages are left aligned. align == 0 -> pages are centered. align > 0 -> pages are right aligned.

#### public void setImageSmoothing (boolean smoothing_enabled)

Set the image smoothing.

##### Parameters

smoothing_enabled | If true, image smoothing is enabled, otherwise it is disabled.

#### public void setImageSmoothing ()

Enable or disable image smoothing. The rasterizer allows a trade-off between rendering quality and rendering speed. This function can be used to indicate the preference between rendering speed and quality.

* Note: image smoothing option has effect only if the source image has higher resolution that the output resolution of the image on the rasterized page. PDFNet automatically controls at what resolution/zoom factor, 'image smoothing' needs to take effect.

* Note: image smoothing is enabled.

#### public void setOCGContext (Context ctx)

Set the Optional Content Group (OCG) context that should be used when viewing the document. This function can be used to change the current OCG context. Optional content (such as PDF layers) will be selectively rendered based on the states of optional content groups in the given context.

Note: Unlike PDFDraw.SetOCGContext() this method copies the given context. As a result, in order to modify the state of OCG groups in the curent context use GetOCGContext() to obtain the currently selected content and then modify states.

##### Parameters

ctx | Optional Content Group (OCG) context, or NULL if the rasterizer should render all content on the page.

##### Throws

PDFNetException |

#### public void setOverprint (int op)

Enable or disable support for overprint. Overprint is a device dependent feature and the results will vary depending on the output color space and supported colorants (i.e. CMYK, CMYK+spot, RGB, etc). By default overprint is enabled.

##### Parameters

op | 0: always disabled; 1: always enabled; 2: enabled for PDF/X files only. The default is 2.

##### Throws

PDFNetException |

#### public void setPageBorderVisibility (boolean border_visible)

Enables or disables drawing of a thin border around each page.

##### Parameters

border_visible | - if true, the border will be visible.

#### public void setPagePresentationMode (PDFViewCtrl.PagePresentationMode mode)

Set the current page presentation mode.

##### Parameters

mode | the new page presentation mode.

#### public void setPagePresentationMode (int mode)

This method is deprecated.
use `setPagePresentationMode(PagePresentationMode)` instead. Set the current page presentation mode.

##### Parameters

mode | the new page presentation mode.

#### public void setPageSpacing (int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad)

Set the vertical and horizontal padding and column spacing between adjacent pages in the view.

##### Parameters

horiz_col_space | the horiz_col_space
vert_col_space | the vert_col_space
horiz_pad | the horiz_pad
vert_pad | the vert_pad

#### public void setPageTransparencyGrid (boolean trans_grid_visible)

Enables or disables the transparency grid (check board pattern) to reflect page transparency.

##### Parameters

trans_grid_visible | - if true, the grid is turned on.

#### public void setPageViewMode (PDFViewCtrl.PageViewMode mode)

Set the page viewing mode.

Note: The default PageView mode is `FIT_WIDTH`.

##### Parameters

mode | the new page viewing mode.

#### public void setPageViewMode (int mode)

This method is deprecated.
use `setPageViewMode(PageViewMode)` instead. Set the page viewing mode.

Note: The default PageView mode is e_fit_width.

##### Parameters

mode | the new page viewing mode.

#### public void setPathHinting (boolean enable_ph)

Enable or disable path hinting. Path hinting is used to slightly adjust paths in order to avoid or alleviate artifacts of hair line cracks between certain graphical elements.

Note: Path hinting is enabled by default.

##### Parameters

enable_ph | whether to enable or disable path hinting

#### public void setPreferredSize (int width, int height)

Set the preferred size.

##### Parameters

width | the width
height | the height

#### public void setPreferredSize (Dimension d)

#### public void setProgressiveRendering (boolean is_progressive)

Enables or disables progressive rendering in PDFViewCtrl.

Note: Progressive rendering is useful when a PDF page contain lots of elements (e.g. many vector paths, text, or many little images). When progressive rendering is enabled PDFNet will use painter algorithm to draw the page. This way user may be able to see partially rendered page. If a page contains only a single large image, there would be no visible benefit from progressive rendering.

##### Parameters

is_progressive | if true, progressive rendering will be enabled, otherwise progressive rendering will be disabled.

#### public void setRasterizer (boolean builtin_rasterizer)

Set the core graphics library used for rasterization and rendering. Using this method it is possible to quickly switch between different implementations. By default, PDFNet uses a built-in, high-quality, and platform independent rasterizer.

##### Parameters

builtin_rasterizer | the new rasterizer

#### public void setRequestRenderInWorkerThreadProc (RequestRenderInWorkerThreadProc render_worker_proc, Object data)

Sets the RequestRenderInWorkerThread Callback

##### Parameters

render_worker_proc | RequestRenderInWorkerThread Callback
data | custom data

#### public void setRequiredFieldBorderColor (ColorPt cp)

Set the border color for required fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`.

##### Parameters

cp | the new color, in rgba form.

#### public void setSignatureHighlightColor (ColorPt cp)

Set the highlight color for signature fields This option only has an effect if field highlighting is turned on using `setHighlightFields(true)`. Note that non-signature fields have their own highlight color, independent of this one (see `setFieldHighlightColor`)

##### Parameters

cp | the new color, in rgba form.

#### public void setSnappingMode (int mode_flags)

Set the point snapping mode for the SnapToNearestInDoc method. By default SnapToNearestInDoc will snap to line endpoints, midpoints, and intersections.

#### public void setThinLineAdjustment (boolean pixel_grid_fit, boolean stroke_adjust)

Set thin line adjustment parameters.

##### Parameters

pixel_grid_fit | if true (horizontal/vertical) thin lines will be snapped to integer pixel positions. This helps make thin lines look sharper and clearer. This option is turned off by default and only works if path hinting is enabled.
stroke_adjust | if true auto stroke adjustment is enabled. Currently, this would make lines with sub-pixel width to be one-pixel wide. This option is turned on by default.

#### public void setToolMode (int mode)

Set the new tool mode (such as pan, text select, etc).

##### Parameters

mode | new tool mode.

#### public void setUrlExtraction (boolean enabled)

Enables or disables URL extraction.

##### Parameters

enabled | if true, URL extraction is enabled; if false URL extraction is disabled. * Note: by default URL extraction is disabled * Note: If set to enabled when the document is already opened, it may not find links on pages that were already rendered. It is suggested to set this flag before opening the document.

#### public void setV (int v)

#### public void setVScrollPos (double pos)

Sets the vertical scroll position in the scrollable space..

Note: In this context the canvas is defined in the screen coordinate system and is a rectangle that surrounds all pages in the current page layout.

##### Parameters

pos | the new vertical scroll position. The position should be a number in the range between 0 and GetCanvasheight().

#### public void setVerticalAlign (int align)

Set the vertical alignment used for rendering pages within the view.

##### Parameters

align | an integer specifying the horizontal alignment. Depending of whether align is positive, negative, or zero - pages will be right, left or center aligned: align < 0 -> pages are left aligned. align == 0 -> pages are centered. align > 0 -> pages are right aligned.

#### public static void setViewerCache (SDFDoc document, int max_cache_size, boolean on_disk)

Sets the cache parameters of the page cache on disk (which caches content streams and mipmapped images) for this specific document. These parameters will override the default cache parameters. Note that if this function is called after the document has been rasterized, it has no effect.

##### Parameters

max_cache_size | The maximum size, in bytes, of the entire document's page cache. Set to zero to disable the viewer cache.
on_disk | If set to 'true', cache will be stored on the local filesystem. If set to 'false', cache will be stored in heap memory.

##### Throws

PDFNetException |

#### public boolean setZoom (double zoom)

Set the zoom factor to a new value. The function zooms to a point at the center of the rendering buffer.

##### Parameters

zoom | new scaling component used to display the page content.

##### Returns

- true if successful, false otherwise.

#### public boolean setZoom (int x, int y, double zoom)

Set the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center. The zoom point (x,y) is represented in the screen coordinate system, which starts in the upper-left corner of the client window.

##### Parameters

x | the horizontal coordinate to zoom in.
y | the vertical coordinate to zoom in.
zoom | - new scaling component used to display the page content.

##### Returns

- true if successful, false otherwise.

#### public void setupThumbnails (boolean use_embedded, boolean generate_at_runtime, boolean use_disk_cache, int thumb_max_side_length, long max_abs_cache_size, double max_perc_cache_size)

Specify the different thumbnail settings for the viewer.

##### Parameters

use_embedded | Enables or disables using thumbnails embedded in the PDF document as a preview of the rendered page. (Currently ignored - future versions may take advantage of embedded thumbnails)
generate_at_runtime | Enables or disables generating thumbnails at runtime.
use_disk_cache | Enables or disables caching thumbnails in a temporary disk file.
thumb_max_side_length | The maximum size, in pixels, of a dimension of generated thumbnails.
max_abs_cache_size | The absolute maximum size on disk, in bytes, for the temporary thumbnail cache.
max_perc_cache_size | The maximum percentage of free disk space, in the range 0 - 1.0, that the cache can take up.

#### public void showAnnotation (Annot annot)

Enable rendering of a particular annotation. Only has an effect if HideAnnotation() has prviously been called on the same annot.

#### public boolean showRect (int page_num, Rect rect)

Changes the viewing area to fit a rectangle on specified page number. Rectangle must be specified in page coordinates. This will adjust current page and zoom appropriately.

##### Parameters

page_num | input page number
rect | the rectangle to fit in

##### Returns

- true if successful, false otherwise.

#### public boolean smartZoom (int x, int y)

Set the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center. The zoom point (x,y) is represented in the screen coordinate system, which starts in the upper-left corner of the client window.

##### Parameters

x | the horizontal coordinate to zoom in.
y | the vertical coordinate to zoom in.

##### Returns

- true if successful, false otherwise.

#### public Point2D.Double snapToNearestInDoc (double x, double y)

Returns the point within the document geometry that is closest to another arbtrary point in screen space

##### Parameters

x | x coordinate of the screen point
y | y coordinate of the screen point

##### Returns

- snapped point in screen space.

#### public void takeSnapshot (String meta_info)

Creates a new state at the top of the undo/redo chain by taking a snapshot.

##### Parameters

meta_info | Info to be attached to this particular undo state.

##### Throws

PDFNetException |

#### public String undo ()

Return to the previous state in the undo/redo chain. Returns any meta-data associated with that state.

##### Returns

- Any meta-data associated with the previous state.

##### Throws

PDFNetException |

#### public void update (Annot a, int num_page)

Redraws the area covered with a given annotation.

##### Parameters

a | the a
num_page | the num_page

#### public void update ()

Redraws the contents of the buffer.

#### public void update (Rect rec)

Redraws the given area in the buffer.

##### Parameters

rec | the rec

#### public void update (Field field)

Redraws all instances (Widgets) of the field.

##### Parameters

field | the field for which to update all occurances

#### public void update (Graphics g)

#### public void updatePageLayout ()

Updates the page layout within the view.