Foxit PDF SDK

Instance Methods | List of all members
FSRenderer Class Reference
Inheritance diagram for FSRenderer:

## Instance Methods
(void) | - clearClips
| Clear the clipping rectangle set by function FSRenderer::setClipRect:. More...
(void) | - enableForPrint:
| Set the flag to decide whether to do rendering in print mode. More...
(id) | - initWithBitmap:is_rgb_order:
| Constructor, with bitmap. More...
(id) | - initWithContext:device_type:
| Constructor, with device context. More...
(id) | - initWithOther:
| Constructor, with another renderer object. More...
(BOOL) | - isEmpty
| Check whether current object is empty or not. More...
(BOOL) | - renderAnnot:matrix:
| Render a specified annotation. More...
(BOOL) | - renderFormControls:matrix:
| Render form controls. More...
(BOOL) | - renderGraphicsObject:page:matrix:
| Render a graphics object. More...
(void) | - setClearType:
| Set the flag to decide whether to use ClearType-like anti-aliasing to render text objects. More...
(void) | - setClipPathFill:matrix:fill_mode:
| Set clipping path using filled region. More...
(void) | - setClipPathStroke:matrix:graph_state:
| Set clipping path using stroked region. More...
(void) | - setClipRect:
| Set the clipping rectangle which will be used in subsequent rendering progress. More...
(void) | - setColorMode:
| Set color mode. More...
(void) | - setForceDownSample:
| Set the flag to decide whether to use down-sampling for image stretching. More...
(void) | - setForceHalftone:
| Set the flag to decide whether to use halftone for image stretching. More...
(void) | - setForegroundColor:
| Set foreground color for text, path or both when color mode is FSRendererColorModeForeground. More...
(void) | - setForegroundColorMode:
| Set rendering foreground color mode when color mode is FSRendererColorModeForeground. More...
(void) | - setJPEGDownSample:
| Set the flag to decide whether to use down-sampling for jpeg image. More...
(void) | - setJPXDownSample:
| Set the flag to decide whether to use down-sampling for jpx image. More...
(void) | - setLayerContext:
| Set layer context to render context handle. More...
(void) | - setMappingModeColors:foreground_color:
| Set background color and foreground color when color mode is FSRendererColorModeMappingGray or FSRendererColorModeMapping. More...
(void) | - setOverprint:
| Set the flag to decide whether to enable overprint. More...
(void) | - setPrintTextAsGraphic:
| Set the flag to decide whether to print text as path or bitmap. More...
(void) | - setPrintTextAsImage:
| Set the flag to decide whether to print text as image. More...
(void) | - setRenderAnnotAppearanceType:
| Set the annotation's appearance type for rendering. More...
(void) | - setRenderAnnotsForThumbnail:
| Set rendering flag to decide whether to render annotations in thumbnail mode or not. More...
(void) | - setRenderContentFlags:
| Set rendering flag to decide what content will be rendered. More...
(void) | - setRenderEnhanceThinLines:
| Set the flag to decide whether to enhance thin lines. More...
(void) | - setRenderFormField:
| Set the flag to decide whether to render form fields (except signature fields). More...
(void) | - setRenderImageAntiAliasing:
| Set the flag to decide whether to draw image anti-aliasing. More...
(void) | - setRenderLayer:
| Set the flag to decide whether to render one layer or all available layers. More...
(void) | - setRenderPathAntiAliasing:
| Set the flag to decide whether to draw path anti-aliasing. More...
(void) | - setRenderPathFullCovered:
| A special flag that can be applied to fill mode. More...
(void) | - setRenderPathThinLine:
| Set the flag to decide whether to draw path as thin line. More...
(void) | - setRenderSignature:
| Set the flag to decide whether to render signatures or not. More...
(void) | - setRenderSignatureState:
| Set the flag to decide whether to draw the signature state on the signature. More...
(void) | - setRenderTextAntiAliasing:
| Set the flag to decide whether to draw text anti-aliasing. More...
(void) | - setScreenDPIScale:
| Set the screen DPI scaling factor for rendering. More...
(FSProgressive *) | - startQuickRender:matrix:pause:
| Start to quickly render a PDF page, mainly for thumbnail purpose. More...
(FSProgressive *) | - startRender:matrix:pause:
| Start to render a PDF page. More...
(FSProgressive *) | - startRenderBitmap:matrix:clip_rect:interpolation:pause:
| Start to render a bitmap. More...
(FSProgressive *) | - startRenderBitmapWithAlpha:matrix:clip_rect:interpolation:alpha:pause:
| Start to render a bitmap. More...
(FSProgressive *) | - startRenderReflowPage:matrix:pause:
| Start to render a reflow page. More...
(FSProgressive *) | - startRenderXFAPage:matrix:is_highlight:pause:
| Start to render an XFA page. More...

