All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::PDFViewCtrl Class Reference

#include <PDFViewCtrl.h>

Classes

struct  AnnotationEditPermissionEvent
 
struct  EventHandlers
 
struct  KeyEvent
 
struct  MouseEvent
 
struct  PaintEvent
 
struct  SizeEvent
 
struct  TextFindDoneEvent
 
struct  WindowEvent
 

Public Types

enum  WindowID {
  e_main_view, e_thumb_view, e_layers_view, e_bookmark_view,
  e_navigation_pane, e_navigation_toolbar, e_toolbar, e_status_bar,
  e_dialog_modal, e_dialog_modeless
}
 
enum  ControlEventType {
  e_mouse_move, e_mouse_enter, e_mouse_leave, e_mouse_left_down,
  e_mouse_left_up, e_mouse_left_dclick, e_mouse_right_down, e_mouse_right_up,
  e_mouse_right_dclick, e_mouse_middle_down, e_mouse_middle_up, e_mouse_middle_dclick,
  e_mouse_wheel, e_context_menu, e_key_down, e_key_up,
  e_key_press, e_paint, e_window_open, e_window_close
}
 
enum  PageViewMode { e_fit_page = 0, e_fit_width, e_fit_height, e_zoom }
 
enum  PagePresentationMode {
  e_single_page = 1, e_single_continuous, e_facing, e_facing_continuous,
  e_facing_cover, e_facing_continuous_cover
}
 
enum  ToolMode {
  e_custom, e_pan, e_text_rect_select, e_text_struct_select,
  e_zoom_in, e_zoom_out, e_annot_edit, e_line_create,
  e_arrow_create, e_rect_create, e_oval_create, e_ink_create,
  e_text_annot_create, e_stamp_create, e_highlight_create, e_underline_create,
  e_strikeout_create, e_squiggly_create, e_text_box_create, e_calloutbox_create,
  e_polygon_create, e_polyline_create, e_file_attachment, e_sound_attachment,
  e_movie_attachment, e_caret_create, e_redaction_create, e_text_field_create,
  e_check_box_create, e_radio_button_create, e_list_box_create, e_combo_box_create,
  e_button_create, e_link_create, e_tool_mode_end
}
 
enum  TextSelectionMode { e_structural, e_rectangular, e_structural_algorithm_2 }
 
typedef UInt8(* MouseEventHandler )(struct MouseEvent *evt, void *custom_data)
 
typedef UInt8(* KeyEventHandler )(struct KeyEvent *evt, void *custom_data)
 
typedef UInt8(* PaintEventHandler )(struct PaintEvent *evt, void *custom_data)
 
typedef UInt8(* SizeEventHandler )(struct SizeEvent *evt, void *custom_data)
 
typedef UInt8(* WindowEventHandler )(struct WindowEvent *evt, void *custom_data)
 
typedef UInt8(* TextFindDoneHandler )(struct TextFindDoneEvent *evt, void *custom_data)
 
typedef UInt8(* AnnotationEditPermissionHandler )(struct AnnotationEditPermissionEvent *evt, void *custom_data)
 
typedef UInt8(* ActionHandler )(TRN_Action action, void *custom_data)
 
typedef void(* CurrentPageHandler )(int current_page, int num_pages, void *data)
 
typedef void(* CurrentZoomHandler )(double current_zoom, void *data)
 
typedef void(* ErrorReportHandler )(const char *message, void *data)
 
typedef UInt32 PanelType
 
typedef void(* ThumbAsyncHandler )(int page_num, bool was_thumb_found, const char *thumb_buf, int thumb_width, int thumb_height, void *custom_data)
 
typedef void(* RequestRenderInWorkerThreadProc )(void *custom_data)
 
typedef void(* FindTextAsyncHandler )(bool success, Selection &select, void *custom_data)
 

Public Member Functions

 PDFViewCtrl (void *parent_hwnd, void *hinstance, bool compatibility=false)
 
 ~PDFViewCtrl ()
 
bool SetDoc (PDFDoc &doc, const char *password=0)
 
void CloseDoc ()
 
PDFDocGetDoc ()
 
void DocLock (bool cancel_threads)
 
void DocUnlock ()
 
bool DocTryLock (int milliseconds=0)
 
void DocLockRead ()
 
void DocUnlockRead ()
 
bool DocTryLockRead (int milliseconds=0)
 
void SetCustomEventHandlers (EventHandlers *handlers)
 
void SetActionHandler (ActionHandler action_callback, void *custom_data)
 
void ExecuteAction (ActionParameter action_param)
 
void SetCurrentPageHandler (CurrentPageHandler curr_pagenum_proc, void *data)
 
void SetCurrentZoomHandler (CurrentZoomHandler curr_zoom_proc, void *data)
 
void SetErrorReportHandler (ErrorReportHandler error_proc, void *data)
 
void OnSize (int x, int y, int width, int height)
 
void Find ()
 
void Copy ()
 
void SelectAll ()
 
void SetProgressiveRendering (bool progressive=true)
 
void ShowNavPanel (bool show)
 
bool IsNavPanelVisible () const
 
void EnableScrollbar (bool show)
 
void ShowToolbar (bool show)
 
void ShowStatusBar (bool show)
 
void ShowNavToolbar (bool show)
 
void ShowMenuBar (bool show)
 
void EnableInteractiveForms (bool on)
 
void ShowDialogs (bool show)
 
void SetEnabledPanels (UInt32 panels)
 
UInt32 GetEnabledPanels () const
 
void SetSelectedPanel (PanelType panel)
 
PanelType GetSelectedPanel () const
 
void SetSplitPosition (int pos)
 
int GetSplitPosition () const
 
void Print ()
 
void Print (int first_page, int last_page, Page::Rotate rotation, int copies, const char *printer_name)
 
void Print (int first_page, int last_page, Page::Rotate rotation, int copies, const UString &printer_name)
 
void Refresh ()
 
void RequestRendering ()
 
void CaptureMouse ()
 
void ReleaseMouse ()
 
bool HasCapture () const
 
void EnableLinkActivation (bool enable)
 
void LoadCurrentConfiguration (const UString &path)
 
void SaveCurrentConfiguration (const UString &path, Common::ProgressMonitor *progress=0)
 
Annot GetDefaultAnnotation (const char *type)
 
void SetWindowBackgroundColor (WindowID winid, const ColorPt &color)
 
void SetFocus ()
 
void DocProperties ()
 
void DeletePages ()
 
void InsertPages (const UString &src_name)
 
void InsertBlankPages ()
 
void ReplacePages (const UString &src_name=UString())
 
void RotatePages ()
 
void ExtractPages ()
 
void CropPages ()
 
void AddWatermark ()
 
void SetPageViewMode (PageViewMode mode)
 
PageViewMode GetPageViewMode () const
 
void SetPagePresentationMode (PagePresentationMode mode)
 
PagePresentationMode GetPagePresentationMode () const
 
void SetColorPostProcessMode (PDFRasterizer::ColorPostProcessMode mode)
 
PDFRasterizer::ColorPostProcessMode GetColorPostProcessMode () const
 
int GetCurrentPage () const
 
int GetPageCount () const
 
std::vector< int > GetVisiblePages () const
 
bool GotoFirstPage ()
 
bool GotoLastPage ()
 
bool GotoNextPage ()
 
bool GotoPreviousPage ()
 
bool SetCurrentPage (int page_num)
 
bool ShowRect (int page_num, const Rect &rect)
 
double GetZoom () const
 
