XpdfWidget/Qt
Public Types | List of all members
XpdfWidget Class Reference

A PDF viewer widget class for Qt. More...

#include <XpdfWidget.h>

Inheritance diagram for XpdfWidget:

Public Types

enum  ErrorCode {
  pdfOk = 0 , pdfErrOpenFile = 1 , pdfErrBadCatalog = 2 , pdfErrDamaged = 3 ,
  pdfErrEncrypted = 4 , pdfErrHighlightFile = 5 , pdfErrBadPrinter = 6 , pdfErrPrinting = 7 ,
  pdfErrPermission = 8 , pdfErrBadPageNum = 9 , pdfErrFileIO = 10 , pdfErrNoHandle = 1001 ,
  pdfErrOutOfMemory = 1002 , pdfErrBusy = 1003 , pdfErrBadArg = 1004
}
 Error codes returned by certain XpdfViewer functions. More...
 
enum  DisplayMode {
  pdfDisplaySingle , pdfDisplayContinuous , pdfDisplaySideBySideSingle , pdfDisplaySideBySideContinuous ,
  pdfDisplayHorizontalContinuous
}
 Display modes, to be passed to XpdfWidget::setDisplayMode(). More...
 

Static Public Attributes

Zoom values
static const int zoomToPage = -1
 zoom to fit whole page More...
 
static const int zoomToWidth = -2
 zoom to fit page width More...
 
static const int zoomToHeight = -3
 zoom to fit page height More...
 

Find flags

Flags to be passed to XpdfWidget::find()

enum  ImageColorMode { pdfImageColorRGB , pdfImageColorGray , pdfImageColorMono }
 Color modes, to be passed to the image conversion functions. More...
 
static const int findBackward = 0x00000001
 search backward from the starting point More...
 
static const int findCaseSensitive = 0x00000002
 perform a case-sensitive search (default is case-insensitive) More...
 
static const int findNext = 0x00000004
 start searching from the previous search result More...
 
static const int findOnePageOnly = 0x00000008
 limit the search to the current page More...
 
static const int findWholeWord = 0x00000010
 limit the search to whole words More...
 
class XpdfViewer
 
static void init (const QString &configFileName=QString())
 Initialize the XpdfWidget class, reading a configuration file. More...
 
static void setConfig (const QString &command)
 Process a configuration command, i.e., one line of an xpdfrc file. More...
 
 XpdfWidget (const QColor &paperColor=QColor(0xff, 0xff, 0xff), const QColor &matteColor=QColor(0x80, 0x80, 0x80), bool reverseVideo=false, QWidget *parentA=0)
 The XpdfWidget constructor. More...
 
 XpdfWidget (QWidget *parentA, const QColor &paperColor=QColor(0xff, 0xff, 0xff), const QColor &matteColor=QColor(0x80, 0x80, 0x80), bool reverseVideo=false)
 The XpdfWidget constructor. More...
 
virtual ~XpdfWidget ()
 Destroys the XpdfWidget. More...
 
void enableHyperlinks (bool on)
 Control handling of hyperlinks. More...
 
void enableExternalHyperlinks (bool on)
 Control handling of external hyperlinks. More...
 
void enableSelect (bool on)
 Control handling of text selection. More...
 
void enablePan (bool on)
 Control mouse panning. More...
 
void enableTouchPan (bool on)
 Control touchscreen panning. More...
 
void enableTouchZoom (bool on)
 Control touchscreen zooming. More...
 
void setKeyPassthrough (bool on)
 Control keypress passthrough. More...
 
void setMousePassthrough (bool on)
 Control mouse event passthrough. More...
 
void showPasswordDialog (bool showDlg)
 Control the password dialog. More...
 
void setMatteColor (const QColor &matteColor)
 Set the matte color, i.e., the color used for background outside the actual page area. More...
 
void setReverseVideo (bool reverse)
 Turn reverse video mode on/off. The default is off. More...
 
void setCursor (const QCursor &cursor)
 Set the cursor. More...
 
void unsetCursor ()
 Reset to the default cursor. More...
 
ErrorCode loadFile (const QString &fileName, const QString &password="")
 Load a PDF file and display its first page. More...
 
ErrorCode loadMem (const char *buffer, unsigned int bufferLength, const QString &password="")
 Load a PDF file from a memory buffer and display its first page. More...
 
ErrorCode readDoc (XpdfDocHandle *docPtr, const QString &fileName, const QString &password="")
 Load a PDF file and return a handle. More...
 
ErrorCode loadDoc (XpdfDocHandle doc)
 Load a PDF document and display its first page. More...
 
void freeDoc (XpdfDocHandle doc)
 Free a PDF document. More...
 
ErrorCode reload ()
 Reload the current PDF file. More...
 
void closeFile ()
 Close the currently open PDF file (if any). More...
 
ErrorCode saveAs (const QString &fileName)
 Save the PDF file with another name. More...
 
QString getFileName () const
 Get the file name of the currently open PDF file. More...
 
bool hasOpenDocument () const
 Returns true if there is currently a PDF file open. More...
 
int getNumPages () const
 Return the number of pages in the currently open PDF file. More...
 
int getCurrentPage () const
 Return the currently displayed page number. More...
 
int getMidPage () const
 Return the page number corresponding to the middle of the window. More...
 
void gotoPage (int pageNum)
 Display the specified page. More...
 
void gotoFirstPage ()
 Display the first page. More...
 
void gotoLastPage ()
 Display the last page. More...
 
void gotoNextPage (bool scrollToTop=true)
 Display the next page. More...
 
void gotoPreviousPage (bool scrollToTop=true)
 Display the previous page. More...
 
bool gotoNamedDestination (const QString &dest)
 Go to a named destination. More...
 
void goForward ()
 Go forward along the history list. More...
 
void goBackward ()
 Go backward along the history list. More...
 
void scrollPageUp ()
 Scroll one screen up. More...
 
void scrollPageDown ()
 Scroll one screen down. More...
 
void scrollTo (int xx, int yy)
 Scroll the page so that the top-left corner of the window is (xx,yy) pixels from the top-left corner of the PDF page. More...
 
void scrollBy (int dx, int dy)
 Scroll the page by (dx,dy) pixels. More...
 
int getScrollX () const
 Return the current scroll position x coordinate. More...
 
int getScrollY () const
 Return the current scroll position y coordinate. More...
 
void setZoom (double zoom)
 Change the zoom factor. More...
 
double getZoom () const
 Return the current zoom factor. More...
 
double getZoomPercent (int page=1) const
 Return the current zoom factor as a percentage. More...
 
