5#include <QLoggingCategory>
7#include <QtPdf/private/qpdffile_p.h>
71 QSize finalSize = pageSize;
79 finalSize = m_clipRect.
size();
84 finalSize = m_scaledSize;
85 pageSize = m_scaledSize;
87 if (m_scaledClipRect.
isValid()) {
88 tr2 = -m_scaledClipRect.
topLeft();
89 finalSize = m_scaledClipRect.
size();
92 t.translate(tr2.
x(), tr2.
y());
94 t.translate(tr1.
x(), tr1.
y());
95 bounds =
t.mapRect(bounds);
97 qCDebug(qLcPdf) << m_page << finalSize;
102 qWarning(
"QPdfIOHandler: QImage allocation failed (size %i x %i)", finalSize.
width(), finalSize.
height());
108 if (m_scaledClipRect.
isValid())
113 QImage pageImage = m_doc->
render(m_page, finalSize, options);
114 p.drawImage(0, 0, pageImage);
136 return m_scaledClipRect;
151 m_clipRect =
value.toRect();
154 m_scaledSize =
value.toSize();
157 m_scaledClipRect =
value.toRect();
210 m_ownsDocument =
false;
211 qCDebug(qLcPdf) <<
"loading via QPdfFile, reusing document instance" << m_doc;
214 m_ownsDocument =
true;
216 qCDebug(qLcPdf) <<
"loading via new document instance" << m_doc;
IOBluetoothDevice * device
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgba() const noexcept
Returns the RGB value of the color, including its alpha.
int value() const noexcept
Returns the value color component of this color.
\inmodule QtCore \reentrant
qint64 peek(char *data, qint64 maxlen)
ImageOption
This enum describes the different options supported by QImageIOHandler.
QByteArray format() const
Returns the format that is currently assigned to QImageIOHandler.
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
@ Format_ARGB32_Premultiplied
The QPainter class performs low-level painting on widgets and other paint devices.
constexpr void setScaledClipRect(const QRect &r) noexcept
constexpr void setScaledSize(const QSize &s) noexcept
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.
QImage render(int page, QSize imageSize, QPdfDocumentRenderOptions options=QPdfDocumentRenderOptions())
Renders the page into a QImage of size imageSize according to the provided renderOptions.
int pageCount
This property holds the number of pages in the loaded document or 0 if no document is loaded.
QVariant metaData(MetaDataField field) const
Returns the meta data of the document for the given field.
Error load(const QString &fileName)
Loads the document contents from fileName.
Q_INVOKABLE QSizeF pagePointSize(int page) const
Returns the size of page page in points (1/72 of an inch).
QPdfDocument * document()
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
bool jumpToNextImage() override
For image formats that support animation, this function jumps to the next image.
bool jumpToImage(int frame) override
For image formats that support animation, this function jumps to the image whose sequence number is i...
QVariant option(ImageOption option) const override
Returns the value assigned to option as a QVariant.
~QPdfIOHandler() override
int currentImageNumber() const override
For image formats that support animation, this function returns the sequence number of the current im...
int imageCount() const override
For image formats that support animation, this function returns the number of images in the animation...
bool read(QImage *image) override
Read an image from the device, and stores it in image.
QRect currentImageRect() const override
Returns the rect of the current image.
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
Combined button and popup list for selecting options.
int qstrncmp(const char *str1, const char *str2, size_t len)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
constexpr const T & qMax(const T &a, const T &b)
GLenum GLuint GLenum GLsizei const GLchar * buf