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::Document Class Reference

#include <mupdf-document.h>

Public Member Functions

 ~Document ()
 Destructor. More...
 
bool needsPassword () const
 Whether the document needs password. More...
 
bool authPassword (const QString &password)
 Authenticate password. More...
 
int numPages () const
 Get number of pages. Return -1 when error occurs. More...
 
Pagepage (int index) const
 Get a page. More...
 
Outlineoutline () const
 The root outline of the document. More...
 
QString pdfVersion () const
 PDF version number, for example: 1.7. More...
 
QString title () const
 PDF title. More...
 
QString author () const
 Author of the document. More...
 
QString subject () const
 The subject of the document. More...
 
QString keywords () const
 Keywords associated with the document. More...
 
QString creator () const
 If the document was converted to PDF from another format, the name of the application (for example, Adobe FrameMaker®) that created the original document from which it was converted. More...
 
QString producer () const
 If the document was converted to PDF from another format, the name of the application (for example, Acrobat Distiller) that converted it to PDF. More...
 
QDateTime creationDate () const
 The date and time the document was created. More...
 
QDateTime modDate () const
 The date and time the document was most recently modified. More...
 
void setTransparentRendering (bool enable)
 Set transparent rendering for all pages. For one page transparent rendering setting, use Page::setTransparentRendering() instead. More...
 
void setBackgroundColor (int r, int g, int b, int a=255)
 Set background color. This function modify global setting of all pages. For particular page setting, use Page::setBackgroundColor() instead. More...
 

Friends

DocumentloadDocument (const QString &filePath)
 Load a document. More...
 
DocumentloadDocument (const QByteArray &bytes)
 Load a document. More...
 

Detailed Description

Definition at line 19 of file mupdf-document.h.

Constructor & Destructor Documentation

MuPDF::Document::~Document ( )

Destructor.

Definition at line 122 of file mupdf-document.cpp.

Member Function Documentation

QString MuPDF::Document::author ( ) const

Author of the document.

Definition at line 238 of file mupdf-document.cpp.

bool MuPDF::Document::authPassword ( const QString &  password)

Authenticate password.

Parameters
passwordUser password or owner password This will first try user password and then owner password. Owner have full access to the document while user don't
Returns
true if succeed, false if failed

Definition at line 145 of file mupdf-document.cpp.

QDateTime MuPDF::Document::creationDate ( ) const

The date and time the document was created.

Definition at line 278 of file mupdf-document.cpp.

QString MuPDF::Document::creator ( ) const

If the document was converted to PDF from another format, the name of the application (for example, Adobe FrameMaker®) that created the original document from which it was converted.

Definition at line 262 of file mupdf-document.cpp.

QString MuPDF::Document::keywords ( ) const

Keywords associated with the document.

Definition at line 254 of file mupdf-document.cpp.

QDateTime MuPDF::Document::modDate ( ) const

The date and time the document was most recently modified.

Definition at line 292 of file mupdf-document.cpp.

bool MuPDF::Document::needsPassword ( ) const

Whether the document needs password.

Definition at line 131 of file mupdf-document.cpp.

int MuPDF::Document::numPages ( ) const

Get number of pages. Return -1 when error occurs.

Definition at line 154 of file mupdf-document.cpp.

Outline * MuPDF::Document::outline ( ) const

The root outline of the document.

Returns
Return NULL if there is no outline.
Note
Delete the returned pointer when it's useless.

Definition at line 203 of file mupdf-document.cpp.

Page * MuPDF::Document::page ( int  index) const

Get a page.

Parameters
indexpage index, begin with 0
Returns
You need delete this manually when it's useless.

Definition at line 175 of file mupdf-document.cpp.

QString MuPDF::Document::pdfVersion ( ) const

PDF version number, for example: 1.7.

Definition at line 221 of file mupdf-document.cpp.

QString MuPDF::Document::producer ( ) const

If the document was converted to PDF from another format, the name of the application (for example, Acrobat Distiller) that converted it to PDF.

Definition at line 270 of file mupdf-document.cpp.

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

Set background color. This function modify global setting of all pages. For particular page setting, use Page::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 329 of file mupdf-document.cpp.

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

Set transparent rendering for all pages. For one page transparent rendering setting, use Page::setTransparentRendering() instead.

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

Definition at line 310 of file mupdf-document.cpp.

QString MuPDF::Document::subject ( ) const

The subject of the document.

Definition at line 246 of file mupdf-document.cpp.

QString MuPDF::Document::title ( ) const

PDF title.

Definition at line 230 of file mupdf-document.cpp.

Friends And Related Function Documentation

Document* loadDocument ( const QString &  filePath)
friend

Load a document.

Parameters
filePathdocument path
Returns
NULL if failed (Note: you need delete manually when it's useless)
Document* loadDocument ( const QByteArray &  bytes)
friend

Load a document.

Parameters
bytesdocument data
Returns
NULL if failed (Note: you need delete manually when it's useless)

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