wxPDFView  0.1
wxWidgets PDFium Integration Library
Public Member Functions | List of all members
wxPDFView Class Reference

This control encapsulates display an loading of a PDF document. More...

#include <PDFView.h>

+ Inheritance diagram for wxPDFView:

Public Member Functions

 wxPDFView ()
 
 wxPDFView (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, const wxString &name=wxPanelNameStr)
 
virtual ~wxPDFView ()
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, const wxString &name=wxPanelNameStr)
 
void NavigateToPage (wxPDFViewPageNavigation pageNavigation)
 
int GetPageCount () const
 Retrieves the number of pages in the current document. More...
 
const wxPDFViewBookmarkGetRootBookmark () const
 Returns the root bookmark if the document contains bookmarks. More...
 
void GoToPage (int pageIndex, const wxRect *centerRect=NULL)
 Scroll the specified page into the center of the view. More...
 
int GetMostVisiblePage () const
 The return value is usally used to show a page number in the UI. More...
 
void SetZoom (double zoom)
 Set the zoom level as float value 1.0 is the original size. More...
 
double GetZoom () const
 
double GetMaxZoom () const
 
double GetMinZoom () const
 
void SetZoomType (wxPDFViewZoomType zoomType)
 Activates a new zoom type. More...
 
wxPDFViewZoomType GetZoomType () const
 
void SetDisplayFlags (int flags)
 Set the display flags to any combination of wxPDFViewDisplayFlags. More...
 
int GetDisplayFlags () const
 
long Find (const wxString &text, int flags=wxPDFVIEW_FIND_DEFAULT)
 Scrolls next result into view and returns the number of matches or wxNOT_FOUND. More...
 
bool IsPrintAllowed () const
 Returns true if the document allows printing. More...
 
wxPrintout * CreatePrintout () const
 Creates a printout object. More...
 
wxPrintDialogData GetPrintDialogData () const
 Returns prepopulated wxPrintDialogData. More...
 
const wxString & GetDocumentTitle () const
 
bool LoadFile (const wxString &fileName, const wxString &password=wxString())
 Load specified file path into the view. More...
 
bool LoadStream (wxSharedPtr< std::istream > pStream, const wxString &password=wxString())
 Use LoadStream to load a PDF from a custom source. More...
 
void CloseDocument ()
 Closes the current loaded document. More...
 
wxPDFViewImplGetImpl () const
 
virtual void ScrollWindow (int dx, int dy, const wxRect *rect=NULL)
 
void SetPrintValidator (wxPDFViewPrintValidator *validator)
 
wxPDFViewPrintValidatorGetPrintValidator () const
 

Detailed Description

This control encapsulates display an loading of a PDF document.

Use LoadFile or LoadStream to load content into the view. This control can be used alone or together with the other controls from the wxPDFView library.

For a complete PDF reader you can use wxPDFViewDocumentFrame which combines all the libraries classes into a fully function PDF reader ready to be used in your application.

See also
wxPDFViewBookmarksCtrl, wxPDFViewThumbnailListBox

Constructor & Destructor Documentation

wxPDFView::wxPDFView ( )
inline
wxPDFView::wxPDFView ( wxWindow *  parent,
wxWindowID  winid = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxScrolledWindowStyle,
const wxString &  name = wxPanelNameStr 
)
virtual wxPDFView::~wxPDFView ( )
virtual

Member Function Documentation

void wxPDFView::CloseDocument ( )

Closes the current loaded document.

See also
LoadFile(), LoadStream()
bool wxPDFView::Create ( wxWindow *  parent,
wxWindowID  winid = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxScrolledWindowStyle,
const wxString &  name = wxPanelNameStr 
)
wxPrintout* wxPDFView::CreatePrintout ( ) const

Creates a printout object.

Returns
Created wxPrintout instance or NULL if printing is not allowed by the document
See also
IsPrintAllowed()
long wxPDFView::Find ( const wxString &  text,
int  flags = wxPDFVIEW_FIND_DEFAULT 
)

Scrolls next result into view and returns the number of matches or wxNOT_FOUND.

Parameters
textText to search
flagsSearch direction and case sensitive search
int wxPDFView::GetDisplayFlags ( ) const
const wxString& wxPDFView::GetDocumentTitle ( ) const
wxPDFViewImpl* wxPDFView::GetImpl ( ) const
inline
double wxPDFView::GetMaxZoom ( ) const
double wxPDFView::GetMinZoom ( ) const
int wxPDFView::GetMostVisiblePage ( ) const

The return value is usally used to show a page number in the UI.

Returns
Page which is currently the most visible depending on zoom and scroll position
int wxPDFView::GetPageCount ( ) const

Retrieves the number of pages in the current document.

wxPrintDialogData wxPDFView::GetPrintDialogData ( ) const

Returns prepopulated wxPrintDialogData.

wxPDFViewPrintValidator* wxPDFView::GetPrintValidator ( ) const
const wxPDFViewBookmark* wxPDFView::GetRootBookmark ( ) const

Returns the root bookmark if the document contains bookmarks.

double wxPDFView::GetZoom ( ) const
wxPDFViewZoomType wxPDFView::GetZoomType ( ) const
void wxPDFView::GoToPage ( int  pageIndex,
const wxRect *  centerRect = NULL 
)

Scroll the specified page into the center of the view.

Parameters
pageIndexZero based index to page to go to
centerRectOptional rectangle inside the page which the view will be centered on
bool wxPDFView::IsPrintAllowed ( ) const

Returns true if the document allows printing.

See also
CreatePrintOut()
bool wxPDFView::LoadFile ( const wxString &  fileName,
const wxString &  password = wxString() 
)

Load specified file path into the view.

If a password protected file is loaded but no password is specified the user will be asked for one.

See also
LoadStream()
bool wxPDFView::LoadStream ( wxSharedPtr< std::istream >  pStream,
const wxString &  password = wxString() 
)

Use LoadStream to load a PDF from a custom source.

The specified stream muste be seekable. Local files should be loaded via LoadFile()

See also
LoadFile()
void wxPDFView::NavigateToPage ( wxPDFViewPageNavigation  pageNavigation)
virtual void wxPDFView::ScrollWindow ( int  dx,
int  dy,
const wxRect *  rect = NULL 
)
virtual
void wxPDFView::SetDisplayFlags ( int  flags)

Set the display flags to any combination of wxPDFViewDisplayFlags.

See also
GetDisplayFlags()
void wxPDFView::SetPrintValidator ( wxPDFViewPrintValidator validator)
void wxPDFView::SetZoom ( double  zoom)

Set the zoom level as float value 1.0 is the original size.

Setting the zoom resets the zoom type to wxPDFVIEW_ZOOM_TYPE_FREE

See also
SetZoomType()
void wxPDFView::SetZoomType ( wxPDFViewZoomType  zoomType)

Activates a new zoom type.

Parameters
zoomTypeOne of three supported zoom types
See also
SetZoom()