bool SetZoom (double zoom)
 
bool SetZoom (int x, int y, double zoom)
 
bool SmartZoom (int x, int y)
 
void RotateClockwise ()
 
void RotateCounterClockwise ()
 
Page::Rotate GetRotation () const
 
int GetPageNumberFromScreenPt (double x, double y) const
 
void ConvScreenPtToCanvasPt (double &x, double &y) const
 
void ConvCanvasPtToScreenPt (double &x, double &y) const
 
void ConvCanvasPtToPagePt (double &x, double &y, int page_num=-1) const
 
void ConvPagePtToCanvasPt (double &x, double &y, int page_num=-1) const
 
void ConvScreenPtToPagePt (double &x, double &y, int page_num=-1) const
 
void ConvPagePtToScreenPt (double &x, double &y, int page_num=-1) const
 
void SnapToNearestInDoc (double &screen_x, double &screen_y)
 
void SetSnappingMode (UInt32 mode_flags)
 
Common::Matrix2D GetDeviceTransform (int page_num=-1) const
 
double GetCanvasWidth () const
 
double GetCanvasHeight () const
 
double GetHScrollPos () const
 
double GetVScrollPos () const
 
void OnScroll (int pix_dx, int pix_dy)
 
void SetHScrollPos (double pos)
 
void SetVScrollPos (double pos)
 
bool IsFinishedRendering (bool visible_region_only) const
 
void CancelRendering ()
 
void Update (bool all=false)
 
void Update (const Rect &update)
 
void Update (const Annot &annot, int page_num)
 
void Update (const Field &field)
 
void UpdatePageLayout ()
 
int GetViewWidth () const
 
int GetViewHeight () const
 
void SetDrawAnnotations (bool render_annots)
 
void SetUrlExtraction (bool enabled)
 
LinkInfo GetLinkAt (int x, int y)
 
void SetHighlightFields (bool highlight_fields)
 
void SetAntiAliasing (bool enable_aa)
 
void SetPathHinting (bool enable_hinting)
 
void SetThinLineAdjustment (bool pixel_grid_fit, bool stroke_adjust)
 
void SetImageSmoothing (bool smoothing_enabled=true)
 
void SetCaching (bool enabled)
 
void SetRasterizerType (PDFRasterizer::Type type)
 
void SetGamma (double exp)
 
void SetOverprint (PDFRasterizer::OverprintPreviewMode op)
 
void SetOCGContext (const OCG::Context &ctx)
 
OCG::Context GetOCGContext ()
 
void SetToolMode (ToolMode mode)
 
ToolMode GetToolMode () const
 
void SetTextSelectionMode (TextSelectionMode tm)
 
bool Select (double x1, double y1, double x2, double y2)
 
bool SelectWithSnapping (double x1, double y1, double x2, double y2, bool snap_to_start, bool snap_to_end)
 
bool SelectWithSmartSnapping (double x1, double y1, double x2, double y2)
 
bool Select (double x1, double y1, int page1, double x2, double y2, int page2)
 
bool SelectWithSnapping (double x1, double y1, int page1, double x2, double y2, int page2, bool snap_to_start, bool snap_to_end)
 
bool SelectWithSmartSnapping (double x1, double y1, int page1, double x2, double y2, int page2)
 
bool Select (const Highlights &highlights)
 
bool Select (const Selection &select)
 
bool HasSelection () const
 
void ClearSelection ()
 
Selection GetSelection (int page=-1) const
 
int GetSelectionBeginPage () const
 
int GetSelectionEndPage () const
 
bool HasSelectionOnPage (int ipage) const
 
void PrepareWords (int page_num)
 
bool WereWordsPrepared (int page_num) const
 
bool IsThereTextInRect (double x1, double y1, double x2, double y2) const
 
void PrepareAnnotsForMouse (int page_num, double distance_threshold, double minimum_line_weight)
 
bool WereAnnotsForMousePrepared (int page_num) const
 
Annot::Type GetAnnotTypeUnder (double x, double y)
 
void SetPageBorderVisibility (bool border_visible)
 
void SetPageTransparencyGrid (bool trans_grid_visible)
 
void SetDefaultPageColor (UInt8 r, UInt8 g, UInt8 b)
 
void SetBackgroundColor (UInt8 r, UInt8 g, UInt8 b)
 
void SetHorizontalAlign (int align)
 
void SetVerticalAlign (int align)
 
void SetPageSpacing (int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad)
 
Rect GetScreenRectForAnnot (Annot annot, int page_num=-1)
 
Annot GetAnnotationAt (int x, int y)
 
void SetDownloadReportHandler (DownloadReportHandler download_proc, void *data)
 
void OpenURLAsync (const char *url, UString cache_pdf="", const char *password=0, const class HTTPRequestOptions *options=0)
 
void SetupThumbnails (bool use_embedded, bool generate_at_runtime, bool use_disk_cache, int thumb_max_side_length, size_t max_abs_cache_size, double max_perc_cache_size)
 
void ClearThumbCache ()
 
void GetThumbAsync (int page_num, ThumbAsyncHandler proc, void *custom_data)
 
void CancelAllThumbRequests ()
 
void SetRequestRenderInWorkerThreadProc (RequestRenderInWorkerThreadProc proc, void *custom_data)
 
void SetFindTextHandler (FindTextAsyncHandler proc, void *custom_data)
 
void FindTextAsync (const UString &search_str, bool match_case, bool match_whole_word, bool search_up, bool reg_exp)
 

Static Public Attributes

static const UInt32 e_none =0x00
 
static const UInt32 e_bookmarks =0x01
 
static const UInt32 e_layers =0x02
 
static const UInt32 e_thumbview =0x04
 
static const UInt32 e_all =0x07
 

Detailed Description

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).

Unlike PDFView, PDFViewCtrl is a control that implements a number of tool modes, dialog boxes like find and password, has some built-in form filling capabilities and a navigation panel for bookmarks, thumbview and layer views.

PDFViewCtrl 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 e_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.

Definition at line 65 of file PDFViewCtrl.h.

Member Typedef Documentation

typedef UInt8(* pdftron::PDF::PDFViewCtrl::ActionHandler)(TRN_Action action, void *custom_data)

a callback function that gets executed when something triggers a PDF action in the document. The parameter action can be converted to Action object via Action( (SDF::Obj*)action ). If this function returns true, PDFViewCtrl will not try to execute the action internally.

Definition at line 354 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::AnnotationEditPermissionHandler)(struct AnnotationEditPermissionEvent *evt, void *custom_data)

Definition at line 305 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::CurrentPageHandler)(int current_page, int num_pages, void *data)

A prototype for a callback function (or a delegate in .NET terminology) that will be called whenever current page number changes.

Parameters
current_pagethe current page.
num_pagestotal number of pages in the document.
dataCustom data to be passed as a second parameter to 'curr_pagenum_proc'.

Definition at line 377 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::CurrentZoomHandler)(double current_zoom, void *data)

A prototype for a callback function (or a delegate in .NET terminology) that will be called whenever current zoom (magnification) number changes.

Parameters
current_zoomthe current zoom.
dataCustom data to be passed as a second parameter to 'curr_zoom_proc'.

Definition at line 396 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::ErrorReportHandler)(const char *message, void *data)

Definition at line 408 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::FindTextAsyncHandler)(bool success, Selection &select, void *custom_data)

FindTextAsync Handling A type of callback function (or a delegate in .NET terminology) that is called once FindTextAsync is completed.

