PDFPager Class Reference

wrapper for a Poppler::Document, used to select and render pages and thumbnails. More...

#include <pdfpager.h>

List of all members.

Public Slots

void openPDF (QString fpath)
 Open the PDF at the given path, emit opened() and numPages(), then iterate through the pages and emit thumbnail() for each.
void page (int pnum)
 Go to (and render) the given page.
void page (QString pnum)
 Convenience version of page(int) taking a number in string form.
virtual void renderSize (QSize s)
 Re-render the current page at the given size.
virtual void renderSize (const QRectF &s)
 Re-render the current page at the same size as the given rectangle.

Signals

void opened (QString fpath, int numPages)
void numPages (int n)
void rendering (bool t)
void rendered (int pnum, QImage pm)
void pageText (QList< Poppler::TextBox * >)
void pageChanged (int p)
void pageChanged (QString p)
void thumbnail (int pnum, QImage pm, QString label)

Public Member Functions

 PDFPager ()
int page ()
QString path ()
QString plainText ()
 Get the concatenated text of this page, without formatting.

Public Attributes

Poppler::Document * pdf
 The Poppler implementation.
QIntValidator pageRange
 Validator for the page number entry field on the toolbar.

Protected Member Functions

virtual void render (int pnum, QSize renderSize=QSize())
 Rendering implementation.
virtual void renderDone (int pnum, QImage pm)
 Handler for completion of rendering; emits rendering(false) and rendered().

Protected Attributes

int m_pageNum
 Current page number, the last one rendered and presumably showing in the main PDF view.
QSize m_renderSize
 Size at which we will render the next page.
QString m_path
 Path to the pdf as given in openPDF.
QString m_text
 Concatenated text from the page, e.g.


Detailed Description

wrapper for a Poppler::Document, used to select and render pages and thumbnails.

Definition at line 14 of file pdfpager.h.


Constructor & Destructor Documentation

PDFPager::PDFPager (  ) 

Definition at line 4 of file pdfpager.cpp.


Member Function Documentation

void PDFPager::numPages ( int  n  )  [signal]

Referenced by openPDF().

Here is the caller graph for this function:

void PDFPager::opened ( QString  fpath,
int  numPages 
) [signal]

Referenced by openPDF().

Here is the caller graph for this function:

void PDFPager::openPDF ( QString  fpath  )  [slot]

Open the PDF at the given path, emit opened() and numPages(), then iterate through the pages and emit thumbnail() for each.

Finally, go back to page 0 since it will be shown by default.

Todo:
... error message ....

Definition at line 12 of file pdfpager.cpp.

References m_path, numPages(), opened(), page(), pageRange, pdf, and thumbnail().

Referenced by MainWindow::open().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFPager::page ( QString  pnum  )  [inline, slot]

Convenience version of page(int) taking a number in string form.

Definition at line 40 of file pdfpager.h.

References page().

Referenced by page().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFPager::page ( int  pnum  )  [slot]

Go to (and render) the given page.

Definition at line 37 of file pdfpager.cpp.

References m_pageNum, and render().

Here is the call graph for this function:

int PDFPager::page (  )  [inline]

void PDFPager::pageChanged ( QString  p  )  [signal]

void PDFPager::pageChanged ( int  p  )  [signal]

Referenced by render().

Here is the caller graph for this function:

void PDFPager::pageText ( QList< Poppler::TextBox * >   )  [signal]

Referenced by render().

Here is the caller graph for this function:

QString PDFPager::path (  )  [inline]

Definition at line 20 of file pdfpager.h.

References m_path.

QString PDFPager::plainText (  )  [inline]

Get the concatenated text of this page, without formatting.

Definition at line 77 of file pdfpager.h.

References m_text.

Referenced by MainWindow::on_actionExport_triggered().

Here is the caller graph for this function:

void PDFPager::render ( int  pnum,
QSize  renderSize = QSize() 
) [protected, virtual]

Rendering implementation.

Todo:
define model units in terms of points: on load, choose an appropriate resolution and then convert TextBox point units to model units.

Definition at line 53 of file pdfpager.cpp.

References m_renderSize, m_text, MIN, pageChanged(), pageText(), pdf, renderDone(), and rendering().

Referenced by page().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFPager::renderDone ( int  pnum,
QImage  pm 
) [protected, virtual]

Handler for completion of rendering; emits rendering(false) and rendered().

This exists because of an (unimplemented) plan to render higher-resolution thumbnails, and same-resolution page images, in a background thread, in a subclass of this one called PDFPageCache. The completion of rendering would trigger rendering of the next page, in that case.

Definition at line 115 of file pdfpager.cpp.

References rendered(), and rendering().

Referenced by render().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFPager::rendered ( int  pnum,
QImage  pm 
) [signal]

Referenced by renderDone().

Here is the caller graph for this function:

void PDFPager::rendering ( bool  t  )  [signal]

Referenced by render(), and renderDone().

Here is the caller graph for this function:

virtual void PDFPager::renderSize ( const QRectF &  s  )  [inline, virtual, slot]

Re-render the current page at the same size as the given rectangle.

Definition at line 50 of file pdfpager.h.

References renderSize().

Referenced by renderSize().

Here is the call graph for this function:

Here is the caller graph for this function:

void PDFPager::renderSize ( QSize  s  )  [virtual, slot]

Re-render the current page at the given size.

Definition at line 46 of file pdfpager.cpp.

References m_pageNum, m_renderSize, and page().

Here is the call graph for this function:

void PDFPager::thumbnail ( int  pnum,
QImage  pm,
QString  label 
) [signal]

Referenced by openPDF().

Here is the caller graph for this function:


Member Data Documentation

int PDFPager::m_pageNum [protected]

Current page number, the last one rendered and presumably showing in the main PDF view.

Definition at line 103 of file pdfpager.h.

Referenced by page(), and renderSize().

QString PDFPager::m_path [protected]

Path to the pdf as given in openPDF.

Definition at line 113 of file pdfpager.h.

Referenced by openPDF(), and path().

QSize PDFPager::m_renderSize [protected]

Size at which we will render the next page.

Definition at line 108 of file pdfpager.h.

Referenced by render(), and renderSize().

QString PDFPager::m_text [protected]

Concatenated text from the page, e.g.

existing OCR results from the PDF file.

Definition at line 119 of file pdfpager.h.

Referenced by plainText(), and render().

QIntValidator PDFPager::pageRange

Validator for the page number entry field on the toolbar.

Definition at line 72 of file pdfpager.h.

Referenced by MainWindow::MainWindow(), and openPDF().

Poppler::Document* PDFPager::pdf

The Poppler implementation.

Definition at line 67 of file pdfpager.h.

Referenced by MainWindow::on_actionSave_triggered(), openPDF(), and render().


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

Generated on Tue Sep 8 15:09:47 2009 for Taborca by  doxygen 1.5.8