void zoomToRect (int page, double xMin, double yMin, double xMax, double yMax)
 Zoom in to the specified rectangle. More...
 
void zoomCentered (double zoom)
 Set the zoom factor, while maintaining the current center. More...
 
void zoomToCurrentWidth ()
 Zoom so that the current page(s) fill the window width. More...
 
void setRotate (int rotate)
 Change the page rotation. More...
 
int getRotate () const
 Return the current page rotation. More...
 
void setContinuousMode (bool continuous)
 Set continuous or single-page view mode. More...
 
bool getContinuousMode () const
 Return true if the viewer is in continuous view mode, or false if it is in any other mode. More...
 
void setDisplayMode (DisplayMode mode)
 Set the display mode. More...
 
DisplayMode getDisplayMode ()
 Return the current display mode. More...
 
bool mouseOverLink ()
 Returns true if the mouse is currently over a hyperlink. More...
 
bool onLink (int page, double xx, double yy)
 Returns true if the specified coordinates are inside a hyperlink. More...
 
QString getLinkInfo (int page, double xx, double yy)
 Get destination information for the hyperlink at the specified page and coordinates. More...
 
QString getMouseLinkInfo ()
 Get destination information for the hyperlink under the mouse. More...
 
bool gotoLinkAt (int page, double xx, double yy)
 Activate the link (if any) at the specified page and coordinates. More...
 
XpdfAnnotHandle onAnnot (int page, double xx, double yy)
 Check for an annotation containing the specified point. More...
 
QString getAnnotType (XpdfAnnotHandle annot)
 Get the annotation type. More...
 
QString getAnnotContent (XpdfAnnotHandle annot)
 Get the annotation's content. More...
 
XpdfFormFieldHandle onFormField (int page, double xx, double yy)
 Check for a form field containing the specified point. More...
 
QString getFormFieldType (XpdfFormFieldHandle field)
 Get the form field's type. More...
 
QString getFormFieldName (XpdfFormFieldHandle field)
 Get the form field's name. More...
 
QString getFormFieldValue (XpdfFormFieldHandle field)
 Get the form field's content. More...
 
void getFormFieldBBox (XpdfFormFieldHandle field, int *pageNum, double *xMin, double *yMin, double *xMax, double *yMax)
 Get the form field's bounding box. More...
 
bool convertWindowToPDFCoords (int winX, int winY, int *page, double *pdfX, double *pdfY)
 Convert window coordinates to PDF coordinates. More...
 
void convertPDFToWindowCoords (int page, double pdfX, double pdfY, int *winX, int *winY)
 Convert PDF coordinates to window coordinates. More...
 
void enableRedraw (bool enable)
 Enable or disable window redraws. More...
 
void getPageBox (int page, const QString &box, double *xMin, double *yMin, double *xMax, double *yMax) const
 Return the coordinates of the specified page box. More...
 
double getPageWidth (int page) const
 Return the width of the specified page. More...
 
double getPageHeight (int page) const
 Return the height of the specified page. More...
 
int getPageRotation (int page) const
 Get the default rotation for the specified page. More...
 
bool hasSelection ()
 Check to see if there is a selection. More...
 
bool getCurrentSelection (int *page, double *x0, double *y0, double *x1, double *y1) const
 Returns the current selection. More...
 
void setCurrentSelection (int page, double x0, double y0, double x1, double y1)
 Set the selection. More...
 
void clearSelection ()
 Clear the selection. More...
 
bool isBlockSelectMode ()
 Check for block selection mode. More...
 
bool isLinearSelectMode ()
 Check for linear selection mode. More...
 
void setBlockSelectMode ()
 Set block selection mode. More...
 
void setLinearSelectMode ()
 Set linear selection mode. More...
 
void setSelectionColor (const QColor &selectionColor)
 Set the selection color. More...
 
void forceRedraw ()
 Force a complete redraw. More...
 
QImage convertPageToImage (int page, double dpi, bool transparent=false, ImageColorMode color=pdfImageColorRGB)
 Convert a page to an image. More...
 
QImage convertRegionToImage (int page, double x0, double y0, double x1, double y1, double dpi, bool transparent=false, ImageColorMode color=pdfImageColorRGB)
 Convert a rectangular region of a page to an image. More...
 
QImage getThumbnail (int page)
 Retrieve an embedded thumbnail image. More...
 
bool okToExtractText () const
 Checks to see if text extraction is allowed. More...
 
void setTextEncoding (const QString &encodingName)
 Set the encoding to use for text extraction. More...
 
QString extractText (int page, double x0, double y0, double x1, double y1)
 Extract text from a region of a page. More...
 
QString getSelectedText ()
 Get the currently selected text. More...
 
void copySelection ()
 Copy the current selection to the clipboard. More...
 
bool find (const QString &text, int flags=0)
 Find a text string. More...
 
QVector< XpdfFindResultfindAll (const QString &text, int firstPage, int lastPage, int flags=0)
 Find all occurrences of a text string. More...
 
bool hasPageLabels ()
 Check if the PDF file has page labels. More...
 
QString getPageLabelFromPageNum (int pageNum)
 Convert a page number to a page label. More...
 
int getPageNumFromPageLabel (QString pageLabel)
 Convert a page label to a page number. More...
 
int getOutlineNumChildren (XpdfOutlineHandle outline)
 Return the number of children of an outline tree node. More...
 
XpdfOutlineHandle getOutlineChild (XpdfOutlineHandle outline, int idx)
 Return a child of an outline tree node. More...
 
XpdfOutlineHandle getOutlineParent (XpdfOutlineHandle outline)
 Return the parent of an outline tree node. More...
 
QString getOutlineTitle (XpdfOutlineHandle outline)
 Get the title of an outline tree node. More...
 
bool getOutlineStartsOpen (XpdfOutlineHandle outline)
 Return true if the specified outline entry starts open. More...
 
int getOutlineTargetPage (XpdfOutlineHandle outline)
 Return the target page number for the specified outline entry. More...
 
void gotoOutlineTarget (XpdfOutlineHandle outline)
 Jump to the target of the specified outline entry. More...
 
int getNumLayers () const
 Return the number of layers in the PDF file. More...
 
XpdfLayerHandle getLayer (int idx) const
 Get a layer handle. More...
 
QString getLayerName (XpdfLayerHandle layer) const
 Get the name of a layer. More...
 
bool getLayerVisibility (XpdfLayerHandle layer) const
 Get the visibility state of a layer. More...
 
void setLayerVisibility (XpdfLayerHandle layer, bool visibility)
 Set the visibility state of a layer. More...
 
