mupdf-qt  0.1
Qt5 interface of the popular PDF library MuPDF
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
MuPDF::Page Class Reference

A page. More...

#include <mupdf-page.h>

Public Member Functions

 ~Page ()
 
bool isValid () const
 Check whether this page object is valid. More...
 
QImage renderImage (float scaleX=1.0f, float scaleY=1.0f, float rotation=0.0f) const
 Render page to QImage. More...
 
QSizeF size () const
 Page size at 72 dpi More...
 
void setTransparentRendering (bool enable)
 Whether to do transparent page rendering. This function modify setting of current page only. For global setting, use Document::setTransparentRendering() instead. More...
 
void setBackgroundColor (int r, int g, int b, int a=255)
 Set background color. This function modify setting of current page only. For global setting, use Document::setBackgroundColor() instead. More...
 
QString text (const QRectF &rect) const
 Return the text in a rect. More...
 
QList< TextBox * > textList () const
 Return all text boxes of the page. More...
 

Friends

class Document
 

Detailed Description

A page.

Note
When you are doing something with this page, make sure the Document who generate this page is valid.

Definition at line 62 of file mupdf-page.h.

Constructor & Destructor Documentation

MuPDF::Page::~Page ( )

Definition at line 174 of file mupdf-page.cpp.

Member Function Documentation

bool MuPDF::Page::isValid ( ) const

Check whether this page object is valid.

Definition at line 223 of file mupdf-page.cpp.

QImage MuPDF::Page::renderImage ( float  scaleX = 1.0f,
float  scaleY = 1.0f,
float  rotation = 0.0f 
) const

Render page to QImage.

Parameters
scaleXscale for X direction (Default value: 1.0f; >1.0f: zoom in; <1.0f: zoom out)
scaleYscale for Y direction (Default value: 1.0f; >1.0f: zoom in; <1.0f: zoom out)
rotationdegree of clockwise rotation (Range: [0.0f, 360.0f))
Returns
This function will return a empty QImage if failed.

Definition at line 239 of file mupdf-page.cpp.

void MuPDF::Page::setBackgroundColor ( int  r,
int  g,
int  b,
int  a = 255 
)

Set background color. This function modify setting of current page only. For global setting, use Document::setBackgroundColor() instead.

Note
This function will only work when page is not transparent. This function won't change content of your file, it only change the way you render the page.
Parameters
rred channel
ggreen channel
bblue channel
aalpha channel(default with non transparent)

Definition at line 365 of file mupdf-page.cpp.

void MuPDF::Page::setTransparentRendering ( bool  enable)

Whether to do transparent page rendering. This function modify setting of current page only. For global setting, use Document::setTransparentRendering() instead.

Parameters
enableTrue: transparent; False: not transparent(default).

Definition at line 346 of file mupdf-page.cpp.

QSizeF MuPDF::Page::size ( ) const

Page size at 72 dpi

Definition at line 331 of file mupdf-page.cpp.

QString MuPDF::Page::text ( const QRectF &  rect) const

Return the text in a rect.

Parameters
rectoriginal rect (72 dpi), not transformed rect

Definition at line 378 of file mupdf-page.cpp.

QList< TextBox * > MuPDF::Page::textList ( ) const

Return all text boxes of the page.

Note
The returned text boxes should be deleted when they are no longer used.
Sizes of the returned text boxes are at 72 dpi.

Definition at line 406 of file mupdf-page.cpp.

Friends And Related Function Documentation

friend class Document
friend

Definition at line 83 of file mupdf-page.h.


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