Definition at line 1740 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::KeyEventHandler)(struct KeyEvent *evt, void *custom_data)

Definition at line 300 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::MouseEventHandler)(struct MouseEvent *evt, void *custom_data)

Definition at line 299 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::PaintEventHandler)(struct PaintEvent *evt, void *custom_data)

Definition at line 301 of file PDFViewCtrl.h.

Definition at line 519 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::RequestRenderInWorkerThreadProc)(void *custom_data)

A type of callback function that is called from a secondary thread to issue a rendering request on the UI thread.

Definition at line 1710 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::SizeEventHandler)(struct SizeEvent *evt, void *custom_data)

Definition at line 302 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::TextFindDoneHandler)(struct TextFindDoneEvent *evt, void *custom_data)

Definition at line 304 of file PDFViewCtrl.h.

typedef void(* pdftron::PDF::PDFViewCtrl::ThumbAsyncHandler)(int page_num, bool was_thumb_found, const char *thumb_buf, int thumb_width, int thumb_height, void *custom_data)

Declaration for the callback function that will be called after GetThumbAsync retrieves a thumbnail from the on-disk thumbnail cache.

Parameters
page_numThe page number of the thumbnail.
was_thumb_foundA boolean value which is true if the thumbnail could be retrieved from the persistent cache, and false otherwise.
thumb_bufA pointer to the thumbnail image. This buffer's size, in bytes, is equal to thumb_width * thumb_height * 4.
thumb_widthThe width, in pixels, of the thumbnail image.
thumb_heightThe height, in pixels, of the thumbnail image.
custom_dataCustom data passed into GetThumbAsync.

Definition at line 1687 of file PDFViewCtrl.h.

typedef UInt8(* pdftron::PDF::PDFViewCtrl::WindowEventHandler)(struct WindowEvent *evt, void *custom_data)

Definition at line 303 of file PDFViewCtrl.h.

Member Enumeration Documentation

Enumerator
e_mouse_move 
e_mouse_enter 
e_mouse_leave 
e_mouse_left_down 
e_mouse_left_up 
e_mouse_left_dclick 
e_mouse_right_down 
e_mouse_right_up 
e_mouse_right_dclick 
e_mouse_middle_down 
e_mouse_middle_up 
e_mouse_middle_dclick 
e_mouse_wheel 
e_context_menu 
e_key_down 
e_key_up 
e_key_press 
e_paint 
e_window_open 
e_window_close 

Definition at line 163 of file PDFViewCtrl.h.

PagePresentationMode lists common modes of presenting PDF pages.

Enumerator
e_single_page 
e_single_continuous 
e_facing 
e_facing_continuous 
e_facing_cover 
e_facing_continuous_cover 

Definition at line 772 of file PDFViewCtrl.h.

methods below are shared with the interface of PDFView class PageViewMode lists common modes of viewing PDF pages. PDFViewCtrl currently supports the following viewing modes:

  • e_fit_page - page zoom is automatically adjusted so that entire page fits into available space.
  • e_fit_width - page zoom is automatically adjusted so that page width fits into available space.
  • e_fit_height - page zoom is automatically adjusted so that page height fits into available space.
  • e_zoom - page is zoomed. The zoom factor is specified using SetZoom() function.
Enumerator
e_fit_page 
e_fit_width 
e_fit_height 
e_zoom 

Definition at line 748 of file PDFViewCtrl.h.

TextSelectionMode lists different text selection modes that can be used to highlight text. PDFView currently supports the following text selection modes:

  • e_structural - Selects text based on the logical structure of the page. This type of selection is similar to HTML like selection in web-browsers.
  • e_rectangular - Selects all words that intersect the given selection rectangle.
  • e_structural_algorithm_2 - Similar to e_structural but use different algorithm when the start point is not inside a block (not being too smart).
Enumerator
e_structural 
e_rectangular 
e_structural_algorithm_2 

Definition at line 1382 of file PDFViewCtrl.h.

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

Enumerator
e_custom 
e_pan 
e_text_rect_select 
e_text_struct_select 
e_zoom_in 
e_zoom_out 
e_annot_edit 
e_line_create 
e_arrow_create 
e_rect_create 
e_oval_create 
e_ink_create 
e_text_annot_create 
e_stamp_create 
e_highlight_create 
e_underline_create 
e_strikeout_create 
e_squiggly_create 
e_text_box_create 
e_calloutbox_create 
e_polygon_create 
e_polyline_create 
e_file_attachment 
e_sound_attachment 
e_movie_attachment 
e_caret_create 
e_redaction_create 
e_text_field_create 
e_check_box_create 
e_radio_button_create 
e_list_box_create 
e_combo_box_create 
e_button_create 
e_link_create 
e_tool_mode_end 

Definition at line 1325 of file PDFViewCtrl.h.

Enumeration used to indicate the sub-window that triggered an event. Can be checked by clients when they are receiving event callbacks from PDFViewCtrl.

Enumerator
e_main_view 
e_thumb_view 
e_layers_view 
e_bookmark_view 
e_navigation_pane 
e_navigation_toolbar 
e_toolbar 
e_status_bar 
e_dialog_modal 
e_dialog_modeless 

Definition at line 150 of file PDFViewCtrl.h.

Constructor & Destructor Documentation

pdftron::PDF::PDFViewCtrl::PDFViewCtrl ( void *  parent_hwnd,
void *  hinstance,
bool  compatibility = false 
)

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

Parameters
parent_hwndthe platform specific window handle
hinstanceon windows the current HINSTANCE
compatibilityindicates if PDFViewCtrl is compatible with v.5.7.0 and older. The default value is false. PDFViewCtrl shipped with PDFNet v.5.8.0 has enhanced features for better viewing experience, including pre-rendering invisible regions.
pdftron::PDF::PDFViewCtrl::~PDFViewCtrl ( )

Member Function Documentation

void pdftron::PDF::PDFViewCtrl::AddWatermark ( )

create AddWatermarkDialog where user can define a watermark and stamp it to a document.

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::CancelAllThumbRequests ( )
void pdftron::PDF::PDFViewCtrl::CancelRendering ( )

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

void pdftron::PDF::PDFViewCtrl::CaptureMouse ( )

Directs all mouse input to this window. Call ReleaseMouse to release the capture.

void pdftron::PDF::PDFViewCtrl::ClearSelection ( )

Remove any text selection.

void pdftron::PDF::PDFViewCtrl::ClearThumbCache ( )

Remove all thumbnails from the persistent disk cache.

void pdftron::PDF::PDFViewCtrl::CloseDoc ( )

Closes the document currently opened in PDFViewCtrl.

Note
Acquires a write lock on the document
void pdftron::PDF::PDFViewCtrl::ConvCanvasPtToPagePt ( double &  x,
double &  y,
int  page_num = -1 
) const

Converts a point expressed in canvas space to a point in a page space.

Parameters
page_numthe page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one.
void pdftron::PDF::PDFViewCtrl::ConvCanvasPtToScreenPt ( double &  x,
double &  y 
) const

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

void pdftron::PDF::PDFViewCtrl::ConvPagePtToCanvasPt ( double &  x,
double &  y,
int  page_num = -1 
) const

Converts a point from a page space to a point in canvas space.

Parameters
page_numthe page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one.
void pdftron::PDF::PDFViewCtrl::ConvPagePtToScreenPt ( double &  x,
double &  y,
int  page_num = -1 
) const

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

Parameters
page_numthe page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one.
void pdftron::PDF::PDFViewCtrl::ConvScreenPtToCanvasPt ( double &  x,
double &  y 
) const

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

