foxit::rdk::PDFViewCtrl Class Reference

The PDF view control, which is able to open/display/save/...etc the PDF document. More...

Inherits ContentControl.

Public Member Functions

Windows::Foundation::IAsyncOperation< foxit::common::ErrorCode > ^ OpenDocAsync (Windows::Storage::StorageFile^ file, Platform::String^ password)
 Open pdf doc with async. More...
 
Windows::Foundation::IAsyncOperation< foxit::common::ErrorCode > ^ OpenDocAsync (Platform::String^ filePath, Platform::String^ password)
 Open pdf doc with async. More...
 
Windows::Storage::StorageFile ^ GetStorageFile ()
 Get the storage file associates with current opened PDF document. More...
 
void GotoPage (int iPageIndex)
 Go to a specified page. More...
 
void GotoPagePoint (int iPageIndex, Windows::Foundation::Point pt)
 Go to a specified point on the specified page. More...
 
void GotoBookmark (foxit::pdf::Bookmark^ bookmark)
 Go to a destination which associate with the bookmark. More...
 
bool GotoFirstPage ()
 Go to the first page. More...
 
bool GotoLastPage ()
 Go to the last page. More...
 
bool GotoPreviousPage ()
 Go to the previous page. More...
 
bool GotoNextPage ()
 Go to the next page. More...
 
int GetCurrentPage ()
 Get the current page index. More...
 
int GetPageAtPoint (Windows::Foundation::Point pt)
 Get the page index at specified device point. More...
 
Windows::Foundation::Collections::IVector< int > ^ GetVisiblePages ()
 Get the visible pages. More...
 
foxit::rdk::ZoomMode GetPageZoomMode ()
 Get the page zoom mode. More...
 
void SetPageZoomMode (foxit::rdk::ZoomMode pageMode)
 Set the page zoom mode. More...
 
foxit::rdk::LayoutMode GetPageLayoutMode ()
 Get the page layout mode. More...
 
void SetPageLayoutMode (foxit::rdk::LayoutMode mode)
 Set the page layout mode. More...
 
foxit::pdf::PDFDoc ^ GetDoc ()
 Get the current document. More...
 
void SetDoc (foxit::pdf::PDFDoc^ doc)
 Open the specified document, so that the document will be the current document. More...
 
Windows::Foundation::IAsyncAction ^ SaveDoc ()
 Save the current document to local file, only works when the document is opened from local, and file write access is granted. More...
 
void CloseDoc ()
 Close the current document. More...
 
bool IsModified ()
 Is the document is modified. More...
 
void SetModified (bool isModified)
 Set the current document modification flag. More...
 
foxit::common::ContentFlag GetRenderFlag ()
 Get the render content flag, See macros FSRenderContentFlag::XXX.
 
void SetRenderFlag (foxit::common::ContentFlag flag)
 Set the render content flag, See macros FSRenderContentFlag::XXX.
 
void HideAnnotType (foxit::pdf::annots::AnnotType type)
 Hide the specified annotation type, so that this type of annotations will not be rendered.
 
int GetPageCount ()
 Get the page count of current document.
 
float GetScale ()
 Get the scale of view control.
 
void SetScale (float scale)
 Set the scale of view control.
 
float GetMinScale ()
 Get the minimal scale of view control.
 
float GetMaxScale ()
 Get the maxium scale of view control.
 
void OffsetView (double vOffset, double hOffset)
 Offset the current page view by the specified horizontal and vertical distance. More...
 
void ZoomTo (Windows::Foundation::Point centerPt, double scale, bool isInertial, bool isManipulationComplete)
 Zoom the current page view by a specified scale, and centered on the specified device point. More...
 
void SetRotate (int rotate)
 Set the rotation of page view.
 
int GetRotate ()
 Get the rotation of page view.
 
Windows::Foundation::Size GetCanvasSize ()
 Get the size of pdf canvas, in device cordinate.
 
void SetDefaultViewMode (foxit::rdk::LayoutMode mode)
 Set the default view mode.
 
void SetViewColor (Windows::UI::Color bgColor, Windows::UI::Color fgColor)
 Set the background and foreground color of page.
 
void Redraw ()
 Redraw all the visible pages on canvas, then update the device canvas.
 
void Redraw (int pageIndex)
 Redraw the specified page on canvas, then update the device canvas.
 
void Update ()
 update the device canvas, which will trigger Render Canvas Event.
 
void CancelRenderTask ()
 Cancel the current render task.
 
void EnableScrollView (bool isEnable)
 Enable or disable the page scrolling.
 
Windows::UI::Xaml::Media::Matrix GetDisplayMatrix (int pageIndex)
 Get the display matrix with a specified page.
 