## Detailed Description

PDF renderer is a graphics engine and is used to render page to a bitmap or a platform device context. This class can be constructed with a bitmap, or a device object. It offers functions to set rendering options/flags, and do rendering. In this class, there are several ways to do rendering:

- To render page and annotations, first use function FSRenderer::setRenderContentFlags: to decide whether to render page and annotation both or not, and then use functions FSRenderer::startRender:matrix:pause: to do the rendering. Function FSRenderer::startQuickRender:matrix:pause: can also be used to render page but only for thumbnail purpose.
- To render a single annotation, use function FSRenderer::renderAnnot:matrix:.
- To render a bitmap, use function FSRenderer::startRenderBitmapWithAlpha:matrix:clip_rect:interpolation:alpha:pause:.
- To render a reflow page, use function FSRenderer::startRenderReflowPage:matrix:pause:.

Widget annotation is always associated with form field and form control in Foxit PDF SDK. For how to render widget annotations, here is a recommended flow:

- After loading a PDF page, first render the page and all annotations in this page (including widget annotations).
- Then, if user uses FSFiller object to fill the form, user should use function FSFiller::render:matrix:renderer: to render the focused form control instead of using function FSRenderer::renderAnnot:matrix:.

See also
  FSFiller

## Method Documentation

## ◆ clearClips()

- (void) clearClips |  |  |

Clear the clipping rectangle set by function FSRenderer::setClipRect:.

Returns
  None.

## ◆ enableForPrint:()

- (void) enableForPrint: |  | (BOOL) | is_render_for_print |

Set the flag to decide whether to do rendering in print mode.

Please ensure this rendering flag is set as expected when current renderer is to used for printing. For rendering annotations, if this flag is set to be YES, Foxit PDF SDK will only render annotations which have annotation flag FSAnnotFlagPrint.
If this function is not called for current renderer object yet, default value NO will be used.

Parameters

  [in] | is_render_for_print | YES means to render in print mode, while NO means to render not in print mode.

Returns
  None.

## ◆ initWithBitmap:is_rgb_order:()

- (id) initWithBitmap: |  | (FSBitmap*) | bitmap
is_rgb_order: |  | (BOOL) | is_rgb_order

Constructor, with bitmap.

The input bitmap is treated as an independent device and all the content rendered by the renderer would appear in the bitmap.

Parameters

  [in] | bitmap | A bitmap used for rendering. User should ensure the bitmap to keep valid until the end of life cycle of current renderer object.
  [in] | is_rgb_order | YES means Foxit PDF SDK needs to use RGB byte-order (Red is in the lowest order) when rendering. NO means Foxit PDF SDK needs to use BGR byte-order (Blue is in the lowest order) when rendering.

## ◆ initWithContext:device_type:()

- (id) initWithContext: |  | (CGContextRef) | context
device_type: |  | (FSRendererDeviceType) | device_type

Constructor, with device context.

All the content rendered by the renderer would appear in CGContextRef object.

Parameters

  [in] | context | A CGContextRef object. User should ensure the device to keep valid until the end of life cycle of current renderer object.
  [in] | device_type | The device type of parameter context. Please refer to FSRendererDeviceXXX values and it should be one of these values.

## ◆ initWithOther:()

- (id) initWithOther: |  | (FSRenderer*) | other |

Constructor, with another renderer object.

Parameters

  [in] | other | Another renderer object.

## ◆ isEmpty()

- (BOOL) isEmpty |  |  |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  YES means current object is empty, while NO means not.

## ◆ renderAnnot:matrix:()