int getLayerViewState (XpdfLayerHandle layer) const
 Get the suggested state for this layer in viewing mode. More...
 
int getLayerPrintState (XpdfLayerHandle layer) const
 Get the suggested state for this layer in printing mode. More...
 
XpdfLayerOrderHandle getLayerOrderRoot () const
 Get the root of the layer display order tree. More...
 
bool getLayerOrderIsName (XpdfLayerOrderHandle order) const
 Check the type of a layer display order tree node. More...
 
QString getLayerOrderName (XpdfLayerOrderHandle order) const
 Get the name of a layer display order tree node. More...
 
XpdfLayerHandle getLayerOrderLayer (XpdfLayerOrderHandle order)
 Get the layer associated with a layer display order tree node. More...
 
int getLayerOrderNumChildren (XpdfLayerOrderHandle order)
 Returns the number of children attached to a layer display order tree node. More...
 
XpdfLayerOrderHandle getLayerOrderChild (XpdfLayerOrderHandle order, int idx)
 Returns the idx 'th child of a layer display order tree node. More...
 
XpdfLayerOrderHandle getLayerOrderParent (XpdfLayerOrderHandle order)
 Return the parent of a layer display order tree node. More...
 
int getNumEmbeddedFiles ()
 Return the number of embedded files in the current PDF file. More...
 
QString getEmbeddedFileName (int idx)
 Return the name of the idx 'th embedded file. More...
 
bool saveEmbeddedFile (int idx, QString fileName)
 Save the idx 'th embedded file with the specified file name. More...
 
void pageChange (int pageNum)
 This signal is emitted whenever the viewer displays a new page. More...
 
void midPageChange (int pageNum)
 This signal is emitted whenever the page shown at the middle of the window changes. More...
 
void preLoad ()
 This signal is emitted just before a PDF file is loaded. More...
 
void postLoad ()
 This signal is emitted just after a PDF file is loaded. More...
 
void keyPress (QKeyEvent *e)
 This signal is emitted whenever a key is pressed. More...
 
void mousePress (QMouseEvent *e)
 This signal is emitted whenever a mouse button is pressed. More...
 
void mouseRelease (QMouseEvent *e)
 This signal is emitted whenever a mouse button is released. More...
 
void mouseClick (QMouseEvent *e)
 This signal is emitted whenever a mouse button is clicked. More...
 
void mouseDoubleClick (QMouseEvent *e)
 This signal is emitted whenever a mouse button is double-clicked. More...
 
void mouseTripleClick (QMouseEvent *e)
 This signal is emitted whenever a mouse button is triple-clicked. More...
 
void mouseMove (QMouseEvent *e)
 This signal is emitted whenever the mouse pointer is moved. More...
 
void mouseWheel (QWheelEvent *e)
 This signal is emitted whenever a mouse wheel is clicked. More...
 
void linkClick (const QString &linkType, const QString &dest, int page)
 This signal is emitted whenever the user clicks on a hyperlink. More...
 
void selectDone ()
 This signal is emitted when the user selects an area. More...
 
void paintDone (bool finished)
 This signal is emitted whenever the widget is repainted. More...
 
void resized ()
 This signal is emitted when the widget is resized. More...
 

Detailed Description

A PDF viewer widget class for Qt.

Member Enumeration Documentation

◆ DisplayMode

Display modes, to be passed to XpdfWidget::setDisplayMode().

Enumerator
pdfDisplaySingle 

single page

pdfDisplayContinuous 

pages stacked vertically

pdfDisplaySideBySideSingle 

two facing pages

pdfDisplaySideBySideContinuous 

facing pages, stacked vertically

pdfDisplayHorizontalContinuous 

pages stacked horizontally

◆ ErrorCode

Error codes returned by certain XpdfViewer functions.

Enumerator
pdfOk 

no error

pdfErrOpenFile 

couldn't open the PDF file

pdfErrBadCatalog 

couldn't read the page catalog

pdfErrDamaged 

PDF file was damaged and couldn't be repaired.

pdfErrEncrypted 

file was encrypted and password was incorrect or not supplied

pdfErrHighlightFile 

nonexistent or invalid highlight file

pdfErrBadPrinter 

invalid printer

pdfErrPrinting 

error during printing

pdfErrPermission 

PDF file doesn't allow that operation.

pdfErrBadPageNum 

invalid page number

pdfErrFileIO 

file I/O error

pdfErrNoHandle 

NULL object handle.

pdfErrOutOfMemory 

out of memory

pdfErrBusy 

PDF component is busy.

pdfErrBadArg 

invalid argument

◆ ImageColorMode

Color modes, to be passed to the image conversion functions.

These can be used with XpdfWidget::convertPageToImage() and XpdfWidget::convertRegionToImage().

Constructor & Destructor Documentation

◆ XpdfWidget() [1/2]

XpdfWidget::XpdfWidget ( const QColor &  paperColor = QColor(0xff, 0xff, 0xff),
const QColor &  matteColor = QColor(0x80, 0x80, 0x80),
bool  reverseVideo = false,
QWidget *  parentA = 0 
)

The XpdfWidget constructor.

Parameters
paperColorthe paper background color (which should generally be left as white)
matteColorthe matte color displayed between pages, and around pages that are smaller than the window
reverseVideosets reverse video at startup
parentAthe parent QWidget

◆ XpdfWidget() [2/2]

XpdfWidget::XpdfWidget ( QWidget *  parentA,
const QColor &  paperColor = QColor(0xff, 0xff, 0xff),
const QColor &  matteColor = QColor(0x80, 0x80, 0x80),
bool  reverseVideo = false 
)

The XpdfWidget constructor.

Parameters
paperColorthe paper background color (which should generally be left as white)
matteColorthe matte color displayed between pages, and around pages that are smaller than the window
reverseVideosets reverse video at startup
parentAthe parent QWidget This version has the parent argument first so it works correctly with Qt Designer.

◆ ~XpdfWidget()

virtual XpdfWidget::~XpdfWidget ( )
virtual

Destroys the XpdfWidget.

Member Function Documentation

◆ clearSelection()

void XpdfWidget::clearSelection ( )

Clear the selection.

◆ closeFile()

void XpdfWidget::closeFile ( )

Close the currently open PDF file (if any).

Calling this function is optional - the current PDF file will be automatically closed if XpdfWidget::loadFile or XpdfWidget::loadMem is called.

◆ convertPageToImage()

QImage XpdfWidget::convertPageToImage ( int  page,
double  dpi,
bool  transparent = false,
ImageColorMode  color = pdfImageColorRGB 
)

Convert a page to an image.