PDFPagePoint ^ ConvertDevicePtToPDFPagePt (Windows::Foundation::Point devicePt)
 Convert the page point to device point.
 
Windows::Foundation::Point ConvertPagePtToDevicePt (int pageIndex, Windows::Foundation::Point pagePt)
 Convert the device point to page point.
 
Windows::Foundation::Rect ConvertDeviceRectToPageRect (int pageIndex, Windows::Foundation::Rect deviceRc)
 Convert the device rect to page rect.
 
Windows::Foundation::Rect ConvertPageRectToDeviceRect (int pageIndex, Windows::Foundation::Rect pageRc)
 Convert the page rect to device rect.
 
Windows::Foundation::Rect GetPageViewRect (int pageIndex)
 Get the specified page rect, in device coordinate.
 
void SaveState (Windows::Storage::ApplicationDataCompositeValue^ data)
 Save the current view state.
 

Properties

IUIExtensionsEventsExtensionsManager [get, set]
 The UI extensions manager, which will extend the functions of view control.
 
Windows::UI::Xaml::Controls::Grid^ Layout [get]
 The root layout of view control, caller may append UI layout to this root, so that view control will fit to any size of device.
 
float CompositionScaleX [get]
 Horizontal scale of view control canvas.
 
float CompositionScaleY [get]
 Vertical scale of view control canvas.
 
Windows::UI::Color PageBgColor [get]
 Get the backgroud color of page.
 
Windows::UI::Color PageFgColor [get]
 Get the foreground color of page.
 
bool NightMode [get, set]
 Get/Set the night mode reading.
 

Events

RenderCanvasEvent^ RenderCanvasEvent
 Canvas rendering event.
 
RenderPageEvent^ RenderPageEvent
 Page rendering event.
 
OpenDocEvent^ OpenPdfFileEvent
 PDF opened event.
 
CloseDocEvent^ ClosePdfFileEvent
 PDF close event.
 
PageLoadedEvent^ PageLoadedEvent
 Page load event.
 
PageUnloadedEvent^ PageUnloadedEvent
 Page unload event.
 
PageVisibleEvent^ PageVisibleEvent
 Page visible event.
 
PageInvisibleEvent^ PageInvisibleEvent
 Page invisible event.
 
PageChangedEvent^ PageChangedEvent
 Page index changed event.
 
PageLayoutModeChangedEvent^ PageLayoutModeChangedEvent
 PageMOde changed event.
 

Detailed Description

The PDF view control, which is able to open/display/save/...etc the PDF document.

Member Function Documentation

◆ CloseDoc()

void foxit::rdk::PDFViewCtrl::CloseDoc ( )

Close the current document.

Returns
None.

◆ GetCurrentPage()

int foxit::rdk::PDFViewCtrl::GetCurrentPage ( )

Get the current page index.

Returns
The current page.

◆ GetDoc()

foxit::pdf::PDFDoc ^ foxit::rdk::PDFViewCtrl::GetDoc ( )

Get the current document.

Returns
The current document.

◆ GetPageAtPoint()

int foxit::rdk::PDFViewCtrl::GetPageAtPoint ( Windows::Foundation::Point  pt)

Get the page index at specified device point.

Parameters
[in]ptThe point on the view control,in device coordinate.
Returns
The page index.

◆ GetPageLayoutMode()

foxit::rdk::LayoutMode foxit::rdk::PDFViewCtrl::GetPageLayoutMode ( )

Get the page layout mode.

Returns
The layout mode.

◆ GetPageZoomMode()

foxit::rdk::ZoomMode foxit::rdk::PDFViewCtrl::GetPageZoomMode ( )

Get the page zoom mode.

Returns
The zoom mode.

◆ GetStorageFile()

Windows::Storage::StorageFile ^ foxit::rdk::PDFViewCtrl::GetStorageFile ( )

Get the storage file associates with current opened PDF document.

Returns
The storage file.

◆ GetVisiblePages()

Windows::Foundation::Collections::IVector<int> ^ foxit::rdk::PDFViewCtrl::GetVisiblePages ( )

Get the visible pages.

Returns
The current visible pages.

◆ GotoBookmark()

void foxit::rdk::PDFViewCtrl::GotoBookmark ( foxit::pdf::Bookmark^  bookmark)

Go to a destination which associate with the bookmark.

Parameters
[in]bookmarkThe pdf bookmark object.
Returns
None.

◆ GotoFirstPage()

bool foxit::rdk::PDFViewCtrl::GotoFirstPage ( )

Go to the first page.

Returns
None.

◆ GotoLastPage()

bool foxit::rdk::PDFViewCtrl::GotoLastPage ( )