- (BOOL) renderAnnot: |  | (FSAnnot*) | annot
matrix: |  | (FSMatrix2D*) | matrix

Render a specified annotation.

When this function is called, rendering flag (set by function FSRenderer::setRenderContentFlags: or by default) will be ignored.

Parameters

  [in] | annot | An annotation object to be rendered. If input annot is a pop-up annotation, this function will not render it and will return NO.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSPDFPage::getDisplayMatrix:top:width:height:rotate:.

Returns
  YES means success, while NO means failure.

## ◆ renderFormControls:matrix:()

- (BOOL) renderFormControls: |  | (FSPDFPage*) | page
matrix: |  | (FSMatrix2D*) | matrix

Render form controls.

When this function is called, rendering flag (set by function FSRenderer::setRenderContentFlags: or by default) will be ignored.

Parameters

  [in] | page | A valid PDF page. If input page is invalid, this function do nothing and return NO directly.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSPDFPage::getDisplayMatrix:top:width:height:rotate:.

Returns
  YES means success, while NO means failure.

## ◆ renderGraphicsObject:page:matrix:()

- (BOOL) renderGraphicsObject: |  | (FSGraphicsObject*) | graphics_object
page: |  | (FSPDFPage*) | page
matrix: |  | (FSMatrix2D*) | matrix

Render a graphics object.

When this function is called, rendering flag (set by function FSRenderer::setRenderContentFlags: or by default) will be ignored.

Parameters

  [in] | graphics_object | A valid PDF graphics object to be rendered.
  [in] | page | A valid PDF page. Parameter graphics_object belongs to this PDF page.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSPDFPage::getDisplayMatrix:top:width:height:rotate:.

Returns
  YES means success, while NO means failure.

## ◆ setClearType:()

- (void) setClearType: |  | (BOOL) | is_clear_type |

Set the flag to decide whether to use ClearType-like anti-aliasing to render text objects.

If this function is not called, default value YES will be used.

Parameters

  [in] | is_clear_type | YES means to use ClearType-like anti-aliasing to render text objects. NO means not to use ClearType-like anti-aliasing to render text objects.

Returns
  None.

## ◆ setClipPathFill:matrix:fill_mode:()

- (void) setClipPathFill: |  | (FSPath*) | clip_path
matrix: |  | (FSMatrix2D*) | matrix
fill_mode: |  | (FSFillMode) | fill_mode

Set clipping path using filled region.

Parameters

  [in] | clip_path | A clipping path.
  [in] | matrix | The transformation matrix used for clipping.
  [in] | fill_mode | Fill mode. It should be value or .

Returns
  None.

## ◆ setClipPathStroke:matrix:graph_state:()

- (void) setClipPathStroke: |  | (FSPath*) | clip_path
matrix: |  | (FSMatrix2D*) | matrix
graph_state: |  | (FSGraphState*) | graph_state

Set clipping path using stroked region.

Parameters

  [in] | clip_path | A clipping path.
  [in] | matrix | The transformation matrix used for clipping.
  [in] | graph_state | A valid graph state, for pen attributes. If this is nil, Foxit PDF SDK will use a graph state object with default constructor. Default value: nil.

Returns
  None.

## ◆ setClipRect:()

- (void) setClipRect: |  | (FSRectI*) | clip_rect |

Set the clipping rectangle which will be used in subsequent rendering progress.

Parameters

  [in] | clip_rect | A clipping rectangle. If it is nil, that means not to use clipping rectangle in subsequent rendering progress.

Returns
  None.

## ◆ setColorMode:()

- (void) setColorMode: |  | (FSRendererColorMode) | color_mode |

Set color mode.

If this function is not called, default value FSRendererColorModeNormal will be used.

Parameters

  [in] | color_mode | Color mode value. It should be one of following values: FSRendererColorModeNormal means normal color mode. FSRendererColorModeMappingGray means to map white/black color value to background/foreground; for other colors, no change. If this mode is used, please call function FSRenderer::setMappingModeColors:foreground_color: to set "background color" and "foreground color". FSRendererColorModeMapping means to map a color value to the color range defined by a background color and a foreground color. If this mode is used, please call function FSRenderer::setMappingModeColors:foreground_color: to set "background color" and "foreground color".

Returns
  None.