This function converts page number page to a bitmap, at a resolution of dpi dots per inch. The image is 24-bit RGB if color is pdfImageColorRGB, 8-bit grayscale if color is pdfImageColorGray, or 1-bit monochrome if color is pdfImageColorMono. If transparent is true and color is pdfImageColorRGB, the returned image will be 32-bit ARGB instead, and will include an alpha channel.

◆ convertPDFToWindowCoords()

void XpdfWidget::convertPDFToWindowCoords ( int  page,
double  pdfX,
double  pdfY,
int *  winX,
int *  winY 
)

Convert PDF coordinates to window coordinates.

◆ convertRegionToImage()

QImage XpdfWidget::convertRegionToImage ( int  page,
double  x0,
double  y0,
double  x1,
double  y1,
double  dpi,
bool  transparent = false,
ImageColorMode  color = pdfImageColorRGB 
)

Convert a rectangular region of a page to an image.

This function converts a rectangular region, defined by corners (x0,y0) and (x1,y1), of page number page to a bitmap, at a resolution of dpi dots per inch. The image is 24-bit RGB if color is pdfImageColorRGB, 8-bit grayscale if color is pdfImageColorGray, or 1-bit monochrome if color is pdfImageColorMono. If transparent is true and color is pdfImageColorRGB, the returned image will be 32-bit ARGB instead, and will include an alpha channel.

◆ convertWindowToPDFCoords()

bool XpdfWidget::convertWindowToPDFCoords ( int  winX,
int  winY,
int *  page,
double *  pdfX,
double *  pdfY 
)

Convert window coordinates to PDF coordinates.

Returns true if successful, i.e., if the specified point falls on a PDF page.

◆ copySelection()

void XpdfWidget::copySelection ( )

Copy the current selection to the clipboard.

◆ enableExternalHyperlinks()

void XpdfWidget::enableExternalHyperlinks ( bool  on)

Control handling of external hyperlinks.

This setting allows disabling external hyperlinks (links that open another PDF file, or that involve a URL), independent of internal hyperlinks (links to locations within the same PDF file). This setting is ignored if all hyperlinks are disabled (enableHyperlinks(false)). The default is enabled.

◆ enableHyperlinks()

void XpdfWidget::enableHyperlinks ( bool  on)

Control handling of hyperlinks.

If enabled, the viewer will follow hyperlinks when clicked with the left mouse button. If disabled, the viewer will ignore left mouse button clicks on hyperlinks. The default is enabled.

◆ enablePan()

void XpdfWidget::enablePan ( bool  on)

Control mouse panning.

If enabled, dragging with the middle mouse button pressed will pan the page. If disabled, the middle button is ignored. The default is enabled.

◆ enableRedraw()

void XpdfWidget::enableRedraw ( bool  enable)

Enable or disable window redraws.

This is useful, e.g., for avoiding extra redraws during window resizing. Deprecated – this just calls setUpdatesEnabled().

◆ enableSelect()

void XpdfWidget::enableSelect ( bool  on)

Control handling of text selection.

If enabled, the viewer will allow the user to select rectangular regions of text when the user drags with the left mouse button. If disabled, dragging with the left mouse button is ignored. The default is enabled.

◆ enableTouchPan()

void XpdfWidget::enableTouchPan ( bool  on)

Control touchscreen panning.

If enabled, QPanGestures are recognized and used to pan the PDF view.

◆ enableTouchZoom()

void XpdfWidget::enableTouchZoom ( bool  on)

Control touchscreen zooming.

If enabled QPinchGestures are recognized and used to pinch-zoom the PDF view.

◆ extractText()

QString XpdfWidget::extractText ( int  page,
double  x0,
double  y0,
double  x1,
double  y1 
)

Extract text from a region of a page.

This function extracts and returns text from the rectangular region, defined by corners (x0,y0) and (x1,y1), of page number page. The coordinates returned by XpdfWidget::getCurrentSelection may be passed directly to this function. Returns an empty string if no file is open or if text extraction is not allowed.

◆ find()

bool XpdfWidget::find ( const QString &  text,
int  flags = 0 
)

Find a text string.

This function searches for a Unicode text string. Starts searching after (before, if searching backward) the current selection (if there is a selection), or at the top (bottom, if searching backward) of the current page (if there is no selection). The flags argument consists of zero or more of the following, or-ed together:

  • findBackward - search backward from the starting point
  • findCaseSensitive - perform a case-sensitive search (default is case-insensitive)
  • findNext - start searching from the previous search result
  • findOnePageOnly - limit the search to the current page
  • findWholeWord - limit the search to whole words

◆ findAll()

QVector< XpdfFindResult > XpdfWidget::findAll ( const QString &  text,
int  firstPage,
int  lastPage,
int  flags = 0 
)

Find all occurrences of a text string.

This function searches for a Unicode text string, in pages firstPage .. lastPage. The flags argument consists of zero or more of the following, or-ed together:

  • findCaseSensitive - perform a case-sensitive search (default is case-insensitive)
  • findWholeWord - limit the search to whole words Returns a list of search results.

◆ forceRedraw()

void XpdfWidget::forceRedraw ( )

Force a complete redraw.

◆ freeDoc()

void XpdfWidget::freeDoc ( XpdfDocHandle  doc)

Free a PDF document.

This function frees a PDF document handle created by XpdfWidget::readDoc. It should only be called if the document is not going to be displayed. That is: after calling XpdfWidget::readDoc, you should call either XpdfWidget::loadDoc or XpdfWidget::freeDoc. The document handle should not be used for anything else after calling this function.

◆ getAnnotContent()

QString XpdfWidget::getAnnotContent ( XpdfAnnotHandle  annot)

Get the annotation's content.

Usage of this depends on the annotation type.

◆ getAnnotType()

QString XpdfWidget::getAnnotType ( XpdfAnnotHandle  annot)

Get the annotation type.

◆ getContinuousMode()

bool XpdfWidget::getContinuousMode ( ) const

Return true if the viewer is in continuous view mode, or false if it is in any other mode.

Deprecated: see getDisplayMode().

◆ getCurrentPage()

int XpdfWidget::getCurrentPage ( ) const

Return the currently displayed page number.

Returns -1 if no file is open.

◆ getCurrentSelection()

bool XpdfWidget::getCurrentSelection ( int *  page,
double *  x0,
double *  y0,
double *  x1,
double *  y1 
) const

Returns the current selection.

If there is a currently active selection, sets *page, (*x0,*y0), and (*x1,*y1) to the page number and upper-left and lower-right coordinates, respectively, and returns true. If there is no selection, returns false.