void pdftron::PDF::PDFViewCtrl::ConvScreenPtToPagePt ( double &  x,
double &  y,
int  page_num = -1 
) const

Converts a point expressed in screen space to a point on a page space.

Parameters
page_numthe page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one.
void pdftron::PDF::PDFViewCtrl::Copy ( )

Copies the current selection in this control.

void pdftron::PDF::PDFViewCtrl::CropPages ( )

create CropPagesDialog where the user can specify a cropping for any of the boxes in a PDF Page. The user can apply the cropping to any set of pages.

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::DeletePages ( )

create DeletePagesDialog to prompt user for pages in the current PDF document to delete.

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::DocLock ( bool  cancel_threads)

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

void pdftron::PDF::PDFViewCtrl::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.

void pdftron::PDF::PDFViewCtrl::DocProperties ( )

create Document Properties dialog

Note
Can acquire a write lock on the document.
bool pdftron::PDF::PDFViewCtrl::DocTryLock ( int  milliseconds = 0)

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.
bool pdftron::PDF::PDFViewCtrl::DocTryLockRead ( int  milliseconds = 0)

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.
void pdftron::PDF::PDFViewCtrl::DocUnlock ( )

Releases the write lock from the currently open document.

void pdftron::PDF::PDFViewCtrl::DocUnlockRead ( )

Releases the read lock from the currently open document.

void pdftron::PDF::PDFViewCtrl::EnableInteractiveForms ( bool  on)

Enables or disables interactive form editing

Parameters
onif true interactive forms will be enabled
void pdftron::PDF::PDFViewCtrl::EnableLinkActivation ( bool  enable)

Enables or disables whether links are activated when the user clicks on them

Parameters
enableif true enable link activation, otherwise disable it
void pdftron::PDF::PDFViewCtrl::EnableScrollbar ( bool  show)

Enables or disables the scrollbar in the viewing area.

Parameters
showif true the scrollbar will be enabled.
void pdftron::PDF::PDFViewCtrl::ExecuteAction ( ActionParameter  action_param)

Requests action object to be executed by PDFViewCtrl. Action must belong to the document currently displayed in PDFViewCtrl.

Parameters
actionobject that is to be executed.
void pdftron::PDF::PDFViewCtrl::ExtractPages ( )

create ExtractPagesDialog to prompt user to extract n pages from the PDF and save it to a new file

void pdftron::PDF::PDFViewCtrl::Find ( )

Creates and displays a find dialog so the user can search through the text in the control

void pdftron::PDF::PDFViewCtrl::FindTextAsync ( const UString search_str,
bool  match_case,
bool  match_whole_word,
bool  search_up,
bool  reg_exp 
)

Searches for the provided search string in the documents in a secondary thread, and calls FindTextAsyncHandler with the resulting selection.

Parameters
search_strThe string to match
match_caseSet to true for case-sensitive search.
match_whole_wordSet to true to match whole words only
search_upSet to true to search up through the document
reg_expSet to true to interpret search_str as regular expression
Annot pdftron::PDF::PDFViewCtrl::GetAnnotationAt ( int  x,
int  y 
)

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

Parameters
xx coordinate of the screen point
yy coordinate of the screen point
Returns
the annotation at (x, y). If there is no annotation at (x, y), the returned annotation's IsValid method will return false.
Annot::Type pdftron::PDF::PDFViewCtrl::GetAnnotTypeUnder ( double  x,
double  y 
)
Returns
annotation type at the given point
Parameters
x- x coordinate of the input point
y- y coordinate in the input point
double pdftron::PDF::PDFViewCtrl::GetCanvasHeight ( ) const

Returns the current height of the scrollable space.

double pdftron::PDF::PDFViewCtrl::GetCanvasWidth ( ) const

Returns the current width of the scrollable space.

PDFRasterizer::ColorPostProcessMode pdftron::PDF::PDFViewCtrl::GetColorPostProcessMode ( ) const
Returns
the current color post processing mode.
int pdftron::PDF::PDFViewCtrl::GetCurrentPage ( ) const
Returns
the current page displayed in the view.
Annot pdftron::PDF::PDFViewCtrl::GetDefaultAnnotation ( const char *  type)

Retrieve the annotation which stores the default properties for a given type. User can change these default settings by operating on this annotation.

Parameters
thekey, or identifier, of the annotation type for which the default is required. Usually this is the same as the value of 'Subtype' entry in the annotation's dictionary, allowing to easily get default annotation for given type. PDFNet is also using the following non-standard names annotation types which have more than associated creation tool: 'Arrow' to store the properties of the Line annotation drawn as an arrow; 'FreeTextCallout' to store the properties of the FreeText annotation drawn as a callout box.
Common::Matrix2D pdftron::PDF::PDFViewCtrl::GetDeviceTransform ( int  page_num = -1) const
Returns
the device transformation matrix. The device transformation matrix maps the page coordinate system to screen (or device) coordinate system.
Parameters
page_numsame as for PDFViewCtrl.Conv???() methods.
Note
to obtain a transformation matrix that maps screen coordinates to page coordinates, you can invert the device matrix. For example:
* Common::Matrix2D scr2page(pdfviewctrl.GetDeviceTransform());
* scr2page.Inverse();
*
PDFDoc* pdftron::PDF::PDFViewCtrl::GetDoc ( )
Returns
Currently associated document with this PDFViewCtrl.
UInt32 pdftron::PDF::PDFViewCtrl::GetEnabledPanels ( ) const

Returns which panels are enabled in the navigation panel

Returns
A bit field composed of an OR of PDFViewCtrl::PanelType values. which describes which panels are currently enabled in the navigation panel.
double pdftron::PDF::PDFViewCtrl::GetHScrollPos ( ) const
Returns
the current horizontal scroll position of the scrollable space.
LinkInfo pdftron::PDF::PDFViewCtrl::GetLinkAt ( int  x,
int  y 
)

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

Parameters
xthe x position in client space
ythe y position in client space
Returns
the LinkInfo object with the link information or null if no link is found in the queried location.
Note
To get valid links, SetUrlExtraction(boolean) must be set to true before opening the document.
OCG::Context pdftron::PDF::PDFViewCtrl::GetOCGContext ( )
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.
int pdftron::PDF::PDFViewCtrl::GetPageCount ( ) const
Returns
the total number of pages in the document.
int pdftron::PDF::PDFViewCtrl::GetPageNumberFromScreenPt ( double  x,
double  y 
) const
Returns
the number of the page in the screen space. The positive number indicates a valid page, whereas number less than 1 means that no page was found.
PagePresentationMode pdftron::PDF::PDFViewCtrl::GetPagePresentationMode ( ) const
Returns
the current page presentation mode.
PageViewMode pdftron::PDF::PDFViewCtrl::GetPageViewMode ( ) const
Returns
the current page viewing mode
Page::Rotate pdftron::PDF::PDFViewCtrl::GetRotation ( ) const
Returns
The current rotation of this PDFViewCtrl.
Rect pdftron::PDF::PDFViewCtrl::GetScreenRectForAnnot ( Annot  annot,
int  page_num = -1 
)

Gets the annotation bounding box in screen coordinates

Parameters
annotthe target annotation
page_numthe page where the annotation is on
Returns
the bounding box of the annotation in screen coordinates
PanelType pdftron::PDF::PDFViewCtrl::GetSelectedPanel ( ) const

Returns the currently selected panel in the navigation panel

