QPdfDocumentRenderOptions Class

QPdfDocumentRenderOptions 类包含从 PDF 文档渲染页面的选项。更多

Header: #include <QPdfDocumentRenderOptions>

公共类型

enum class RenderFlag { None, Annotations, OptimizedForLcd, Grayscale, ForceHalftone, …, PathAliased }
flags RenderFlags
enum class Rotation { None, Clockwise90, Clockwise180, Clockwise270 }

公共函数

QPdfDocumentRenderOptions()
QPdfDocumentRenderOptions::RenderFlags renderFlags() const
QPdfDocumentRenderOptions::Rotation rotation() const
QRect scaledClipRect() const
QSize scaledSize() const
void setRenderFlags(QPdfDocumentRenderOptions::RenderFlags flags)
void setRotation(QPdfDocumentRenderOptions::Rotation rotation)
void setScaledClipRect(const QRect &r)
void setScaledSize(const QSize &s)

详细说明

另请参见 QPdfDocument

成员类型文档

枚举类 QPdfDocumentRenderOptions::RenderFlag
flags QPdfDocumentRenderOptions::RenderFlags

该枚举用于描述页面的渲染方式。

常量描述
QPdfDocumentRenderOptions::RenderFlag::None0x000默认值,表示无标记。
QPdfDocumentRenderOptions::RenderFlag::Annotations0x001页面渲染时带有注释。
QPdfDocumentRenderOptions::RenderFlag::OptimizedForLcd0x002为 LCD 显示屏优化页面文本。
QPdfDocumentRenderOptions::RenderFlag::Grayscale0x004页面灰度渲染。
QPdfDocumentRenderOptions::RenderFlag::ForceHalftone0x008如果输出图像被拉伸,则始终使用半色调进行渲染。
QPdfDocumentRenderOptions::RenderFlag::TextAliased0x010渲染文本时已禁用抗锯齿。
QPdfDocumentRenderOptions::RenderFlag::ImageAliased0x020渲染图像时已禁用抗锯齿。
QPdfDocumentRenderOptions::RenderFlag::PathAliased0x040渲染路径时禁用抗锯齿。

RenderFlags 类型是QFlags<RenderFlag> 的类型定义。它存储 RenderFlag 值的 OR 组合。

另请参阅 QPdfDocument::render().

enum class QPdfDocumentRenderOptions::Rotation

该枚举用于描述页面渲染时的旋转。

常数说明
QPdfDocumentRenderOptions::Rotation::None0不旋转(默认值)
QPdfDocumentRenderOptions::Rotation::Clockwise901顺时针旋转 90 度
QPdfDocumentRenderOptions::Rotation::Clockwise1802旋转 180 度
QPdfDocumentRenderOptions::Rotation::Clockwise2703顺时针旋转 270 度

另请参阅 QPdfDocument::render().

成员函数文档

[constexpr noexcept] QPdfDocumentRenderOptions::QPdfDocumentRenderOptions()

构造一个 QPdfDocumentRenderOptions 对象。

[constexpr noexcept] QPdfDocumentRenderOptions::RenderFlags QPdfDocumentRenderOptions::renderFlags() const

返回用于渲染 PDF 文档页面的特殊标记。

另请参阅 setRenderFlags()。

[constexpr noexcept] QPdfDocumentRenderOptions::Rotation QPdfDocumentRenderOptions::rotation() const

返回用于渲染 PDF 文档页面的旋转角度。

另请参阅 setRotation()。

[constexpr noexcept] QRect QPdfDocumentRenderOptions::scaledClipRect() const

返回页面缩放到scaledSize() 后要剪切的矩形区域。

另请参阅 setScaledClipRect()。

[constexpr noexcept] QSize QPdfDocumentRenderOptions::scaledSize() const

以像素为单位返回要渲染的页面大小。

另请参见 setScaledSize()。

[constexpr noexcept] void QPdfDocumentRenderOptions::setRenderFlags(QPdfDocumentRenderOptions::RenderFlags flags)

设置用于渲染 PDF 文档页面的特殊flags

另请参阅 renderFlags().

[constexpr noexcept] void QPdfDocumentRenderOptions::setRotation(QPdfDocumentRenderOptions::Rotation rotation)

设置用于渲染 PDF 文档页面的rotation

另请参阅 rotation().

[constexpr noexcept] void QPdfDocumentRenderOptions::setScaledClipRect(const QRect &r)

设置缩放至scaledSize() 后从页面剪切的矩形区域 (r)。

另请参阅 scaledClipRect()。

[constexpr noexcept] void QPdfDocumentRenderOptions::setScaledSize(const QSize &s)

设置要渲染的页面大小 (s) ,单位为像素。

另请参阅 scaledSize().

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.