◆ getDisplayMode()

DisplayMode XpdfWidget::getDisplayMode ( )

Return the current display mode.

◆ getEmbeddedFileName()

QString XpdfWidget::getEmbeddedFileName ( int  idx)

Return the name of the idx 'th embedded file.

◆ getFileName()

QString XpdfWidget::getFileName ( ) const

Get the file name of the currently open PDF file.

◆ getFormFieldBBox()

void XpdfWidget::getFormFieldBBox ( XpdfFormFieldHandle  field,
int *  pageNum,
double *  xMin,
double *  yMin,
double *  xMax,
double *  yMax 
)

Get the form field's bounding box.

◆ getFormFieldName()

QString XpdfWidget::getFormFieldName ( XpdfFormFieldHandle  field)

Get the form field's name.

◆ getFormFieldType()

QString XpdfWidget::getFormFieldType ( XpdfFormFieldHandle  field)

Get the form field's type.

◆ getFormFieldValue()

QString XpdfWidget::getFormFieldValue ( XpdfFormFieldHandle  field)

Get the form field's content.

Usage of this depends on the field type.

◆ getLayer()

XpdfLayerHandle XpdfWidget::getLayer ( int  idx) const

Get a layer handle.

This function returns a handle for the idx 'th layer.

◆ getLayerName()

QString XpdfWidget::getLayerName ( XpdfLayerHandle  layer) const

Get the name of a layer.

This function returns the title of layer.

◆ getLayerOrderChild()

XpdfLayerOrderHandle XpdfWidget::getLayerOrderChild ( XpdfLayerOrderHandle  order,
int  idx 
)

Returns the idx 'th child of a layer display order tree node.

◆ getLayerOrderIsName()

bool XpdfWidget::getLayerOrderIsName ( XpdfLayerOrderHandle  order) const

Check the type of a layer display order tree node.

Returns true if the specified node of the layer display order tree is a name; false if the node is a layer.

◆ getLayerOrderLayer()

XpdfLayerHandle XpdfWidget::getLayerOrderLayer ( XpdfLayerOrderHandle  order)

Get the layer associated with a layer display order tree node.

◆ getLayerOrderName()

QString XpdfWidget::getLayerOrderName ( XpdfLayerOrderHandle  order) const

Get the name of a layer display order tree node.

This should only be called if getLayerOrderIsName returns true.

◆ getLayerOrderNumChildren()

int XpdfWidget::getLayerOrderNumChildren ( XpdfLayerOrderHandle  order)

Returns the number of children attached to a layer display order tree node.

◆ getLayerOrderParent()

XpdfLayerOrderHandle XpdfWidget::getLayerOrderParent ( XpdfLayerOrderHandle  order)

Return the parent of a layer display order tree node.

This function returns the parent of node order, or NULL if order is the root node.

◆ getLayerOrderRoot()

XpdfLayerOrderHandle XpdfWidget::getLayerOrderRoot ( ) const

Get the root of the layer display order tree.

◆ getLayerPrintState()

int XpdfWidget::getLayerPrintState ( XpdfLayerHandle  layer) const

Get the suggested state for this layer in printing mode.

This function returns one of:

  • 1: on
  • 0: off
  • -1: unset

◆ getLayerViewState()

int XpdfWidget::getLayerViewState ( XpdfLayerHandle  layer) const

Get the suggested state for this layer in viewing mode.

This function returns one of:

  • 1: on
  • 0: off
  • -1: unset

◆ getLayerVisibility()

bool XpdfWidget::getLayerVisibility ( XpdfLayerHandle  layer) const

Get the visibility state of a layer.

Returns true if the layer is currently visible, false if not.

◆ getLinkInfo()

QString XpdfWidget::getLinkInfo ( int  page,
double  xx,
double  yy 
)

Get destination information for the hyperlink at the specified page and coordinates.

If there is a link at the specified point, returns a string suitable for displaying to a user; otherwise returns an empty string. Note: This function expects PDF coordinates, not window coordinates.

◆ getMidPage()

int XpdfWidget::getMidPage ( ) const

Return the page number corresponding to the middle of the window.

◆ getMouseLinkInfo()

QString XpdfWidget::getMouseLinkInfo ( )

Get destination information for the hyperlink under the mouse.

If the mouse is currently over a hyperlink, return an info string (same as with getLinkInfo()); otherwise return an empty string.

◆ getNumEmbeddedFiles()

int XpdfWidget::getNumEmbeddedFiles ( )

Return the number of embedded files in the current PDF file.

◆ getNumLayers()

int XpdfWidget::getNumLayers ( ) const

Return the number of layers in the PDF file.

Note that a PDF file can have zero or more layers.

◆ getNumPages()

int XpdfWidget::getNumPages ( ) const

Return the number of pages in the currently open PDF file.

Returns -1 if no file is open.

◆ getOutlineChild()

XpdfOutlineHandle XpdfWidget::getOutlineChild ( XpdfOutlineHandle  outline,
int  idx 
)

Return a child of an outline tree node.

This function returns the idx 'th child of node outline, or the idx 'th root entry if outline is NULL.

◆ getOutlineNumChildren()

int XpdfWidget::getOutlineNumChildren ( XpdfOutlineHandle  outline)

Return the number of children of an outline tree node.

This function returns the number of children of node outline, or the number of root outline entries if outline is NULL.

◆ getOutlineParent()

XpdfOutlineHandle XpdfWidget::getOutlineParent ( XpdfOutlineHandle  outline)

Return the parent of an outline tree node.

This function returns the parent of node outline, or NULL if outline is a root item.

◆ getOutlineStartsOpen()

bool XpdfWidget::getOutlineStartsOpen ( XpdfOutlineHandle  outline)

Return true if the specified outline entry starts open.

◆ getOutlineTargetPage()

int XpdfWidget::getOutlineTargetPage ( XpdfOutlineHandle  outline)

Return the target page number for the specified outline entry.

◆ getOutlineTitle()

QString XpdfWidget::getOutlineTitle ( XpdfOutlineHandle  outline)

Get the title of an outline tree node.

This function returns the title of node outline.

◆ getPageBox()

void XpdfWidget::getPageBox ( int  page,
const QString &  box,
double *  xMin,
double *  yMin,
double *  xMax,
double *  yMax 
) const

Return the coordinates of the specified page box.

Parameters
pagethe page number
boxthe requested page box - one of "media", "crop", "bleed", "trim", or "art" (box is not case-sensitive)
*xMinreturns the minimum x coordinate of the box
*yMinreturns the minimum y coordinate of the box
*xMaxreturns the maximum x coordinate of the box
*yMaxreturns the maximum y coordinate of the box