Returns
the currently selected panel type
Selection pdftron::PDF::PDFViewCtrl::GetSelection ( int  page = -1) const
Returns
Current text selection for a given page. If there is only selection on one page, then page number does not need to be provided.
int pdftron::PDF::PDFViewCtrl::GetSelectionBeginPage ( ) const
Returns
the first page number that has text selection on it. Useful when there are selections on multiple pages at the same time.
int pdftron::PDF::PDFViewCtrl::GetSelectionEndPage ( ) const
Returns
the last page number that has text selection on it. Useful when there are selections on multiple pages at the same time.
int pdftron::PDF::PDFViewCtrl::GetSplitPosition ( ) const

Returns the current horizontal size of the navigation panel

Returns
the horizontal size of the navigation panel
void pdftron::PDF::PDFViewCtrl::GetThumbAsync ( int  page_num,
ThumbAsyncHandler  proc,
void *  custom_data 
)

Retrieves the specified thumbnail from the persistent thumbnail cache on disk, then calling proc on the resulting thumbnail.

Parameters
page_numThe page number of the thumbnail.
procA callback function that will be called after the thumbnail is retrieved, or if that retrieval fails.
dataCustom data to be passed as a parameter to 'proc'.
ToolMode pdftron::PDF::PDFViewCtrl::GetToolMode ( ) const
Returns
Current tool mode.
int pdftron::PDF::PDFViewCtrl::GetViewHeight ( ) const

Returns the width of the main view in pixels.

Note
this method is typically used only in PDFNet for C++
int pdftron::PDF::PDFViewCtrl::GetViewWidth ( ) const

Returns the width of the main view in pixels.

Note
this method is typically used only in PDFNet for C++
std::vector<int> pdftron::PDF::PDFViewCtrl::GetVisiblePages ( ) const

Get a vector with the pages currently visible on the screen.

Returns
a vector of the pages currently visible on the screen.
double pdftron::PDF::PDFViewCtrl::GetVScrollPos ( ) const
Returns
the current vertical scroll position of the scrollable space.
double pdftron::PDF::PDFViewCtrl::GetZoom ( ) const

Returns the current zoom factor.

Returns
current zoom (or scaling) component used to display the page content.
bool pdftron::PDF::PDFViewCtrl::GotoFirstPage ( )

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

Returns
true if successful, false otherwise.
bool pdftron::PDF::PDFViewCtrl::GotoLastPage ( )

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

Returns
true if successful, false otherwise.
bool pdftron::PDF::PDFViewCtrl::GotoNextPage ( )

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

Returns
true if successful, false otherwise.
bool pdftron::PDF::PDFViewCtrl::GotoPreviousPage ( )

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

Returns
true if successful, false otherwise.
bool pdftron::PDF::PDFViewCtrl::HasCapture ( ) const

Returns true if this window has the current mouse capture

bool pdftron::PDF::PDFViewCtrl::HasSelection ( ) const
Returns
return true if there is selection, false otherwise.
bool pdftron::PDF::PDFViewCtrl::HasSelectionOnPage ( int  ipage) const
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.
void pdftron::PDF::PDFViewCtrl::InsertBlankPages ( )

create InsertBlankPagesDialog to prompt user for size and number of blank pages to insert.

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::InsertPages ( const UString src_name)

create InsertPagesDialog to prompt user for page number from another PDF document to insert.

Note
Can acquire a write lock on the document.
bool pdftron::PDF::PDFViewCtrl::IsFinishedRendering ( bool  visible_region_only) const
Returns
true if the rendering thread has finished or the current visible region has been fully rendered.
Parameters
visible_region_onlyThe control might pre-render invisible regions if the compatibility parameter is set to false when its constructor is called. In this case, the rendering thread might still be ongoing even if the current visible region has been rendered. If visible_region_only parameter is set to true, this function only checks if the visible region has been rendered, regardless if the rendering thread is ongoing. If compatibility parameter is set to true when its constructor is called, this parameter takes no effect.
bool pdftron::PDF::PDFViewCtrl::IsNavPanelVisible ( ) const

return true if the navigation panel is enabled

bool pdftron::PDF::PDFViewCtrl::IsThereTextInRect ( double  x1,
double  y1,
double  x2,
double  y2 
) const
Returns
true if there is a text in the given rectangle, false otherwise and point (x2, y2) is the end selection point. The points are defined in screen space.
void pdftron::PDF::PDFViewCtrl::LoadCurrentConfiguration ( const UString path)

Load the current configuration of PDFViewCtrl from a file.

Parameters
nameof the file from which the settings are loaded. If it is an empty string, default location is chosen by PDFViewCtrl.
void pdftron::PDF::PDFViewCtrl::OnScroll ( int  pix_dx,
int  pix_dy 
)

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

Parameters
pix_dxhorizontal scroll offset, in pixels
pix_dyvertical scroll offset, in pixels
void pdftron::PDF::PDFViewCtrl::OnSize ( int  x,
int  y,
int  width,
int  height 
)

Sets new position and size for the control

Parameters
x- The x position of the control within its parent
y- The y position of the control within its parent
width- The width of the target image in pixels.
height- The height of the target image in pixels (the number of rows).
Note
this method is typically used only in PDFNet for C++
void pdftron::PDF::PDFViewCtrl::OpenURLAsync ( const char *  url,
UString  cache_pdf = "",
const char *  password = 0,
const class HTTPRequestOptions options = 0 
)

Asynchronously open a PDF file at the given url. The PDFDoc that is downloaded is owned by this object and will be deallocated when this object is done with the doc. This works best with PDF's that are linearized, as pages can be downloaded and viewed in random access order, without the need to download the entire document. A viewing session can also be persisted across multiple viewing/application sessions to remove redundant downloads and improve overall performance by using the optional cache_pdf parameter.

Note
Use SetDownloadReportHandler to track the download progress.
Parameters
urlthe url to open
cache_pdfThis function will use downloaded data to construct a PDF in this location. If null or blank, the PDF will be stored in a temporary location. If the path points to the result of a previous call to this function for this particular URL, then PDFViewCtrl will resume that download. Note that if disk caching is disabled this file will not be used.
passwordThe PDF password to use to open the PDF.
optionsOptional HTTP request options to use with every HTTP request.
void pdftron::PDF::PDFViewCtrl::PrepareAnnotsForMouse ( int  page_num,
double  distance_threshold,
double  minimum_line_weight 
)

Requests for preparing annotations of the given page. Note: Annotations are going to be prepared asynchronously

Parameters
page_num- page number
distance_threshold- Maximum distance from the point (x, y) to the annotation for the annot to be considered a hit.
minimum_line_weight- 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
void pdftron::PDF::PDFViewCtrl::PrepareWords ( int  page_num)

Requests for preparing words of the given page. Note: Words are going to be prepared asynchronously

Parameters
page_num- page number
void pdftron::PDF::PDFViewCtrl::Print ( )

Displays a print dialog to receive information from the user and prints the document.

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::Print ( int  first_page,
int  last_page,
Page::Rotate  rotation,
int  copies,
const char *  printer_name 
)

Programatically prints the document without any dialogs.

Parameters
first_pagethe first page to print
last_pagethe last page to print
rotationthe print rotation which can allow the user to specify landscape mode
copiesthe number of copies to print
printer_namethe name of the printer to use
Note
Acquires a write lock on the document
void pdftron::PDF::PDFViewCtrl::Print ( int  first_page,
int  last_page,
Page::Rotate  rotation,
int  copies,
const UString printer_name 
)