## ◆ setForceDownSample:()

- (void) setForceDownSample: |  | (BOOL) | is_to_force_down_sample |

Set the flag to decide whether to use down-sampling for image stretching.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_to_force_down_sample | YES means to use down-sampling for image stretching. NO means not to use down-sampling for image stretching.

Returns
  None.

## ◆ setForceHalftone:()

- (void) setForceHalftone: |  | (BOOL) | is_to_force_halftone |

Set the flag to decide whether to use halftone for image stretching.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_to_force_halftone | YES means to use halftone for image stretching. NO means not to use halftone for image stretching.

Returns
  None.

## ◆ setForegroundColor:()

- (void) setForegroundColor: |  | (unsigned int) | foreground_color |

Set foreground color for text, path or both when color mode is FSRendererColorModeForeground.

The foreground color for text, path, or both is determined by the foreground color mode set by the function FSRenderer::setForegroundColorMode:.

Parameters

  [in] | foreground_color | The foreground color for text, path, or both. Format: 0xAARRGGBB.

Returns
  None.

## ◆ setForegroundColorMode:()

- (void) setForegroundColorMode: |  | (unsigned int) | foreground_color_mode |

Set rendering foreground color mode when color mode is FSRendererColorModeForeground.

If this function is not called, default value (FSRendererColorModeForegroundText | FSRendererColorModeForegroundPath | FSRendererColorModeForegroundBlackText | FSRendererColorModeForegroundBlackPath) will be used.

Parameters

  [in] | foreground_color_mode | Rendering foreground color mode. Please refer to values starting from FSRendererColorModeForegroundText and this should be one or a combination of these values.

Returns
  None.

## ◆ setJPEGDownSample:()

- (void) setJPEGDownSample: |  | (BOOL) | is_jepg_down_sample |

Set the flag to decide whether to use down-sampling for jpeg image.

Whether to use down-sampling for jpeg image or not will affect rendering result for a PDF page. When current function is called successfully, user should called function FSPDFPage::clearRenderCache for a PDF page (which has been rendered at least once) before rendering the PDF page again.
If this function is not called, default value YES will be used.

Parameters

  [in] | is_jepg_down_sample | YES means to use down-sampling for jpeg image. NO means not to use down-sampling for jpeg image.

Returns
  None.

## ◆ setJPXDownSample:()

- (void) setJPXDownSample: |  | (BOOL) | is_jpx_down_sample |

Set the flag to decide whether to use down-sampling for jpx image.

Whether to use down-sampling for jpx image or not will affect rendering result for a PDF page. When current function is called successfully, user should called function FSPDFPage::clearRenderCache for a PDF page (which has been rendered at least once) before rendering the PDF page again.
If this function is not called, default value YES will be used.

Parameters

  [in] | is_jpx_down_sample | YES means to use down-sampling for jpx image. NO means not to use down-sampling for jpx image.

Returns
  None.

## ◆ setLayerContext:()

- (void) setLayerContext: |  | (FSLayerContext*) | layer_context |

Set layer context to render context handle.

In order to render one layer when PDF page's contents is rendered on a rendering context, user should call this function to set the layer context to render context.

Parameters

  [in] | layer_context | A layer context object.

Returns
  None.

## ◆ setMappingModeColors:foreground_color:()

- (void) setMappingModeColors: |  | (unsigned int) | background_color
foreground_color: |  | (unsigned int) | foreground_color

Set background color and foreground color when color mode is FSRendererColorModeMappingGray or FSRendererColorModeMapping.

Parameters

  [in] | background_color | The background color. Format: 0xAARRGGBB.
  [in] | foreground_color | The foreground color. Format: 0xAARRGGBB.

Returns
  None.

## ◆ setOverprint:()

- (void) setOverprint: |  | (BOOL) | is_to_enable_overprint |

Set the flag to decide whether to enable overprint.

Parameters

  [in] | is_to_enable_overprint | YES means to enable overprint. NO means not to enable overprint. Default: NO.

Returns
  None.

## ◆ setPrintTextAsGraphic:()

- (void) setPrintTextAsGraphic: |  | (BOOL) | is_to_print_text_graphic |

Set the flag to decide whether to print text as path or bitmap.