All coordinates are in points (1 point = 1/72 inch).

◆ getPageHeight()

double XpdfWidget::getPageHeight ( int  page) const

Return the height of the specified page.

This function returns the crop box height, measured in points (1 point = 1/72 inch).

◆ getPageLabelFromPageNum()

QString XpdfWidget::getPageLabelFromPageNum ( int  pageNum)

Convert a page number to a page label.

Return the page label for page number pageNum. Returns an empty string if the page number is invalid or if the PDF file doesn't have page labels.

◆ getPageNumFromPageLabel()

int XpdfWidget::getPageNumFromPageLabel ( QString  pageLabel)

Convert a page label to a page number.

Return the page number for pageLabel. Returns -1 if there is no matching page label or if the PDF file doesn't have page labels.

◆ getPageRotation()

int XpdfWidget::getPageRotation ( int  page) const

Get the default rotation for the specified page.

This is the default viewing rotation specified in the PDF file - it will be one of 0, 90, 180, or 270.

◆ getPageWidth()

double XpdfWidget::getPageWidth ( int  page) const

Return the width of the specified page.

This function returns the crop box width, measured in points (1 point = 1/72 inch).

◆ getRotate()

int XpdfWidget::getRotate ( ) const

Return the current page rotation.

The angle can be 0, 90, 180, or 270.

◆ getScrollX()

int XpdfWidget::getScrollX ( ) const

Return the current scroll position x coordinate.

◆ getScrollY()

int XpdfWidget::getScrollY ( ) const

Return the current scroll position y coordinate.

◆ getSelectedText()

QString XpdfWidget::getSelectedText ( )

Get the currently selected text.

Returns an empty string if there is no selection (or if there is no text in the selected region).

◆ getThumbnail()

QImage XpdfWidget::getThumbnail ( int  page)

Retrieve an embedded thumbnail image.

This function returns the embedded thumbnail image for the specified page, or a null image if there is no embedded thumbnail. This function does not do any rasterization – it only returns a non-null image if there is an embedded thumbnail in the PDF file.

◆ getZoom()

double XpdfWidget::getZoom ( ) const

Return the current zoom factor.

This can be a percentage factor or one of the special values, XpdfWidget::zoomToPage or XpdfWidget::zoomToWidth.

◆ getZoomPercent()

double XpdfWidget::getZoomPercent ( int  page = 1) const

Return the current zoom factor as a percentage.

If the zoom is set to XpdfWidget::zoomToPage or XpdfWidget::zoomToWidth, returns the computed zoom percentage for the specified page, based on the current window size.

◆ goBackward()

void XpdfWidget::goBackward ( )

Go backward along the history list.

◆ goForward()

void XpdfWidget::goForward ( )

Go forward along the history list.

◆ gotoFirstPage()

void XpdfWidget::gotoFirstPage ( )

Display the first page.

This is equivalent to

void gotoPage(int pageNum)
Display the specified page.

◆ gotoLastPage()

void XpdfWidget::gotoLastPage ( )

Display the last page.

This is equivalent to

int getNumPages() const
Return the number of pages in the currently open PDF file.

◆ gotoLinkAt()

bool XpdfWidget::gotoLinkAt ( int  page,
double  xx,
double  yy 
)

Activate the link (if any) at the specified page and coordinates.

Returns true if successful. Note: This function expects PDF coordinates, not window coordinates.

◆ gotoNamedDestination()

bool XpdfWidget::gotoNamedDestination ( const QString &  dest)

Go to a named destination.

◆ gotoNextPage()

void XpdfWidget::gotoNextPage ( bool  scrollToTop = true)

Display the next page.

◆ gotoOutlineTarget()

void XpdfWidget::gotoOutlineTarget ( XpdfOutlineHandle  outline)

Jump to the target of the specified outline entry.

◆ gotoPage()

void XpdfWidget::gotoPage ( int  pageNum)

Display the specified page.

◆ gotoPreviousPage()

void XpdfWidget::gotoPreviousPage ( bool  scrollToTop = true)

Display the previous page.

◆ hasOpenDocument()

bool XpdfWidget::hasOpenDocument ( ) const

Returns true if there is currently a PDF file open.

◆ hasPageLabels()

bool XpdfWidget::hasPageLabels ( )

Check if the PDF file has page labels.

Return true if the currently open PDF file has page labels.

◆ hasSelection()

bool XpdfWidget::hasSelection ( )

Check to see if there is a selection.

Returns true if there is a currently active selection.

◆ init()

static void XpdfWidget::init ( const QString &  configFileName = QString())
static

Initialize the XpdfWidget class, reading a configuration file.

If configFileName is non-empty, the specified file is tried first. If configFileName is empty, or the file doesn't exist, the default location is tried (<exe-dir>/xpdfrc on Windows; ~/.xpdfrc on Unix).

This function must be called before any other XpdfWidget functions (including the constructor). It will be called automatically (with a NULL configFileName) if it hasn't already been called when the first XpdfWidget function is used.

◆ isBlockSelectMode()

bool XpdfWidget::isBlockSelectMode ( )

Check for block selection mode.

Returns true if the current selection mode is block.

◆ isLinearSelectMode()

bool XpdfWidget::isLinearSelectMode ( )

Check for linear selection mode.

Returns true if the current selection mode is linear.

◆ keyPress

void XpdfWidget::keyPress ( QKeyEvent *  e)
signal

This signal is emitted whenever a key is pressed.

◆ linkClick

void XpdfWidget::linkClick ( const QString &  linkType,
const QString &  dest,
int  page 
)
signal

This signal is emitted whenever the user clicks on a hyperlink.

Parameters
linkTypethe type of link - one of:
  • "goto": a link to another page in the same PDF file - dest is empty; page is the destination page number
  • "pdf": a link to another PDF file - dest is the target PDF file; page is 0
  • "launch": an arbitrary command to be run - dest is the command; page is 0
  • "url": a URL link - dest is the URL; page is 0
  • "named": a "named action" link - dest is the action (see the PDF spec for details); page is 0
  • "unknown": an unknown link type - dest is empty; page is 0
destdestination string
pagedestination page number

◆ loadDoc()

ErrorCode XpdfWidget::loadDoc ( XpdfDocHandle  doc)

Load a PDF document and display its first page.

This function displays a PDF document handle created by XpdfWidget::readDoc. The document handle should not be used for anything else after calling this function.

Returns
pdfOk if successful; an error code, otherwise

◆ loadFile()

ErrorCode XpdfWidget::loadFile ( const QString &  fileName,
const QString &  password = "" 
)