Programatically prints the document without any dialogs

Parameters
first_pagethe first page to print
last_pagethe last page to print
rotationthe print rotation which can allow the user to specify landscape mode
copiesthe number of copies to print
printer_namethe name of the printer to use
Note
Acquires a write lock on the document
void pdftron::PDF::PDFViewCtrl::Refresh ( )

Causes this window to be repainted.

void pdftron::PDF::PDFViewCtrl::ReleaseMouse ( )

Releases mouse input captured with CaptureMouse()

void pdftron::PDF::PDFViewCtrl::ReplacePages ( const UString src_name = UString())

create ReplacePagesDialog to prompt user for page number from another PDF document to replace pages from current PDF document

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::RequestRendering ( )

Requests that PDFViewCtrl start rendering, if necessary.

Note
Refresh() simply causes the window to be repainted at the system level. It does not make PDFViewCtrl to render anything new. RequestRendering() tells PDFViewCtrl to check if there are regions (both visible and invisible) that have not been rendered; if so a background rendering thread will be started. This function should be called if CancelRendering() was called to stop the ongoing rendering thread. Update() tells PDFViewCtrl to discard the rendered content and start a rendering thread. This function should be used if the content of the PDF is modified.
void pdftron::PDF::PDFViewCtrl::RotateClockwise ( )

Rotates all pages in the document 90 degrees clockwise.

void pdftron::PDF::PDFViewCtrl::RotateCounterClockwise ( )

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

void pdftron::PDF::PDFViewCtrl::RotatePages ( )

create RotatePagesDialog to prompt user to rotate n pages at a specified rotation

Note
Can acquire a write lock on the document.
void pdftron::PDF::PDFViewCtrl::SaveCurrentConfiguration ( const UString path,
Common::ProgressMonitor *  progress = 0 
)

Save the current configuration of PDFViewCtrl to a file.

Parameters
nameof the file to which the settings are saved. If it is an empty string, default location is chosen by PDFViewCtrl.
bool pdftron::PDF::PDFViewCtrl::Select ( double  x1,
double  y1,
double  x2,
double  y2 
)

Selects text within the given region using the current text selection mode.

Returns
true if some text was selected, false otherwise.
Parameters
x1,y1,x2,y2- two points (screen coordinates, origin located at the upper-left corner of this view) defining the opposite corners of a selection rectangle.
bool pdftron::PDF::PDFViewCtrl::Select ( double  x1,
double  y1,
int  page1,
double  x2,
double  y2,
int  page2 
)

Selects texts using structural mode.

Returns
true if some texts were selected, false otherwise.
Parameters
(x1,y1),page1- the first selection point (in page coordinates space) on page page1
(x2,y2),page2- the second selection point (in page coordinates space) on page page2
bool pdftron::PDF::PDFViewCtrl::Select ( const Highlights highlights)

Selects texts identified by Highlights.

Returns
true if some texts were selected, false otherwise.
Parameters
highlights- an instance of Highlights class.
bool pdftron::PDF::PDFViewCtrl::Select ( const Selection select)

Selects a region according to a PDFView::Selection object

Returns
true if some texts were selected, false otherwise.
Parameters
select- an instance of the Selection class
void pdftron::PDF::PDFViewCtrl::SelectAll ( )

Selects all text on the page.

bool pdftron::PDF::PDFViewCtrl::SelectWithSmartSnapping ( double  x1,
double  y1,
double  x2,
double  y2 
)

Selects text within the given region using the current text selection mode with smart snap-to-start and snap-to-end modes.

Returns
true if some text was selected, false otherwise.
Parameters
x1,y1,x2,y2- two points (screen coordinates, origin located at the upper-left corner of this view) defining the opposite corners of a selection rectangle.
bool pdftron::PDF::PDFViewCtrl::SelectWithSmartSnapping ( double  x1,
double  y1,
int  page1,
double  x2,
double  y2,
int  page2 
)

Selects texts using structural mode with smart snap-to-start and snap-to-end modes.

Returns
true if some texts were selected, false otherwise.
Parameters
(x1,y1),page1- the first selection point (in page coordinates space) on page page1
(x2,y2),page2- the second selection point (in page coordinates space) on page page2
bool pdftron::PDF::PDFViewCtrl::SelectWithSnapping ( double  x1,
double  y1,
double  x2,
double  y2,
bool  snap_to_start,
bool  snap_to_end 
)

Selects text within the given region using the current text selection mode with defined snap-to-start and snap-to-end modes.

Returns
true if some text was selected, false otherwise.
Parameters
x1,y1,x2,y2- two points (screen coordinates, origin located at the upper-left corner of this view) defining the opposite corners of a selection rectangle.
snap_to_start,snap-to-end,:if selected text should contain the whole word at start/end of selection points.
bool pdftron::PDF::PDFViewCtrl::SelectWithSnapping ( double  x1,
double  y1,
int  page1,
double  x2,
double  y2,
int  page2,
bool  snap_to_start,
bool  snap_to_end 
)

Selects texts using structural mode with defined snap-to-start and snap-to-end modes.

Returns
true if some texts were selected, false otherwise.
Parameters
(x1,y1),page1- the first selection point (in page coordinates space) on page page1
(x2,y2),page2- the second selection point (in page coordinates space) on page page2
snap_to_start,snap-to-end,:if selected text should contain the whole word at start/end of selection points
void pdftron::PDF::PDFViewCtrl::SetActionHandler ( ActionHandler  action_callback,
void *  custom_data 
)

Sets the handler function to be called on PDF action execution

Parameters
afunction pointer to the callback
void pdftron::PDF::PDFViewCtrl::SetAntiAliasing ( bool  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).

Anti-aliasing is enabled by default.

void pdftron::PDF::PDFViewCtrl::SetBackgroundColor ( UInt8  r,
UInt8  g,
UInt8  b 
)

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

Parameters
r,g,b- RGB color specifying the default background color.
void pdftron::PDF::PDFViewCtrl::SetCaching ( bool  enabled)

Enables of disables caching of images, fonts, and other resources. Disabling caching can lower memory requirements at the expense of rendering speed.