When this flag is YES, Foxit PDF SDK will render text in different way: if font size is greater than 50, print text as path; otherwise, print text as bitmap.
If this function is not called, default value NO will be used.

Parameters

  [in] | is_to_print_text_graphic | YES means to print text as path or bitmap. NO means not to print text as path or bitmap.

Returns
  None.

## ◆ setPrintTextAsImage:()

- (void) setPrintTextAsImage: |  | (BOOL) | is_to_print_text_image |

Set the flag to decide whether to print text as image.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_to_print_text_image | YES means to print text as image. NO means not to print text as image.

Returns
  None.

## ◆ setRenderAnnotAppearanceType:()

- (void) setRenderAnnotAppearanceType: |  | (FSAnnotAppearanceType) | ap_type |

Set the annotation's appearance type for rendering.

Parameters

  [in] | ap_type | Type of annotation's appearance. Please refer to values starting from FSAnnotAppearanceTypeNormal and this should be one of these values.

Returns
  None.

## ◆ setRenderAnnotsForThumbnail:()

- (void) setRenderAnnotsForThumbnail: |  | (BOOL) | is_render_annots_for_thumbnail |

Set rendering flag to decide whether to render annotations in thumbnail mode or not.

In thumbnail mode, the flags of annotations, "NoZoom" and "NoRotate", will be ignored. This rendering flag is available only when flag FSRendererRenderAnnot is used for rendering or function FSRenderer::renderAnnot:matrix: is called. Please refer to function FSRenderer::setRenderContentFlags: about setting flag FSRendererRenderAnnot.
If this function is not called, default value NO will be used when this rendering flag is available.

Parameters

  [in] | is_render_annots_for_thumbnail | YES means to render annotations in thumbnail mode. NO means not to render annotations in thumbnail mode.

Returns
  None.

## ◆ setRenderContentFlags:()

- (void) setRenderContentFlags: |  | (unsigned int) | render_content_flags |

Set rendering flag to decide what content will be rendered.

If this function is not called, default value (FSRendererRenderPage | FSRendererRenderAnnot) will be used.

Parameters

  [in] | render_content_flags | Rendering content flags. Please refer to values starting from FSRendererRenderPage and this should be one or a combination of these values. The FSRendererRenderHighlight can not be combined with FSRendererRenderExceptHighlight.

Returns
  None.

## ◆ setRenderEnhanceThinLines:()

- (void) setRenderEnhanceThinLines: |  | (BOOL) | is_render_enhance_thin_lines |

Set the flag to decide whether to enhance thin lines.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_render_enhance_thin_lines | YES means to draw zero width lines with a thicker path so they are more visible than the default single pixel. NO means to draw zero width lines with a single pixel width.

Returns
  None.

## ◆ setRenderFormField:()

- (void) setRenderFormField: |  | (BOOL) | is_render_formfield |

Set the flag to decide whether to render form fields (except signature fields).

If this function is not called, default value YES will be used when this flag is available.

Parameters

  [in] | is_render_formfield | YES means to render form fields (except signature fields). NO means not to render form fields (except signature fields).

Returns
  None.

## ◆ setRenderImageAntiAliasing:()

- (void) setRenderImageAntiAliasing: |  | (BOOL) | is_render_image_antialiasing |

Set the flag to decide whether to draw image anti-aliasing.

If this function is not called, default value YES will be used.

Parameters

  [in] | is_render_image_antialiasing | YES means to draw image anti-aliasing, and the effect would be similar to values defined in enum class InterpolationFlag. NO means to draw image aliasing.

Returns
  None.

## ◆ setRenderLayer:()

- (void) setRenderLayer: |  | (BOOL) | is_render_one_layer |

Set the flag to decide whether to render one layer or all available layers.

If this function is not called, default value YES will be used when this flag is available.

Parameters

  [in] | is_render_one_layer | YES means to render one layer. NO means to render all available layers.

Returns
  None.

## ◆ setRenderPathAntiAliasing:()

- (void) setRenderPathAntiAliasing: |  | (BOOL) | is_render_path_antialiasing |

Set the flag to decide whether to draw path anti-aliasing.

If this function is not called, default value YES will be used.

