Foxit PDF SDK
com.foxit.sdk.common.Renderer类 参考
类 com.foxit.sdk.common.Renderer 继承关系图:
com.foxit.sdk.common.Base

Public 成员函数

 Renderer (Bitmap bitmap, boolean is_rgb_order) throws com.foxit.sdk.PDFException
 带位图的构造函数。
更多...
 
 Renderer (PrintDeviceSettingData print_param, String dest_file_path) throws com.foxit.sdk.PDFException
 用于打印的构造函数,带指定的打印设备设置数据。
更多...
 
 Renderer (Renderer other)
 带另一个渲染器对象的构造函数。
更多...
 
void clearClips () throws com.foxit.sdk.PDFException
 清除通过函数 Renderer.setClipRect 设置的裁剪矩形。
更多...
 
synchronized void delete ()
 直接清除C++相关资源。 更多...
 
void enableForPrint (boolean is_render_for_print) throws com.foxit.sdk.PDFException
 设置标志来决定是否在打印模式下进行渲染。
更多...
 
boolean isEmpty ()
 检查当前对象是否为空。
更多...
 
boolean renderAnnot (Annot annot, Matrix2D matrix) throws com.foxit.sdk.PDFException
 渲染指定的注释。
更多...
 
boolean renderFormControls (PDFPage page, Matrix2D matrix) throws com.foxit.sdk.PDFException
 渲染表单控件。
更多...
 
boolean renderGraphicsObject (GraphicsObject graphics_object, PDFPage page, Matrix2D matrix) throws com.foxit.sdk.PDFException
 渲染图形对象。
更多...
 
void setClearType (boolean is_clear_type) throws com.foxit.sdk.PDFException
 设置标志来决定是否使用ClearType类似的反锯齿来渲染文本对象。
更多...
 
void setClipPathFill (Path clip_path, Matrix2D matrix, int fill_mode) throws com.foxit.sdk.PDFException
 使用填充区域设置裁剪路径。
更多...
 
void setClipPathStroke (Path clip_path, Matrix2D matrix, GraphState graph_state) throws com.foxit.sdk.PDFException
 使用描边区域设置裁剪路径。
更多...
 
void setClipRect (RectI clip_rect) throws com.foxit.sdk.PDFException
 设置将在后续渲染过程中使用的裁剪矩形。
更多...
 
void setColorMode (int color_mode) throws com.foxit.sdk.PDFException
 设置颜色模式。
更多...
 
void setForceDownSample (boolean is_to_force_down_sample) throws com.foxit.sdk.PDFException
 设置标志来决定是否对图像拉伸使用下采样。
更多...
 
void setForceHalftone (boolean is_to_force_halftone) throws com.foxit.sdk.PDFException
 设置标志来决定是否对图像拉伸使用半调。
更多...
 
void setForegroundColor (long foreground_color) throws com.foxit.sdk.PDFException
 当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeForeground 时为文本、路径或两者设置前景颜色。
更多...
 
void setForegroundColorMode (int foreground_color_mode) throws com.foxit.sdk.PDFException
 当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeForeground 时设置渲染前景颜色模式。
更多...
 
void setJPEGDownSample (boolean is_jepg_down_sample) throws com.foxit.sdk.PDFException
 设置标志来决定是否对jpeg图像使用下采样。
更多...
 
void setJPXDownSample (boolean is_jpx_down_sample) throws com.foxit.sdk.PDFException
 设置标志来决定是否对jpx图像使用下采样。
更多...
 
void setLayerContext (LayerContext layer_context) throws com.foxit.sdk.PDFException
 设置图层上下文到渲染上下文句柄。
更多...
 
void setMappingModeColors (long background_color, long foreground_color) throws com.foxit.sdk.PDFException
 当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeMappingGray com.foxit.sdk.common.Renderer.e_ColorModeMapping 时设置背景颜色和前景颜色。
更多...
 
void setOverprint (boolean is_to_enable_overprint) throws com.foxit.sdk.PDFException
 设置标志来决定是否启用叠印。
更多...
 
void setPrintTextAsGraphic (boolean is_to_print_text_graphic) throws com.foxit.sdk.PDFException
 设置标志来决定是否将文本打印为路径或位图。
更多...
 
void setPrintTextAsImage (boolean is_to_print_text_image) throws com.foxit.sdk.PDFException
 设置标志来决定是否将文本打印为图像。
更多...
 
void setRenderAnnotAppearanceType (int ap_type) throws com.foxit.sdk.PDFException
 设置注释的外观类型用于渲染。
更多...
 
void setRenderAnnotsForThumbnail (boolean is_render_annots_for_thumbnail) throws com.foxit.sdk.PDFException
 设置渲染标志来决定是否在缩略图模式下渲染注释。
更多...
 
void setRenderContentFlags (int render_content_flags) throws com.foxit.sdk.PDFException
 设置渲染标志来决定渲染什么内容。
更多...
 
void setRenderEnhanceThinLines (boolean is_render_enhance_thin_lines) throws com.foxit.sdk.PDFException
 设置标志来决定是否增强细线。
更多...
 
void setRenderFormField (boolean is_render_formfield) throws com.foxit.sdk.PDFException
 设置标志来决定是否渲染表单字段(除签名字段外)。
更多...
 
void setRenderImageAntiAliasing (boolean is_render_image_antialiasing) throws com.foxit.sdk.PDFException
 设置标志来决定是否绘制图像反锯齿。
更多...
 
void setRenderLayer (boolean is_render_one_layer)
 设置标志来决定是否渲染一个图层或所有可用图层。
更多...
 
void setRenderPathAntiAliasing (boolean is_render_path_antialiasing) throws com.foxit.sdk.PDFException
 设置标志来决定是否绘制路径反锯齿。
更多...
 
void setRenderPathFullCovered (boolean is_render_path_full_covered) throws com.foxit.sdk.PDFException
 可应用于填充模式的特殊标志。
更多...
 
void setRenderPathThinLine (boolean is_render_path_thin_line) throws com.foxit.sdk.PDFException
 设置标志来决定是否将路径绘制为细线。
更多...
 
void setRenderSignature (boolean is_render_signature) throws com.foxit.sdk.PDFException
 设置标志来决定是否渲染签名。
更多...
 
void setRenderSignatureState (boolean is_render_signature_state) throws com.foxit.sdk.PDFException
 设置标志来决定是否在签名上绘制签名状态。
更多...
 
void setRenderTextAntiAliasing (boolean is_render_text_antialiasing) throws com.foxit.sdk.PDFException
 设置标志来决定是否绘制文本反锯齿。
更多...
 
void setScreenDPIScale (float scale)
 设置用于渲染的屏幕DPI缩放因子。
更多...
 
Progressive startQuickRender (PDFPage page, Matrix2D matrix, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始快速渲染PDF页面,主要用于缩略图。
更多...
 
Progressive startRender (PDFPage page, Matrix2D matrix, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始渲染PDF页面。
更多...
 
Progressive startRenderBitmap (Bitmap bitmap, Matrix2D matrix, RectI clip_rect, int interpolation, int alpha, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始渲染位图。
更多...
 
Progressive startRenderBitmap (Bitmap bitmap, Matrix2D matrix, RectI clip_rect, int interpolation, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始渲染位图。
更多...
 
Progressive startRenderReflowPage (ReflowPage reflow_page, Matrix2D matrix, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始渲染重排页面。
更多...
 
Progressive startRenderXFAPage (XFAPage xfa_page_view, Matrix2D matrix, boolean is_highlight, PauseCallback pause) throws com.foxit.sdk.PDFException
 开始渲染XFA页面。
更多...
 

静态 Public 属性

static final int e_ColorModeAlpha = 3
 仅输出alpha,忽略颜色。

 
static final int e_ColorModeForeground = 4
 自定义颜色模式。将颜色映射到前景。

 
static final int e_ColorModeForegroundBlackPath = 0x08
 如果设置,仅需要替换路径的黑色。

 
static final int e_ColorModeForegroundBlackText = 0x04
 如果设置,仅需要替换文本的黑色。

 
static final int e_ColorModeForegroundPath = 0x02
 如果设置,需要替换路径的颜色。

 
static final int e_ColorModeForegroundText = 0x01
 如果设置,需要替换文本的颜色。

 
static final int e_ColorModeMapping = 2
 将颜色值映射到由背景颜色和前景颜色定义的颜色范围。

 
static final int e_ColorModeMappingGray = 1
 将灰阶:白色/黑色颜色值映射到背景/前景;其他颜色不变。

 
static final int e_ColorModeNormal = 0
 正常颜色模式。

 
static final int e_RenderAnnot = 0x02
 如果设置,将渲染注释。

 
static final int e_RenderExceptHighlight = 0x08
 如果设置,将渲染除高亮外的所有注释。

 
static final int e_RenderHighlight = 0x04
 如果设置,仅渲染高亮注释。

 
static final int e_RenderPage = 0x01
 如果设置,将渲染页面内容。

 
static final int e_RenderScreen = 0x10
 如果设置,仅渲染屏幕注释。

 

详细描述

PDF渲染器是一个图形引擎,用于将页面渲染到位图或平台设备上下文。 此类可以用位图或设备对象构造。它提供设置渲染选项/标志和执行渲染的函数。 在此类中,有几种渲染方法:

在Foxit PDF SDK中,窗口部件注释总是与表单字段和表单控件关联。对于如何渲染 窗口部件注释,这里是推荐的流程:


参见
com.foxit.sdk.pdf.interform.Filler

构造及析构函数说明

◆ Renderer() [1/3]

com.foxit.sdk.common.Renderer.Renderer ( Bitmap  bitmap,
boolean  is_rgb_order 
) throws com.foxit.sdk.PDFException

带位图的构造函数。

输入位图被视为独立设备,渲染器渲染的所有内容 都将出现在位图中。

参数
[in]bitmap用于渲染的位图。用户应确保位图保持有效,直到 当前渲染器对象的生命周期结束。
[in]is_rgb_ordertrue 表示Foxit PDF SDK在渲染时需要使用RGB字节顺序 (红色在最低位)。
false 表示Foxit PDF SDK在渲染时需要使用BGR字节顺序 (蓝色在最低位)。

◆ Renderer() [2/3]

com.foxit.sdk.common.Renderer.Renderer ( PrintDeviceSettingData  print_param,
String  dest_file_path 
) throws com.foxit.sdk.PDFException

用于打印的构造函数,带指定的打印设备设置数据。

渲染器渲染的所有内容将出现在PDF文件或PostScript文件中。 生成PS文件仅在Linux系统上支持。

参数
[in]print_param用于打印设备的设置数据。
[in]dest_file_path生成打印的PDF文件或PostScript文件的路径。如果此路径 是PDF文件路径,请确保Foxit PDF SDK已通过函数 common.Library.initialize 使用包含 "Print2PDF"模块的密钥成功初始化。

◆ Renderer() [3/3]

com.foxit.sdk.common.Renderer.Renderer ( Renderer  other)

带另一个渲染器对象的构造函数。

参数
[in]other另一个渲染器对象。

成员函数说明

◆ clearClips()

void com.foxit.sdk.common.Renderer.clearClips ( ) throws com.foxit.sdk.PDFException

清除通过函数 Renderer.setClipRect 设置的裁剪矩形。

返回
无。

◆ delete()

synchronized void com.foxit.sdk.common.Renderer.delete ( )

直接清除C++相关资源。

返回
无。
注解
一旦这个接口被调用,这个对象将不能再被使用。

重载 com.foxit.sdk.common.Base .

◆ enableForPrint()

void com.foxit.sdk.common.Renderer.enableForPrint ( boolean  is_render_for_print) throws com.foxit.sdk.PDFException

设置标志来决定是否在打印模式下进行渲染。

当当前渲染器用于打印时,请确保此渲染标志设置为预期值。 对于渲染注释,如果此标志设置为 true,Foxit PDF SDK将仅渲染 具有注释标志 com.foxit.sdk.pdf.annots.Annot.e_FlagPrint 的注释。
如果对当前渲染器对象尚未调用此函数,将使用默认值 false

参数
[in]is_render_for_printtrue 表示在打印模式下渲染,而 false 表示不在打印模式下渲染。
返回
无。

◆ isEmpty()

boolean com.foxit.sdk.common.Renderer.isEmpty ( )

检查当前对象是否为空。

当当前对象为空时,意味着当前对象无用。

返回
true 表示当前对象为空,而 false 表示非空。

◆ renderAnnot()

boolean com.foxit.sdk.common.Renderer.renderAnnot ( Annot  annot,
Matrix2D  matrix 
) throws com.foxit.sdk.PDFException

渲染指定的注释。

当调用此函数时,渲染标志(通过函数 Renderer.setRenderContentFlags 设置 或默认设置)将被忽略。

参数
[in]annot要渲染的注释对象。如果输入的注释是弹出注释,此函数将 不渲染它并返回 false
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.PDFPage.getDisplayMatrix 返回。
返回
true 表示成功,而 false 表示失败。

◆ renderFormControls()

boolean com.foxit.sdk.common.Renderer.renderFormControls ( PDFPage  page,
Matrix2D  matrix 
) throws com.foxit.sdk.PDFException

渲染表单控件。

当调用此函数时,渲染标志(通过函数 Renderer.setRenderContentFlags 设置或默认设置)将被忽略。

参数
[in]page有效的PDF页面。如果输入页面无效,此函数什么也不做并直接返回 false
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.PDFPage.getDisplayMatrix 返回。
返回
true 表示成功,而 false 表示失败。

◆ renderGraphicsObject()

boolean com.foxit.sdk.common.Renderer.renderGraphicsObject ( GraphicsObject  graphics_object,
PDFPage  page,
Matrix2D  matrix 
) throws com.foxit.sdk.PDFException

渲染图形对象。

当调用此函数时,渲染标志(通过函数 Renderer.setRenderContentFlags 设置或默认设置)将被忽略。

参数
[in]graphics_object要渲染的有效PDF图形对象。
[in]page有效的PDF页面。参数 graphics_object 属于此PDF页面。
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.PDFPage.getDisplayMatrix 返回。
返回
true 表示成功,而 false 表示失败。

◆ setClearType()

void com.foxit.sdk.common.Renderer.setClearType ( boolean  is_clear_type) throws com.foxit.sdk.PDFException

设置标志来决定是否使用ClearType类似的反锯齿来渲染文本对象。

如果不调用此函数,将使用默认值 true

参数
[in]is_clear_typetrue 表示使用ClearType类似的反锯齿来渲染文本对象。 false 表示不使用ClearType类似的反锯齿来渲染文本对象。
返回
无。

◆ setClipPathFill()

void com.foxit.sdk.common.Renderer.setClipPathFill ( Path  clip_path,
Matrix2D  matrix,
int  fill_mode 
) throws com.foxit.sdk.PDFException

使用填充区域设置裁剪路径。

参数
[in]clip_path裁剪路径。
[in]matrix用于裁剪的变换矩阵。
[in]fill_mode填充模式。应该是值 或 。
返回
无。

◆ setClipPathStroke()

void com.foxit.sdk.common.Renderer.setClipPathStroke ( Path  clip_path,
Matrix2D  matrix,
GraphState  graph_state 
) throws com.foxit.sdk.PDFException

使用描边区域设置裁剪路径。

参数
[in]clip_path裁剪路径。
[in]matrix用于裁剪的变换矩阵。
[in]graph_state有效的图形状态,用于画笔属性。如果为 null,Foxit PDF SDK将 使用默认构造函数的图形状态对象。默认值:null
返回
无。

◆ setClipRect()

void com.foxit.sdk.common.Renderer.setClipRect ( RectI  clip_rect) throws com.foxit.sdk.PDFException

设置将在后续渲染过程中使用的裁剪矩形。

参数
[in]clip_rect裁剪矩形。如果为 null,表示在 后续渲染过程中不使用裁剪矩形。
返回
无。

◆ setColorMode()

void com.foxit.sdk.common.Renderer.setColorMode ( int  color_mode) throws com.foxit.sdk.PDFException

设置颜色模式。

如果不调用此函数,将使用默认值 com.foxit.sdk.common.Renderer.e_ColorModeNormal

参数
[in]color_mode颜色模式值。应该是以下值之一:
返回
无。

◆ setForceDownSample()

void com.foxit.sdk.common.Renderer.setForceDownSample ( boolean  is_to_force_down_sample) throws com.foxit.sdk.PDFException

设置标志来决定是否对图像拉伸使用下采样。

如果不调用此函数,将使用默认值 false

参数
[in]is_to_force_down_sampletrue 表示对图像拉伸使用下采样。 false 表示对图像拉伸不使用下采样。
返回
无。

◆ setForceHalftone()

void com.foxit.sdk.common.Renderer.setForceHalftone ( boolean  is_to_force_halftone) throws com.foxit.sdk.PDFException

设置标志来决定是否对图像拉伸使用半调。

如果不调用此函数,将使用默认值 false

参数
[in]is_to_force_halftonetrue 表示对图像拉伸使用半调。 false 表示对图像拉伸不使用半调。
返回
无。

◆ setForegroundColor()

void com.foxit.sdk.common.Renderer.setForegroundColor ( long  foreground_color) throws com.foxit.sdk.PDFException

当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeForeground 时为文本、路径或两者设置前景颜色。

文本、路径或两者的前景颜色由函数 Renderer.setForegroundColorMode 设置的前景颜色模式决定。

参数
[in]foreground_color文本、路径或两者的前景颜色。格式:0xAARRGGBB。
返回
无。

◆ setForegroundColorMode()

void com.foxit.sdk.common.Renderer.setForegroundColorMode ( int  foreground_color_mode) throws com.foxit.sdk.PDFException

当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeForeground 时设置渲染前景颜色模式。

如果不调用此函数,将使用默认值 (com.foxit.sdk.common.Renderer.e_ColorModeForegroundText | com.foxit.sdk.common.Renderer.e_ColorModeForegroundPath | com.foxit.sdk.common.Renderer.e_ColorModeForegroundBlackText | com.foxit.sdk.common.Renderer.e_ColorModeForegroundBlackPath )。

参数
[in]foreground_color_mode渲染前景颜色模式。请参考从 com.foxit.sdk.common.Renderer.e_ColorModeForegroundText 开始的值,应该是这些值中的一个或 这些值的组合。
返回
无。

◆ setJPEGDownSample()

void com.foxit.sdk.common.Renderer.setJPEGDownSample ( boolean  is_jepg_down_sample) throws com.foxit.sdk.PDFException

设置标志来决定是否对jpeg图像使用下采样。

是否对jpeg图像使用下采样将影响PDF页面的渲染结果。 当成功调用当前函数时,用户应该在再次渲染PDF页面之前 为PDF页面(已至少渲染一次)调用函数 pdf.PDFPage.clearRenderCache
如果不调用此函数,将使用默认值 true

参数
[in]is_jepg_down_sampletrue 表示对jpeg图像使用下采样。 false 表示对jpeg图像不使用下采样。
返回
无。

◆ setJPXDownSample()

void com.foxit.sdk.common.Renderer.setJPXDownSample ( boolean  is_jpx_down_sample) throws com.foxit.sdk.PDFException

设置标志来决定是否对jpx图像使用下采样。

是否对jpx图像使用下采样将影响PDF页面的渲染结果。 当成功调用当前函数时,用户应该在再次渲染PDF页面之前 为PDF页面(已至少渲染一次)调用函数 pdf.PDFPage.clearRenderCache
如果不调用此函数,将使用默认值 true

参数
[in]is_jpx_down_sampletrue 表示对jpx图像使用下采样。 false 表示对jpx图像不使用下采样。
返回
无。

◆ setLayerContext()

void com.foxit.sdk.common.Renderer.setLayerContext ( LayerContext  layer_context) throws com.foxit.sdk.PDFException

设置图层上下文到渲染上下文句柄。

为了在渲染上下文上渲染PDF页面内容时渲染一个图层, 用户应该调用此函数将图层上下文设置到渲染上下文。

参数
[in]layer_context图层上下文对象。
返回
无。

◆ setMappingModeColors()

void com.foxit.sdk.common.Renderer.setMappingModeColors ( long  background_color,
long  foreground_color 
) throws com.foxit.sdk.PDFException

当颜色模式为 com.foxit.sdk.common.Renderer.e_ColorModeMappingGray com.foxit.sdk.common.Renderer.e_ColorModeMapping 时设置背景颜色和前景颜色。

参数
[in]background_color背景颜色。格式:0xAARRGGBB。
[in]foreground_color前景颜色。格式:0xAARRGGBB。
返回
无。

◆ setOverprint()

void com.foxit.sdk.common.Renderer.setOverprint ( boolean  is_to_enable_overprint) throws com.foxit.sdk.PDFException

设置标志来决定是否启用叠印。

参数
[in]is_to_enable_overprinttrue 表示启用叠印。 false 表示不启用叠印。 默认值: false.
返回
无。

◆ setPrintTextAsGraphic()

void com.foxit.sdk.common.Renderer.setPrintTextAsGraphic ( boolean  is_to_print_text_graphic) throws com.foxit.sdk.PDFException

设置标志来决定是否将文本打印为路径或位图。

当此标志为 true 时,Foxit PDF SDK将以不同方式渲染文本: 如果字体大小大于50,将文本打印为路径;否则,将文本打印为位图。
如果不调用此函数,将使用默认值 false

参数
[in]is_to_print_text_graphictrue 表示将文本打印为路径或位图。 false 表示不将文本打印为路径或位图。
返回
无。

◆ setPrintTextAsImage()

void com.foxit.sdk.common.Renderer.setPrintTextAsImage ( boolean  is_to_print_text_image) throws com.foxit.sdk.PDFException

设置标志来决定是否将文本打印为图像。

如果不调用此函数,将使用默认值 false

参数
[in]is_to_print_text_imagetrue 表示将文本打印为图像。 false 表示不将文本打印为图像。
返回
无。

◆ setRenderAnnotAppearanceType()

void com.foxit.sdk.common.Renderer.setRenderAnnotAppearanceType ( int  ap_type) throws com.foxit.sdk.PDFException

设置注释的外观类型用于渲染。

参数
[in]ap_type注释外观的类型。请参考从 com.foxit.sdk.pdf.annots.Annot.e_AppearanceTypeNormal 开始的值,应该是这些值中的一个。
返回
无。

◆ setRenderAnnotsForThumbnail()

void com.foxit.sdk.common.Renderer.setRenderAnnotsForThumbnail ( boolean  is_render_annots_for_thumbnail) throws com.foxit.sdk.PDFException

设置渲染标志来决定是否在缩略图模式下渲染注释。

在缩略图模式下,注释的"NoZoom"和"NoRotate"标志将被忽略。 此渲染标志仅在使用标志 com.foxit.sdk.common.Renderer.e_RenderAnnot 进行渲染或 调用函数 Renderer.renderAnnot 时可用。关于设置标志 com.foxit.sdk.common.Renderer.e_RenderAnnot 请参考函数 Renderer.setRenderContentFlags
如果不调用此函数,当此渲染标志可用时将使用默认值 false

参数
[in]is_render_annots_for_thumbnailtrue 表示在缩略图模式下渲染注释。 false 表示不在缩略图模式下渲染注释。
返回
无。

◆ setRenderContentFlags()

void com.foxit.sdk.common.Renderer.setRenderContentFlags ( int  render_content_flags) throws com.foxit.sdk.PDFException

设置渲染标志来决定渲染什么内容。

如果不调用此函数,将使用默认值 (com.foxit.sdk.common.Renderer.e_RenderPage | com.foxit.sdk.common.Renderer.e_RenderAnnot )。

参数
[in]render_content_flags渲染内容标志。请参考从 com.foxit.sdk.common.Renderer.e_RenderPage 开始的值,应该是这些值中的一个或组合。 com.foxit.sdk.common.Renderer.e_RenderHighlight 不能与 com.foxit.sdk.common.Renderer.e_RenderExceptHighlight 组合。
返回
无。

◆ setRenderEnhanceThinLines()

void com.foxit.sdk.common.Renderer.setRenderEnhanceThinLines ( boolean  is_render_enhance_thin_lines) throws com.foxit.sdk.PDFException

设置标志来决定是否增强细线。

如果不调用此函数,将使用默认值 false

参数
[in]is_render_enhance_thin_linestrue 表示用更粗的路径绘制零宽度线条, 使它们比默认的单像素更可见。
false 表示用单像素宽度绘制零宽度线条。
返回
无。

◆ setRenderFormField()

void com.foxit.sdk.common.Renderer.setRenderFormField ( boolean  is_render_formfield) throws com.foxit.sdk.PDFException

设置标志来决定是否渲染表单字段(除签名字段外)。

如果不调用此函数,当此标志可用时将使用默认值 true

参数
[in]is_render_formfieldtrue 表示渲染表单字段(除签名字段外)。 false 表示不渲染表单字段(除签名字段外)。
返回
无。

◆ setRenderImageAntiAliasing()

void com.foxit.sdk.common.Renderer.setRenderImageAntiAliasing ( boolean  is_render_image_antialiasing) throws com.foxit.sdk.PDFException

设置标志来决定是否绘制图像反锯齿。

如果不调用此函数,将使用默认值 true

参数
[in]is_render_image_antialiasingtrue 表示绘制图像反锯齿,效果类似于 枚举类InterpolationFlag中定义的值。 false 表示绘制图像锯齿。
返回
无。

◆ setRenderLayer()

void com.foxit.sdk.common.Renderer.setRenderLayer ( boolean  is_render_one_layer)

设置标志来决定是否渲染一个图层或所有可用图层。

如果不调用此函数,当此标志可用时将使用默认值 true

参数
[in]is_render_one_layertrue 表示渲染一个图层。 false 表示渲染所有可用图层。
返回
无。

◆ setRenderPathAntiAliasing()

void com.foxit.sdk.common.Renderer.setRenderPathAntiAliasing ( boolean  is_render_path_antialiasing) throws com.foxit.sdk.PDFException

设置标志来决定是否绘制路径反锯齿。

如果不调用此函数,将使用默认值 true

参数
[in]is_render_path_antialiasingtrue 表示绘制路径反锯齿。 false 表示绘制路径锯齿。
返回
无。

◆ setRenderPathFullCovered()

void com.foxit.sdk.common.Renderer.setRenderPathFullCovered ( boolean  is_render_path_full_covered) throws com.foxit.sdk.PDFException

可应用于填充模式的特殊标志。

如果不调用此函数,将使用默认值 false

参数
[in]is_render_path_full_coveredtrue 表示路径部分覆盖的所有像素将被完全绘制,而 false 表示不这样做。
返回
无。

◆ setRenderPathThinLine()

void com.foxit.sdk.common.Renderer.setRenderPathThinLine ( boolean  is_render_path_thin_line) throws com.foxit.sdk.PDFException

设置标志来决定是否将路径绘制为细线。

如果不调用此函数,将使用默认值 false

参数
[in]is_render_path_thin_linetrue 表示将路径绘制为细线。 false 表示不将路径绘制为细线。
返回
无。

◆ setRenderSignature()

void com.foxit.sdk.common.Renderer.setRenderSignature ( boolean  is_render_signature) throws com.foxit.sdk.PDFException

设置标志来决定是否渲染签名。

如果不调用此函数,当此标志可用时将使用默认值 true

参数
[in]is_render_signaturetrue 表示渲染签名。 false 表示不渲染签名。
返回
无。

◆ setRenderSignatureState()

void com.foxit.sdk.common.Renderer.setRenderSignatureState ( boolean  is_render_signature_state) throws com.foxit.sdk.PDFException

设置标志来决定是否在签名上绘制签名状态。

如果不调用此函数,将使用默认值 true

参数
[in]is_render_signature_statetrue 表示在签名上绘制签名状态, 而 false 表示不绘制。

◆ setRenderTextAntiAliasing()

void com.foxit.sdk.common.Renderer.setRenderTextAntiAliasing ( boolean  is_render_text_antialiasing) throws com.foxit.sdk.PDFException

设置标志来决定是否绘制文本反锯齿。

如果不调用此函数,将使用默认值 true

参数
[in]is_render_text_antialiasingtrue 表示绘制文本反锯齿。 false 表示绘制文本锯齿。
返回
无。

◆ setScreenDPIScale()

void com.foxit.sdk.common.Renderer.setScreenDPIScale ( float  scale)

设置用于渲染的屏幕DPI缩放因子。

设置屏幕DPI缩放比例以适应不同的DPI条件。 此值通常应匹配系统报告的缩放因子 (例如,显示设置中125缩放为1.25)以确保与物理显示特性 的正确渲染对齐。

参数
[in]scale当前屏幕DPI的缩放比例(1.0 = 100原生DPI,2.0 = 200等)。 必须大于0,通常应对应于系统推荐的缩放因子。
注解
目前,此屏幕DPI缩放因子仅影响注释。
返回
无。

◆ startQuickRender()

Progressive com.foxit.sdk.common.Renderer.startQuickRender ( PDFPage  page,
Matrix2D  matrix,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始快速渲染PDF页面,主要用于缩略图。

此函数主要用于为缩略图渲染页面。 渲染的内容将不完整:即使通过函数 Renderer.setRenderContentFlags 设置了标志 com.foxit.sdk.common.Renderer.e_RenderAnnot ,所有注释都将被忽略; 文本内容将变得模糊并被像素点替代。
当页面具有复杂或大量内容时,这种快速渲染可能仍需要很长时间, 因此Foxit PDF SDK使用渐进式过程来完成。

参数
[in]page有效的PDF页面。应该已经被解析。
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.PDFPage.getDisplayMatrix 返回。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。 默认值:null
返回
渐进对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的速率。 如果速率尚未达到100,调用函数 Progressive.resume 继续进度直到进度完成。

◆ startRender()

Progressive com.foxit.sdk.common.Renderer.startRender ( PDFPage  page,
Matrix2D  matrix,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始渲染PDF页面。

渲染具有复杂或大量内容的PDF页面可能需要很长时间,因此Foxit PDF SDK使用 渐进式过程来完成。
在Foxit PDF SDK中,窗体注释总是与表单字段和表单控件关联。对于如何 渲染窗体注释,推荐流程如下:


参数
[in]page有效的PDF页面。如果只渲染注释(即只通过函数 Renderer.setRenderContentFlags 设置了 com.foxit.sdk.common.Renderer.e_RenderAnnot ),则无需解析输入页面; 否则输入页面应该已经被解析。
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.PDFPage.getDisplayMatrix 返回。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。 默认值:null
返回
渐进式对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的比率。如果比率还不是100,调用函数 Progressive.resume 继续进度直到进度完成。

◆ startRenderBitmap() [1/2]

Progressive com.foxit.sdk.common.Renderer.startRenderBitmap ( Bitmap  bitmap,
Matrix2D  matrix,
RectI  clip_rect,
int  interpolation,
int  alpha,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始渲染位图。

渲染具有复杂或大量内容的位图可能需要很长时间,因此Foxit PDF SDK使用 渐进式过程来完成。

参数
[in]bitmap有效的位图。用户应确保位图在 当前渲染过程完成之前保持有效。
[in]matrix用于渲染的变换矩阵。此矩阵用作图像矩阵:
假设 h 是图像高度,w 是图像宽度,那么矩阵 [w 0 0 h 0 0] 将产生一个相同的图像。
[in]clip_rect渲染设备的裁剪矩形。可以为 null
[in]interpolation位图插值标志。请参考从 com.foxit.sdk.common.Bitmap.e_Downsample 开始的值,可以是这些值中的一个或组合。 如果不指定任何标志,请使用0。
[in]alpha位图透明度值(0 = 完全透明,255 = 完全不透明)。 有效范围:从0到255。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。
返回
渐进对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的速率。 如果速率尚未达到100,调用函数 Progressive.resume 继续进度直到进度完成。

◆ startRenderBitmap() [2/2]

Progressive com.foxit.sdk.common.Renderer.startRenderBitmap ( Bitmap  bitmap,
Matrix2D  matrix,
RectI  clip_rect,
int  interpolation,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始渲染位图。

渲染具有复杂或大量内容的位图可能需要很长时间,因此Foxit PDF SDK使用 渐进式过程来完成。

参数
[in]bitmap有效的位图。用户应确保位图在 当前渲染过程完成之前保持有效。
[in]matrix用于渲染的变换矩阵。此矩阵用作图像矩阵:
假设 h 是图像高度,w 是图像宽度,那么矩阵 [w 0 0 h 0 0] 将产生一个相同的图像。
[in]clip_rect渲染设备的裁剪矩形。可以为 null。 默认值:null
[in]interpolation位图插值标志。请参考从 com.foxit.sdk.common.Bitmap.e_Downsample 开始的值,可以是这些值中的一个或组合。 如果不指定任何标志,请使用0。默认值:0。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。 默认值:null
返回
渐进对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的速率。 如果速率尚未达到100,调用函数 Progressive.resume 继续进度直到进度完成。

◆ startRenderReflowPage()

Progressive com.foxit.sdk.common.Renderer.startRenderReflowPage ( ReflowPage  reflow_page,
Matrix2D  matrix,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始渲染重排页面。

渲染具有复杂或大量内容的重排页面可能需要很长时间,因此Foxit PDF SDK使用 渐进式过程来完成。

参数
[in]reflow_page有效的重排页面。应该已经被解析。
[in]matrix用于渲染的变换矩阵,通常由函数 pdf.ReflowPage.getDisplayMatrix 返回。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。 默认值:null
返回
渐进式对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的比率。如果比率还不是100,调用函数 Progressive.resume 继续进度直到进度完成。

◆ startRenderXFAPage()

Progressive com.foxit.sdk.common.Renderer.startRenderXFAPage ( XFAPage  xfa_page_view,
Matrix2D  matrix,
boolean  is_highlight,
PauseCallback  pause 
) throws com.foxit.sdk.PDFException

开始渲染XFA页面。

渲染具有复杂或大量内容的XFA页面将需要很长时间,因此Foxit PDF SDK使用 渐进式过程来完成。

参数
[in]xfa_page_view有效的XFA页面。
[in]matrix用于渲染的变换矩阵,通常由函数 addon.xfa.XFAPage.getDisplayMatrix 返回。
[in]is_highlighttrue 表示高亮XFA小部件,false 表示不高亮 XFA小部件。
[in]pause暂停回调对象,决定渲染过程是否需要暂停。 可以为 null,表示在渲染过程中不暂停。 如果不为 null,应该是用户实现的有效暂停对象。 默认值:null
返回
渐进对象。请通过函数 Progressive.getRateOfProgress 检查当前进度的速率。 如果速率尚未达到100,调用函数 Progressive.resume 继续进度直到进度完成。