Parameters
enabledif true caching is enabled, if false caching is disabled. by default caching is enabled
void pdftron::PDF::PDFViewCtrl::SetColorPostProcessMode ( PDFRasterizer::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
modeis the specific transform to be applied
bool pdftron::PDF::PDFViewCtrl::SetCurrentPage ( int  page_num)

Sets the current page to the given page.

Returns
true if successful, false otherwise.
void pdftron::PDF::PDFViewCtrl::SetCurrentPageHandler ( CurrentPageHandler  curr_pagenum_proc,
void *  data 
)

Sets 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_procCallback function (or a delegate in .NET).
dataCustom data to be passed as a second parameter to 'curr_pagenum_proc'.
void pdftron::PDF::PDFViewCtrl::SetCurrentZoomHandler ( CurrentZoomHandler  curr_zoom_proc,
void *  data 
)

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

Parameters
curr_zoom_procCallback function (or a delegate in .NET).
dataCustom data to be passed as a second parameter to 'curr_zoom_proc'.
void pdftron::PDF::PDFViewCtrl::SetCustomEventHandlers ( EventHandlers handlers)

Sets the handlers to be called when the certain events happen

Parameters
aclass containing the event handlers
void pdftron::PDF::PDFViewCtrl::SetDefaultPageColor ( UInt8  r,
UInt8  g,
UInt8  b 
)

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

Parameters
r,g,b- RGB color specifying the default page color.
bool pdftron::PDF::PDFViewCtrl::SetDoc ( PDFDoc doc,
const char *  password = 0 
)

Associates this PDFViewCtrl with a given PDF document.

Parameters
doc- A document to be displayed in the view.
password- the password used to initialize the document
Note
Acquires a write lock on the document
void pdftron::PDF::PDFViewCtrl::SetDownloadReportHandler ( DownloadReportHandler  download_proc,
void *  data 
)

Sets the download report handling function to be called on download events, such as when a new page or thumbnail is available, and any download related errors.

Parameters
download_procDownload handling callback function (or delegate in .NET)
dataCustom data to be passed as a parameter to 'download_proc'.
void pdftron::PDF::PDFViewCtrl::SetDrawAnnotations ( bool  render_annots)

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

Parameters
render_annotsTrue to draw annotations, false otherwise.
void pdftron::PDF::PDFViewCtrl::SetEnabledPanels ( UInt32  panels)

Sets which panels will be enabled in the navigation panel

Parameters
panels- A bit field composed of an OR of PDFViewCtrl::PanelType values.
void pdftron::PDF::PDFViewCtrl::SetErrorReportHandler ( ErrorReportHandler  error_proc,
void *  data 
)

Sets the error handling function to be called in case an error is encountered during page rendering.

Parameters
error_procError handling callback function (or delegate in .NET)
dataCustom data to be passed as a second parameter to 'error_proc'.
void pdftron::PDF::PDFViewCtrl::SetFindTextHandler ( FindTextAsyncHandler  proc,
void *  custom_data 
)

Sets the FindText handling function to be called once FindTextAsync is done, whether it was interrupted, canceled, or completed.

Parameters
procFindText handling callback function (or delegate in .NET)
dataCustom data to be passed as a parameter to 'proc'.
void pdftron::PDF::PDFViewCtrl::SetFocus ( )

Set the key focus to PDFViewCtrl. This is useful when a user needs to set the focus programatically.

void pdftron::PDF::PDFViewCtrl::SetGamma ( double  exp)

Sets the gamma factor used for anti-aliased rendering.

Parameters
expis 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).

Note
Gamma correction is used only in the built-in rasterizer.
void pdftron::PDF::PDFViewCtrl::SetHighlightFields ( bool  highlight_fields)

Enable or disable highlighting form fields. Default is disabled.

Parameters
highlight_fieldstrue to highlight, false otherwise.
void pdftron::PDF::PDFViewCtrl::SetHorizontalAlign ( int  align)

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

Parameters
alignan 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.
void pdftron::PDF::PDFViewCtrl::SetHScrollPos ( double  pos)

Sets the horizontal scroll position of the scrollable space.

Parameters
thenew horizontal scroll position of the scrollable space. The position should be a number in the range between 0 and GetCanvasWidth().
void pdftron::PDF::PDFViewCtrl::SetImageSmoothing ( bool  smoothing_enabled = true)

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.
Parameters
smoothing_enabledTrue to enable image smoothing, false otherwise. image smoothing is enabled.
void pdftron::PDF::PDFViewCtrl::SetOCGContext ( const OCG::Context ctx)

Sets 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.

Parameters
ctxOptional Content Group (OCG) context, or NULL if the rasterizer should render all content on the page.
Note
Unlike PDFDraw.SetOCGContext() this method copies the given context. As a result, in order to modify the state of OCG groups in the current context use GetOCGContext() to obtain the currently selected content and then modify states.
void pdftron::PDF::PDFViewCtrl::SetOverprint ( PDFRasterizer::OverprintPreviewMode  op)

Enable or disable support for overprint and overprint simulation. 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 only enabled for PDF/X files.

Parameters
ope_op_on: always enabled; e_op_off: always disabled; e_op_pdfx_on: enabled for PDF/X files only.
void pdftron::PDF::PDFViewCtrl::SetPageBorderVisibility ( bool  border_visible)

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

Parameters
border_visible- if true, the border will be visible.
void pdftron::PDF::PDFViewCtrl::SetPagePresentationMode ( PagePresentationMode  mode)

Sets the current page presentation mode.

Parameters
mode- the new page presentation mode. The default PagePresentationMode is e_single_continuous.
void pdftron::PDF::PDFViewCtrl::SetPageSpacing ( int  horiz_col_space,
int  vert_col_space,
int  horiz_pad,
int  vert_pad 
)

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

