5#include <private/qpdffile_p.h>
6#include <QtCore/qmetatype.h>
7#include <QtCore/qstandardpaths.h>
8#include <QtQml/qqmlcontext.h>
9#include <QtQml/qqmlengine.h>
10#include <QtQuick/qquickitem.h>
11#include <QtQml/qqmlfile.h>
74 m_maxPageWidthHeight =
QSizeF();
77 m_carrierFile =
nullptr;
95 switch (m_doc->
error()) {
97 return tr(
"no error");
102 return tr(
"data not yet available");
105 return tr(
"file not found");
108 return tr(
"invalid file format");
111 return tr(
"incorrect password");
114 return tr(
"unsupported security scheme");
117 return tr(
"unknown error");
151 return m_maxPageWidthHeight.
width();
157 return m_maxPageWidthHeight.
height();
170QPdfFile *QQuickPdfDocument::carrierFile()
173 m_carrierFile =
new QPdfFile(m_doc);
174 return m_carrierFile;
177void QQuickPdfDocument::updateMaxPageSize()
const
179 if (m_maxPageWidthHeight.
isValid())
189 m_maxPageWidthHeight =
QSizeF(
w,
h);
271#include "moc_qquickpdfdocument_p.cpp"
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void deleteLater()
\threadsafe
The QPdfDocument class loads a PDF document and renders pages from it.
Error error() const
Returns the type of error if \l status is Error, or NoError if there is no error.
Status
This enum describes the current status of the document.
int pageCount
This property holds the number of pages in the loaded document or 0 if no document is loaded.
@ UnsupportedSecurityScheme
Error load(const QString &fileName)
Loads the document contents from fileName.
void statusChanged(QPdfDocument::Status status)
Q_INVOKABLE QSizeF pagePointSize(int page) const
Returns the size of page page in points (1/72 of an inch).
The QQmlContext class defines a context within a QML engine.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to \l{QFile}.
QUrl resolvedSource() const
~QQuickPdfDocument() override
void setSource(QUrl source)
\qmlproperty url PdfDocument::source
QQuickPdfDocument(QObject *parent=nullptr)
A representation of a PDF document.
void classBegin() override
Invoked after class creation, but before any properties have been set.
constexpr bool isValid() const noexcept
Returns true if both the width and height are equal to or greater than 0; otherwise returns false.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
QQmlContext * qmlContext(const QObject *obj)
QObject * qmlExtendedObject(QObject *object)