Parameters

  [in] | is_render_path_antialiasing | YES means to draw path anti-aliasing. NO means to draw path aliasing.

Returns
  None.

## ◆ setRenderPathFullCovered:()

- (void) setRenderPathFullCovered: |  | (BOOL) | is_render_path_full_covered |

A special flag that can be applied to fill mode.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_render_path_full_covered | YES means that all pixels partially covered by the path will be fully painted, while NO means not.

Returns
  None.

## ◆ setRenderPathThinLine:()

- (void) setRenderPathThinLine: |  | (BOOL) | is_render_path_thin_line |

Set the flag to decide whether to draw path as thin line.

If this function is not called, default value NO will be used.

Parameters

  [in] | is_render_path_thin_line | YES means to draw path as thin line. NO means not to draw path as thin line.

Returns
  None.

## ◆ setRenderSignature:()

- (void) setRenderSignature: |  | (BOOL) | is_render_signature |

Set the flag to decide whether to render signatures or not.

If this function is not called, default value YES will be used when this flag is available.

Parameters

  [in] | is_render_signature | YES means to render signatures. NO means not to render signatures.

Returns
  None.

## ◆ setRenderSignatureState:()

- (void) setRenderSignatureState: |  | (BOOL) | is_render_signature_state |

Set the flag to decide whether to draw the signature state on the signature.

If this function is not called, default value YES will be used.

Parameters

  [in] | is_render_signature_state | YES means to draw the signature state on the signature, while NO means not.

## ◆ setRenderTextAntiAliasing:()

- (void) setRenderTextAntiAliasing: |  | (BOOL) | is_render_text_antialiasing |

Set the flag to decide whether to draw text anti-aliasing.

If this function is not called, default value YES will be used.

Parameters

  [in] | is_render_text_antialiasing | YES means to draw text anti-aliasing. NO means to draw text aliasing.

Returns
  None.

## ◆ setScreenDPIScale:()

- (void) setScreenDPIScale: |  | (float) | scale |

Set the screen DPI scaling factor for rendering.

Set the screen DPI scaling scale to adapt to different DPI conditions. This value should typically match the system-reported scaling factor (e.g., 1.25f for 125% scaling in display settings) to ensure proper rendering alignment with the physical display characteristics.

Parameters

  [in] | scale | The scale of curren screen DPI(1.0f = 100% native DPI, 2.0f = 200%, etc.). Must be greater than 0 and should generally correspond to the system's recommended scaling factor. Default value: 1.0f for non-Android platforms; 2.5f for Android platform.

Note
  Currently, this screen DPI scaling factor only affects the annotations.

Returns
  None.

## ◆ startQuickRender:matrix:pause:()

- (FSProgressive *) startQuickRender: |  | (FSPDFPage*) | page
matrix: |  | (FSMatrix2D*) | matrix
pause: |  | (id<FSPauseCallback>) | pause

Start to quickly render a PDF page, mainly for thumbnail purpose.

This function is mainly used for render a page for thumbnail purpose. The rendered content will not be completed: all the annotations will be ignored, event if flag FSRendererRenderAnnot is set by function FSRenderer::setRenderContentFlags:; text content will become blurred and will be replace by pixel point.
It may still take a long time to do this quick rendering when page has complex or large contents, so Foxit PDF SDK uses a progressive process to do this.

Parameters

  [in] | page | A valid PDF page. It should have been parsed.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSPDFPage::getDisplayMatrix:top:width:height:rotate:.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user. Default value: nil.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

## ◆ startRender:matrix:pause:()

- (FSProgressive *) startRender: |  | (FSPDFPage*) | page
matrix: |  | (FSMatrix2D*) | matrix
pause: |  | (id<FSPauseCallback>) | pause

Start to render a PDF page.

It may take a long time to render a PDF page with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.
Widget annotation is always associated with form field and form control in Foxit PDF SDK. For how to render widget annotations, here is a recommended flow:

- After loading a PDF page, first render the page and all annotations in this page (including widget annotations).
- Then, if user uses FSFiller object to fill the form, user should use function FSFiller::render:matrix:renderer: to render the focused form control instead of using function FSRenderer::renderAnnot:matrix:.