Parameters
horiz_col_spacehorizontal column spacing (represented in pixels) between adjacent pages in the view. Default is 10.
vert_col_spacevertical column spacing (represented in pixels) between adjacent pages in the view. Default is 10.
horiz_padhorizontal padding (represented in pixels) on the left and right side of the view. Default is 10.
vert_padvertical padding (represented in pixels) on the top and bottom side of the view. Default is 10.
void pdftron::PDF::PDFViewCtrl::SetPageTransparencyGrid ( bool  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.
void pdftron::PDF::PDFViewCtrl::SetPageViewMode ( PageViewMode  mode)

Sets the page viewing mode

Parameters
mode- the new page viewing mode. The default PageView mode is e_fit_width.
void pdftron::PDF::PDFViewCtrl::SetPathHinting ( bool  enable_hinting)

Enable or disable path hinting.

Parameters
enable_hintingif true path hinting is enabled. Path hinting is used to slightly adjust paths in order to avoid or alleviate artifacts of hair line cracks between certain graphical elements. This option is turned on by default.
void pdftron::PDF::PDFViewCtrl::SetProgressiveRendering ( bool  progressive = true)

Sets whether the control will render progressively or will just draw once the entire view has been rendered

Parameters
progressiveif true the view will be rendered progressively
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.
void pdftron::PDF::PDFViewCtrl::SetRasterizerType ( PDFRasterizer::Type  type)

Sets 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
typeRasterizer type.
void pdftron::PDF::PDFViewCtrl::SetRequestRenderInWorkerThreadProc ( RequestRenderInWorkerThreadProc  proc,
void *  custom_data 
)

Sets a callback for issuing a render request on the UI thread. The callback will be called from a secondary thread. The called code is responsible for dispatching an event to the UI thread using the relevant mechanism.

Parameters
procThe callback.
dataCustom data to be passed as a parameter to 'proc'.
void pdftron::PDF::PDFViewCtrl::SetSelectedPanel ( PanelType  panel)

Sets the currently selected panel in the navigation panel

Parameters
panelthe panel to select
void pdftron::PDF::PDFViewCtrl::SetSnappingMode ( UInt32  mode_flags)

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

Parameters
mode_flaga bitwise combination of the members of GeometryCollection::SnappingMode
void pdftron::PDF::PDFViewCtrl::SetSplitPosition ( int  pos)

Sets the horizontal size of the navigation panel

Parameters
posthe new horizontal size
void pdftron::PDF::PDFViewCtrl::SetTextSelectionMode ( TextSelectionMode  tm)

Sets the selection mode used for text highlighting.

Parameters
tmthe text selection mode.
void pdftron::PDF::PDFViewCtrl::SetThinLineAdjustment ( bool  pixel_grid_fit,
bool  stroke_adjust 
)

Set thin line adjustment parameters.

Parameters
pixel_grid_fitif 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 it only works if path hinting is enabled.
stroke_adjustif 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.
void pdftron::PDF::PDFViewCtrl::SetToolMode ( ToolMode  mode)

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

Parameters
mode- new tool mode.
void pdftron::PDF::PDFViewCtrl::SetupThumbnails ( bool  use_embedded,
bool  generate_at_runtime,
bool  use_disk_cache,
int  thumb_max_side_length,
size_t  max_abs_cache_size,
double  max_perc_cache_size 
)

Specify the different thumbnail settings for the viewer.

Parameters
use_embeddedEnables 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_runtimeEnables or disables generating thumbnails at runtime.
use_disk_cacheEnables or disables caching thumbnails in a temporary disk file.
thumb_max_side_lengthThe maximum size, in pixels, of a dimension of generated thumbnails.
max_abs_cache_sizeThe absolute maximum size on disk, in bytes, for the temporary thumbnail cache.
max_perc_cache_sizeThe maximum percentage of free disk space, in the range 0 - 1.0, that the cache can take up.
void pdftron::PDF::PDFViewCtrl::SetUrlExtraction ( bool  enabled)

Enables or disables URL extraction.

Parameters
enabledif true URL extraction is enabled, if false URL extraction is disabled.

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.
void pdftron::PDF::PDFViewCtrl::SetVerticalAlign ( int  align)

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

Parameters
alignan integer specifying the vertical alignment. Depending of whether align is positive, negative, or zero - pages will be bottom, top or center aligned: align<0 -> pages are top aligned. align==0 -> pages are centered. align>0 -> pages are bottom aligned.
void pdftron::PDF::PDFViewCtrl::SetVScrollPos ( double  pos)

Sets the vertical scroll position of the scrollable space.

Parameters
thenew vertical scroll position. The position should be a number in the range between 0 and GetCanvasheight().

Should you want to center to a location (px, py) expressed in a page space, you can use the following code:

//focus 
view.SetCurrentPage(page_num);
view.ConvPagePtToScreenPt(px, py, page_num);
view.SetZoom((int)px, (int)py, view.GetZoom());

//center
int width = view.GetBufferWidth();
int height = view.GetBufferHeight();
int dx = (int)(px - (double)width/2 + 0.5);
int dy = (int)(py - (double)height/2 + 0.5);
view.OnScroll(dx, dy);
void pdftron::PDF::PDFViewCtrl::SetWindowBackgroundColor ( WindowID  winid,
const ColorPt color 
)

Changes the background color on a given child window. That window must already exist.

bool pdftron::PDF::PDFViewCtrl::SetZoom ( double  zoom)

Sets 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.
bool pdftron::PDF::PDFViewCtrl::SetZoom ( int  x,
int  y,
double  zoom 
)

Sets the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center, which will stay fixed on the screen.

The zoom point (x,y) is represented in the screen coordinate system, which starts in the upper-left corner of the client window.

Should you want to move (x, y) to the center of the client window, you can use the OnScroll() subsequently:

int x, y;
double zoom;
...
view.SetZoom(x, y, zoom);
int width = view.GetBufferWidth();
int height = view.GetBufferHeight();
int dx = (int)(x - (double)width/2 + 0.5);
int dy = (int)(y - (double)height/2 + 0.5);
view.OnScroll(dx, dy);
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.
void pdftron::PDF::PDFViewCtrl::ShowDialogs ( bool  show)

Enables or disables popup dialogs such as password entry and find dialogs as well as popup menus.

Parameters
showif true dialogs will be enabled
void pdftron::PDF::PDFViewCtrl::ShowMenuBar ( bool  show)

Enables or disables the menu bar that gives access to the PDFViewCtrl user functions.

Parameters
showif true the menu bar will be enabled.
void pdftron::PDF::PDFViewCtrl::ShowNavPanel ( bool  show)

Enables or disables the navigation panel

Parameters
showif true the navigation panel will be enabled
void pdftron::PDF::PDFViewCtrl::ShowNavToolbar ( bool  show)

Enables or disables the toolbar controlling the navigation panel.

Parameters
showif true the navigation toolbar will be enabled.
bool pdftron::PDF::PDFViewCtrl::ShowRect ( int  page_num,
const Rect rect 
)

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

Returns
true if successful, false otherwise.
void pdftron::PDF::PDFViewCtrl::ShowStatusBar ( bool  show)

Enables or disables the status bar at the bottom of the viewing area.

Parameters
showif true the status bar will be enabled.
void pdftron::PDF::PDFViewCtrl::ShowToolbar ( bool  show)

Enables or disables the toolbar on top of the viewing area.

Parameters
showif true the toolbar will be enabled.
bool pdftron::PDF::PDFViewCtrl::SmartZoom ( int  x,
int  y 
)

Sets the zoom factor to a new value using the given pixel coordinate (x,y) to find an intersecting paragraph. The width of the paragraph helps to determine the zoom value, center of the paragraph is used as a zoom center. Paragraph has to contain more than one line and be wider than 1/5th of a page width. When called on a paragraph wider than current zoom level the new zoom level is set to fit the entire page(zoom out).

The zoom point (x,y) is represented in the screen space, which starts in the upper-left corner of the client window.

Parameters
x- the horizontal coordinate to look for a text block.
y- the vertical coordinate to look for a text block.
Returns
true if successful, false if no paragraph intersects the given point.
void pdftron::PDF::PDFViewCtrl::SnapToNearestInDoc ( double &  screen_x,
double &  screen_y 
)

Snaps an xy coordinate pair (in screen space) to the nearest piece of document geometry.

void pdftron::PDF::PDFViewCtrl::Update ( bool  all = false)

Redraws the contents.

Parameters
allIf true, all the rendered contents are discarded and re-rendered; otherwise, only the visible region will be re-rendered.
void pdftron::PDF::PDFViewCtrl::Update ( const Rect update)

Redraws the contents in the given area.

Parameters
updateThe rectangle to update expressed in screen coordinates.
void pdftron::PDF::PDFViewCtrl::Update ( const Annot annot,
int  page_num 
)

Redraws the area covered with a given annotation.

Parameters
annotThe annotation to update.
page_numThe page number on which the annotation is located.
void pdftron::PDF::PDFViewCtrl::Update ( const Field field)

Redraws all instances (Widgets) of the field.

Parameters
fieldthe field for which to update all occurances
void pdftron::PDF::PDFViewCtrl::UpdatePageLayout ( )

Updates the page layout withing the view. This function must be called after document page sequence is modified (such as when a page is being added to or removed from a document) or after changes to page dimensions (e.g. after a page is rotated or resized).

bool pdftron::PDF::PDFViewCtrl::WereAnnotsForMousePrepared ( int  page_num) const
Returns
true if annotations of the given page have been prepared, false otherwise
Parameters
page_num- page number
bool pdftron::PDF::PDFViewCtrl::WereWordsPrepared ( int  page_num) const
Returns
true if words of the given page has been prepared, false otherwise
Parameters
page_num- page number

Member Data Documentation

const UInt32 pdftron::PDF::PDFViewCtrl::e_all =0x07
static

Definition at line 518 of file PDFViewCtrl.h.

const UInt32 pdftron::PDF::PDFViewCtrl::e_bookmarks =0x01
static

Definition at line 515 of file PDFViewCtrl.h.

const UInt32 pdftron::PDF::PDFViewCtrl::e_layers =0x02
static

Definition at line 516 of file PDFViewCtrl.h.

const UInt32 pdftron::PDF::PDFViewCtrl::e_none =0x00
static

Definition at line 514 of file PDFViewCtrl.h.

const UInt32 pdftron::PDF::PDFViewCtrl::e_thumbview =0x04
static

Definition at line 517 of file PDFViewCtrl.h.


The documentation for this class was generated from the following file: