Scribus
Open source desktop publishing at your fingertips
PDFOptionsIO Class Reference

Helper class for reading/writing PDFOptions. More...

#include <pdfoptionsio.h>

Collaboration diagram for PDFOptionsIO:

Public Member Functions

 PDFOptionsIO (PDFOptions &opts)
 simple ctor
 
bool writeTo (QIODevice &outDevice, bool includePasswords=false)
 Save the PDF settings to a file or other stream. More...
 
bool writeTo (QString outFileName, bool includePasswords=false)
 
bool readFrom (QIODevice &inStream)
 Load the PDF settings from a file or other data stream, overwriting any current settings. More...
 
bool readFrom (QString inFileName)
 
const QString & lastError () const
 Return human-readable explanation of last error. More...
 

Protected Member Functions

QString buildXMLString ()
 
void buildSettings ()
 
void addElem (QDomElement &addTo, QString name, bool value)
 
void addElem (QDomElement &addTo, QString name, QString value)
 
void addElem (QDomElement &addTo, QString name, int value)
 
void addElem (QDomElement &addTo, QString name, double value)
 
void addList (QDomElement &addTo, QString name, QList< QString > &value)
 
void addPresentationData ()
 
void addLPISettings ()
 
bool readSettings ()
 
bool readElem (QDomElement &parent, QString name, bool *value)
 
bool readElem (QDomElement &parent, QString name, int *value)
 
bool readElem (QDomElement &parent, QString name, double *value)
 
bool readElem (QDomElement &parent, QString name, QString *value)
 
bool readList (QDomElement &parent, QString name, QList< QString > *value)
 
bool readPDFVersion ()
 
bool readPDFFontEmbeddingMode ()
 
bool readPresentationData ()
 
bool readLPISettings ()
 
QDomNode getUniqueNode (QDomElement &parent, QString name)
 
QDomElement getValueElement (QDomNode &node, QString name, bool isValue=true)
 

Protected Attributes

QDomDocument m_doc
 
QDomElement m_root
 
PDFOptionsm_opts
 
bool m_includePasswords
 
QString m_error
 

Static Protected Attributes

static const int formatVersion = 1300
 

Detailed Description

Helper class for reading/writing PDFOptions.

Author
Craig Ringer

PDFOptionsIO reads and writes PDFOptions to various formats. Currently only a custom XML format is supported, but support for reading/writing Adobe's .joboptions (for example) might be added in future.

Usage: // Writing: // where `opts' is an existing PDFOptions instance PDFOptionsIO io(opts); if (!io.writeTo("/path/to/file")) qDebug("Failed to save settings: %s", io.lastError.utf8());

// Reading: PDFOptions opts; PDFOptionsIO io(opts); if (!io.readFrom("/path/to/file")) qDebug("Failed to load settings: %s", io.lastError.utf8());

You should generally not keep PDFOptionsIO objects around; just create an instance when you need it.

See also
PDFOptions

Member Function Documentation

const QString & PDFOptionsIO::lastError ( ) const

Return human-readable explanation of last error.

Warning
Do not depend on particular values of this in your code.
bool PDFOptionsIO::readFrom ( QIODevice &  inStream)

Load the PDF settings from a file or other data stream, overwriting any current settings.

Warning
unimplemented, always fails
on failure, struct contents are undefined.
Parameters
inStreamQIODevice to settings data from.
Returns
True for success.
bool PDFOptionsIO::writeTo ( QIODevice &  outDevice,
bool  includePasswords = false 
)

Save the PDF settings to a file or other stream.

Warning
unimplemented, always fails.
Parameters
outDeviceQIODevice to write output to.
includePasswordstrue if with passwords
Returns
True for success.

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