Go to the last page.

Returns
None.

◆ GotoNextPage()

bool foxit::rdk::PDFViewCtrl::GotoNextPage ( )

Go to the next page.

Returns
None.

◆ GotoPage()

void foxit::rdk::PDFViewCtrl::GotoPage ( int  iPageIndex)

Go to a specified page.

Parameters
[in]iPageIndexThe page index, which starts from 0 for the first page.
Returns
None.

◆ GotoPagePoint()

void foxit::rdk::PDFViewCtrl::GotoPagePoint ( int  iPageIndex,
Windows::Foundation::Point  pt 
)

Go to a specified point on the specified page.

Parameters
[in]iPageIndexThe page index, which starts from 0 for the first page.
[in]ptThe point on page,in PDF page coordinate.
Returns
None.

◆ GotoPreviousPage()

bool foxit::rdk::PDFViewCtrl::GotoPreviousPage ( )

Go to the previous page.

Returns
None.

◆ IsModified()

bool foxit::rdk::PDFViewCtrl::IsModified ( )

Is the document is modified.

Returns
true if the document is modified, otherwise false..

◆ OffsetView()

void foxit::rdk::PDFViewCtrl::OffsetView ( double  vOffset,
double  hOffset 
)

Offset the current page view by the specified horizontal and vertical distance.

Parameters
[in]vOffsetThe vertical offset, is ignored when layout mode is LayoutMode::SingleMode.
[in]hOffsetThe horizontal offset, is ignored when layout mode is LayoutMode::ContinueMode.
Returns
None.

◆ OpenDocAsync() [1/2]

Windows::Foundation::IAsyncOperation<foxit::common::ErrorCode> ^ foxit::rdk::PDFViewCtrl::OpenDocAsync ( Windows::Storage::StorageFile^  file,
Platform::String^  password 
)

Open pdf doc with async.

Parameters
[in]fileThe storage file which represents a PDF file.
[in]passwordThe PDF file password, could be null if there is no password required.
Returns
Error code which represents the result, return FSErrorCode::e_errSuccess if successfully.
Exceptions
Platform::ExceptionFor more information about exception values, please refer to FSErrorCode::e_errXXX.

◆ OpenDocAsync() [2/2]

Windows::Foundation::IAsyncOperation<foxit::common::ErrorCode> ^ foxit::rdk::PDFViewCtrl::OpenDocAsync ( Platform::String^  filePath,
Platform::String^  password 
)

Open pdf doc with async.

Parameters
[in]filePathThe file path which represents a PDF file.
[in]passwordThe PDF file password, could be null if there is no password required.
Returns
Error code which represents the result, return FSErrorCode::e_errSuccess if successfully.
Exceptions
Platform::ExceptionFor more information about exception values, please refer to FSErrorCode::e_errXXX.

◆ SaveDoc()

Windows::Foundation::IAsyncAction ^ foxit::rdk::PDFViewCtrl::SaveDoc ( )

Save the current document to local file, only works when the document is opened from local, and file write access is granted.

Returns
None.

◆ SetDoc()

void foxit::rdk::PDFViewCtrl::SetDoc ( foxit::pdf::PDFDoc^  doc)

Open the specified document, so that the document will be the current document.

Parameters
[in]docThe pdf document object.
Returns
None.

◆ SetModified()

void foxit::rdk::PDFViewCtrl::SetModified ( bool  isModified)

Set the current document modification flag.

Parameters
[in]isModifiedThe modification flag.
Returns
None.

◆ SetPageLayoutMode()

void foxit::rdk::PDFViewCtrl::SetPageLayoutMode ( foxit::rdk::LayoutMode  mode)

Set the page layout mode.

Parameters
[in]modeThe page layout mode.
Returns
None.

◆ SetPageZoomMode()

void foxit::rdk::PDFViewCtrl::SetPageZoomMode ( foxit::rdk::ZoomMode  pageMode)

Set the page zoom mode.

Parameters
[in]pageModeThe page zoom mode.
Returns
None.

◆ ZoomTo()

void foxit::rdk::PDFViewCtrl::ZoomTo ( Windows::Foundation::Point  centerPt,
double  scale,
bool  isInertial,
bool  isManipulationComplete 
)

Zoom the current page view by a specified scale, and centered on the specified device point.

Parameters
[in]centerPtThe center point that will zoom to, in device coordinate system.
[in]scaleThe page scale.
[in]isInertialIf it will inertially scroll to the specified position.
[in]isManipulationCompleteIf manipulation is completed.
Returns
None.

Foxit Software Corporation Logo
@2017 Foxit Software Incorporated. All rights reserved.