Load a PDF file and display its first page.

Parameters
fileNamethe PDF file to load
passworda string to be tried first as the owner password and then as the user password
Returns
pdfOk if successful; an error code, otherwise

◆ loadMem()

ErrorCode XpdfWidget::loadMem ( const char *  buffer,
unsigned int  bufferLength,
const QString &  password = "" 
)

Load a PDF file from a memory buffer and display its first page.

Parameters
bufferthe PDF file in memory
bufferLengthlength of buffer
passworda string to be tried first as the owner password and then as the user password
Returns
pdfOk if successful; an error code otherwise

◆ midPageChange

void XpdfWidget::midPageChange ( int  pageNum)
signal

This signal is emitted whenever the page shown at the middle of the window changes.

It is similar to XpdfWidget::pageChange, except that it reflects the page shown at the middle of the window (instead of the page at the top of the window).

◆ mouseClick

void XpdfWidget::mouseClick ( QMouseEvent *  e)
signal

This signal is emitted whenever a mouse button is clicked.

A click is defined as a button press and release within a short distance of each other (a few pixels). The sequence of signals is: mousePress, possibly a few mouseMoves, mouseRelease, and then mouseClick.

◆ mouseDoubleClick

void XpdfWidget::mouseDoubleClick ( QMouseEvent *  e)
signal

This signal is emitted whenever a mouse button is double-clicked.

Double clicks are two clicks within a few pixels of each other, and within a certain time of each other. The sequence of signals is: mousePress, mouseRelease, mouseClick, mousePress, mouseRelease, mouseDoubleClick. There may also be mouseMoves between the presses and releases.

◆ mouseMove

void XpdfWidget::mouseMove ( QMouseEvent *  e)
signal

This signal is emitted whenever the mouse pointer is moved.

◆ mouseOverLink()

bool XpdfWidget::mouseOverLink ( )

Returns true if the mouse is currently over a hyperlink.

◆ mousePress

void XpdfWidget::mousePress ( QMouseEvent *  e)
signal

This signal is emitted whenever a mouse button is pressed.

◆ mouseRelease

void XpdfWidget::mouseRelease ( QMouseEvent *  e)
signal

This signal is emitted whenever a mouse button is released.

◆ mouseTripleClick

void XpdfWidget::mouseTripleClick ( QMouseEvent *  e)
signal

This signal is emitted whenever a mouse button is triple-clicked.

Triple clicks are three clicks within a few pixels of each other, and within a certain time of each other. The sequence of signals is: mousePress, mouseRelease, mouseClick, mousePress, mouseRelease, mouseDoubleClick, mousePress, mouseRelease, mouseTripleClick. There may also be mouseMoves between the presses and releases.

◆ mouseWheel

void XpdfWidget::mouseWheel ( QWheelEvent *  e)
signal

This signal is emitted whenever a mouse wheel is clicked.

◆ okToExtractText()

bool XpdfWidget::okToExtractText ( ) const

Checks to see if text extraction is allowed.

This function returns false if the currently displayed PDF file is encrypted and does not allow extraction of text (or if no PDF file is currently open). The owner password can be used to circumvent this: if a valid owner password was supplied to XpdfWidget::loadFile, this function will always return true. If this function returns false, the text extraction functions will not return any text.

◆ onAnnot()

XpdfAnnotHandle XpdfWidget::onAnnot ( int  page,
double  xx,
double  yy 
)

Check for an annotation containing the specified point.

Returns NULL if there is no annotation at this point. Note: This function expects PDF coordinates, not window coordinates.

◆ onFormField()

XpdfFormFieldHandle XpdfWidget::onFormField ( int  page,
double  xx,
double  yy 
)

Check for a form field containing the specified point.

Returns NULL if there is no annotation at this point. Note: This function expects PDF coordinates, not window coordinates.

◆ onLink()

bool XpdfWidget::onLink ( int  page,
double  xx,
double  yy 
)

Returns true if the specified coordinates are inside a hyperlink.

Note: This function expects PDF coordinates, not window coordinates.

◆ pageChange

void XpdfWidget::pageChange ( int  pageNum)
signal

This signal is emitted whenever the viewer displays a new page.

It can be triggered by user actions (e.g., the PageDown button), or program control (e.g., the gotoNextPage function).

Parameters
pageNum- the new page number

◆ paintDone

void XpdfWidget::paintDone ( bool  finished)
signal

This signal is emitted whenever the widget is repainted.

finished is true if the painted view is complete, or false if this was an incremental update, i.e., if the view is still being rendered.

◆ postLoad

void XpdfWidget::postLoad ( )
signal

This signal is emitted just after a PDF file is loaded.

◆ preLoad

void XpdfWidget::preLoad ( )
signal

This signal is emitted just before a PDF file is loaded.

◆ readDoc()

ErrorCode XpdfWidget::readDoc ( XpdfDocHandle docPtr,
const QString &  fileName,
const QString &  password = "" 
)

Load a PDF file and return a handle.

This function can be safely called from a non-GUI thread. Use XpdfWidget::loadDoc (on the GUI thread) to load the document handle into the viewer. The handle returned in *docPtr should be passed to either XpdfWidget::loadDoc or XpdfWidget::freeDoc.

Calling XpdfWidget::readDoc + XpdfWidget::loadDoc is equivalent to calling XpdfWidget::loadFile. The difference is that readDoc can be called on a background thread to avoid stalling the user interface.

Parameters
docPtrthe PDF document handle will be returned her
fileNamethe PDF file to load
passworda string to be tried first as the owner password and then as the user password
Returns
pdfOk if successful; an error code, otherwise

◆ reload()

ErrorCode XpdfWidget::reload ( )

Reload the current PDF file.

This reloads the current PDF file, maintaining the zoom and scroll position (if possible). This only works if the PDF file was loaded from a file (i.e., with XpdfWidget::loadFile, not with XpdfWidget::loadMem).

Returns
pdfOk if successful; an error code otherwise

◆ resized

void XpdfWidget::resized ( )
signal

This signal is emitted when the widget is resized.

◆ saveAs()

ErrorCode XpdfWidget::saveAs ( const QString &  fileName)

Save the PDF file with another name.

Parameters
fileNamethe file to be written
Returns
pdfOk if successful; an error code otherwise

◆ saveEmbeddedFile()

bool XpdfWidget::saveEmbeddedFile ( int  idx,
QString  fileName 
)

Save the idx 'th embedded file with the specified file name.

Returns true if successful.

◆ scrollBy()

void XpdfWidget::scrollBy ( int  dx,
int  dy 
)

Scroll the page by (dx,dy) pixels.

If dx is positive, scrolls right; if dx is negative, scrolls left. Similarly, positive and negative values of dy scroll down and up, respectively.

◆ scrollPageDown()

void XpdfWidget::scrollPageDown ( )

Scroll one screen down.

◆ scrollPageUp()

void XpdfWidget::scrollPageUp ( )

Scroll one screen up.

◆ scrollTo()

void XpdfWidget::scrollTo ( int  xx,
int  yy 
)

Scroll the page so that the top-left corner of the window is (xx,yy) pixels from the top-left corner of the PDF page.

◆ selectDone

void XpdfWidget::selectDone ( )
signal

This signal is emitted when the user selects an area.

Use XpdfWidget::getCurrentSelection to retrieve the selection.

◆ setBlockSelectMode()

void XpdfWidget::setBlockSelectMode ( )

Set block selection mode.

In this mode, the selection is a simple rectangle. Any part of the page can be selected, regardless of the content on the page.

◆ setConfig()

static void XpdfWidget::setConfig ( const QString &  command)
static

Process a configuration command, i.e., one line of an xpdfrc file.

Note that this applies globally to all XpdfWidget instances.

◆ setContinuousMode()

void XpdfWidget::setContinuousMode ( bool  continuous)

Set continuous or single-page view mode.

Deprecated: this is equivalent to calling setDisplayMode() with pdfDisplaySingle or pdfDisplayContinuous.

Parameters
continuoustrue for continous view mode, false for single-page view mode

◆ setCurrentSelection()

void XpdfWidget::setCurrentSelection ( int  page,
double  x0,
double  y0,
double  x1,
double  y1 
)

Set the selection.

Sets the current selection to the rectangle with upper-left corner (x0,y0) and lower-right corner (x1,y1) on page.

◆ setCursor()

void XpdfWidget::setCursor ( const QCursor &  cursor)

Set the cursor.

The requested cursor will only be displayed in the viewport (not in the scrollbars).

◆ setDisplayMode()

void XpdfWidget::setDisplayMode ( DisplayMode  mode)

Set the display mode.

◆ setKeyPassthrough()

void XpdfWidget::setKeyPassthrough ( bool  on)
inline

Control keypress passthrough.

If enabled, XpdfWidget will pass keypress events through to the keyPress signal, with no other processing. If disabled, XpdfWidget will implement some built-in key bindings. The default is disabled.

◆ setLayerVisibility()

void XpdfWidget::setLayerVisibility ( XpdfLayerHandle  layer,
bool  visibility 
)

Set the visibility state of a layer.

Parameters
layerthe layer handle
visibilitythe new state - true for visible, false for not visible

◆ setLinearSelectMode()

void XpdfWidget::setLinearSelectMode ( )

Set linear selection mode.

In this mode, the selection follows text. Non-text regions cannot be selected.

◆ setMatteColor()

void XpdfWidget::setMatteColor ( const QColor &  matteColor)

Set the matte color, i.e., the color used for background outside the actual page area.

The default is a medium gray.

◆ setMousePassthrough()

void XpdfWidget::setMousePassthrough ( bool  on)
inline

Control mouse event passthrough.

If enabled, XpdfWidget will pass mouse events through to the mousePress/mouseRelease signals, with no other processing. If disabled, XpdfWidget will implement some built-in mouse handling (in addition to sending the signals). The default is disabled.

◆ setReverseVideo()

void XpdfWidget::setReverseVideo ( bool  reverse)

Turn reverse video mode on/off. The default is off.

◆ setRotate()

void XpdfWidget::setRotate ( int  rotate)

Change the page rotation.

Parameters
rotaterotation angle in degrees - must be 0, 90, 180, or 270

◆ setSelectionColor()

void XpdfWidget::setSelectionColor ( const QColor &  selectionColor)

Set the selection color.

◆ setTextEncoding()

void XpdfWidget::setTextEncoding ( const QString &  encodingName)

Set the encoding to use for text extraction.

The following encodings are predefined:

  • "Latin1": ISO-8859-1 (this is the default value)
  • "ASCII7": 7-bit ASCII
  • "UTF-8": Unicode in UTF-8 format
  • "UCS-2": Unicode in UCS-2 format

Additional encodings can be defined via the xpdfrc config file.

◆ setZoom()

void XpdfWidget::setZoom ( double  zoom)

Change the zoom factor.

This can be a percentage factor (where 100 means 72 dpi) or one of the special values, XpdfWidget::zoomToPage or XpdfWidget::zoomToWidth.

◆ showPasswordDialog()

void XpdfWidget::showPasswordDialog ( bool  showDlg)

Control the password dialog.

If enabled, the viewer will show a password dialog for encrypted files; if disabled, it will simply return pdfErrEncrypted unless the correct password is passed to loadFile or loadMem. The default is enabled.

◆ unsetCursor()

void XpdfWidget::unsetCursor ( )

Reset to the default cursor.

◆ zoomCentered()

void XpdfWidget::zoomCentered ( double  zoom)

Set the zoom factor, while maintaining the current center.

Accepts the same zoom values as XpdfWidget::setZoom.

◆ zoomToCurrentWidth()

void XpdfWidget::zoomToCurrentWidth ( )

Zoom so that the current page(s) fill the window width.

Maintains the vertical center.

◆ zoomToRect()

void XpdfWidget::zoomToRect ( int  page,
double  xMin,
double  yMin,
double  xMax,
double  yMax 
)

Zoom in to the specified rectangle.

The coordinate system is the same one used by XpdfWidget::getCurrentSelection. This function will set the zoom factor and scroll position so that the specified rectangle just fits in the window.

Member Data Documentation

◆ findBackward

const int XpdfWidget::findBackward = 0x00000001
static

search backward from the starting point

◆ findCaseSensitive

const int XpdfWidget::findCaseSensitive = 0x00000002
static

perform a case-sensitive search (default is case-insensitive)

◆ findNext

const int XpdfWidget::findNext = 0x00000004
static

start searching from the previous search result

◆ findOnePageOnly

const int XpdfWidget::findOnePageOnly = 0x00000008
static

limit the search to the current page

◆ findWholeWord

const int XpdfWidget::findWholeWord = 0x00000010
static

limit the search to whole words

◆ zoomToHeight

const int XpdfWidget::zoomToHeight = -3
static

zoom to fit page height

◆ zoomToPage

const int XpdfWidget::zoomToPage = -1
static

zoom to fit whole page

◆ zoomToWidth

const int XpdfWidget::zoomToWidth = -2
static

zoom to fit page width


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