Parameters

  [in] | page | A valid PDF page. If only to render annotations (that means only FSRendererRenderAnnot is set by function FSRenderer::setRenderContentFlags:), there is no need to parse the input page; otherwise the input page should have been parsed.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSPDFPage::getDisplayMatrix:top:width:height:rotate:.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user. Default value: nil.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

## ◆ startRenderBitmap:matrix:clip_rect:interpolation:pause:()

- (FSProgressive *) startRenderBitmap: |  | (FSBitmap*) | bitmap
matrix: |  | (FSMatrix2D*) | matrix
clip_rect: |  | (FSRectI*) | clip_rect
interpolation: |  | (unsigned int) | interpolation
pause: |  | (id<FSPauseCallback>) | pause

Start to render a bitmap.

It may take a long time to render a bitmap with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.

Parameters

  [in] | bitmap | A valid bitmap. User should ensure the bitmap to keep valid until current rendering process is finished.
  [in] | matrix | The transformation matrix used for rendering. This matrix is used as image matrix: assume that h is image height, w is image width, and then matrix [w 0 0 h 0 0] will produce an identical image.
  [in] | clip_rect | Clip rectangle for the rendering device. This can be nil. Default value: nil.
  [in] | interpolation | Bitmap interpolation flags. Please refer to values starting from FSBitmapDownsample and this can be one or a combination of these values. If not specify any flag, please use 0. Default value: 0.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user. Default value: nil.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

## ◆ startRenderBitmapWithAlpha:matrix:clip_rect:interpolation:alpha:pause:()

- (FSProgressive *) startRenderBitmapWithAlpha: |  | (FSBitmap*) | bitmap
matrix: |  | (FSMatrix2D*) | matrix
clip_rect: |  | (FSRectI*) | clip_rect
interpolation: |  | (unsigned int) | interpolation
alpha: |  | (unsigned int) | alpha
pause: |  | (id<FSPauseCallback>) | pause

Start to render a bitmap.

It may take a long time to render a bitmap with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.

Parameters

  [in] | bitmap | A valid bitmap. User should ensure the bitmap to keep valid until current rendering process is finished.
  [in] | matrix | The transformation matrix used for rendering. This matrix is used as image matrix: assume that h is image height, w is image width, and then matrix [w 0 0 h 0 0] will produce an identical image.
  [in] | clip_rect | Clip rectangle for the rendering device. This can be nil.
  [in] | interpolation | Bitmap interpolation flags. Please refer to values starting from FSBitmapDownsample and this can be one or a combination of these values. If not specify any flag, please use 0.
  [in] | alpha | Bitmap alpha represents transparency (0 = fully transparent, 255 = fully opaque). Valid range: from 0 to 255.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

## ◆ startRenderReflowPage:matrix:pause:()

- (FSProgressive *) startRenderReflowPage: |  | (FSReflowPage*) | reflow_page
matrix: |  | (FSMatrix2D*) | matrix
pause: |  | (id<FSPauseCallback>) | pause

Start to render a reflow page.

It may take a long time to render a reflow page with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.

Parameters

  [in] | reflow_page | A valid reflow page. It should have been parsed.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSReflowPage::getDisplayMatrix:offset_y:width:height:rotate:.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user. Default value:nil.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.

## ◆ startRenderXFAPage:matrix:is_highlight:pause:()

- (FSProgressive *) startRenderXFAPage: |  | (FSXFAPage*) | xfa_page_view
matrix: |  | (FSMatrix2D*) | matrix
is_highlight: |  | (BOOL) | is_highlight
pause: |  | (id<FSPauseCallback>) | pause

Start to render an XFA page.

It will take a long time to render an XFA page with complex or large contents, so Foxit PDF SDK uses a progressive process to do this.

Parameters

  [in] | xfa_page_view | A valid XFA page.
  [in] | matrix | The transformation matrix used for rendering, which is usually returned by function FSXFAPage::getDisplayMatrix:top:width:height:rotate:.
  [in] | is_highlight | YES means to highlight XFA widgets, and NO means not to highlight XFA widgets.
  [in] | pause | Pause callback object which decides if the rendering process needs to be paused. This can be nil which means not to pause during the rendering process. If this is not nil, it should be a valid pause object implemented by user. Default value: nil.

Returns
  A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.