FoxitPDFSDKforWeb v12.0.0
Foxit PDF SDK for Web
DocCustomRender Interface Reference

An interface for injecting custom content or gating default document rendering. Assign a constructor that implements this interface to options.customs.DocCustomRender. The SDK creates an instance with the document custom container (.fv__pdf-doc-custom-container) and the owner PDFDocRender, then calls DocCustomRender.render before pages are rendered. More...

Public Member Functions

 constructor (eCustom, pdfDocRender)
 Create a document custom render controller. More...
 
void destroy ()
 Destroy the custom render controller and release references. More...
 
CustomRenderResult render (scale, rotation)
 Called before the document renders its pages. Use eCustom to inject overlay content, or return/resolves to false to skip default page rendering. More...
 

Detailed Description

An interface for injecting custom content or gating default document rendering. Assign a constructor that implements this interface to options.customs.DocCustomRender. The SDK creates an instance with the document custom container (.fv__pdf-doc-custom-container) and the owner PDFDocRender, then calls DocCustomRender.render before pages are rendered.

Note
If DocCustomRender.render resolves to false, the SDK aborts default document page rendering.
See also
PDFViewer.constructor
PageCustomRender

Member Function Documentation

◆ constructor()

DocCustomRender::constructor ( eCustom  ,
pdfDocRender   
)

Create a document custom render controller.

Parameters
eCustomHTMLElement - Host element for custom document content (.fv__pdf-doc-custom-container).
pdfDocRenderPDFDocRender - Owner document render instance.

◆ destroy()

void DocCustomRender::destroy ( )

Destroy the custom render controller and release references.

Returns
void

◆ render()

CustomRenderResult DocCustomRender::render ( scale  ,
rotation   
)

Called before the document renders its pages. Use eCustom to inject overlay content, or return/resolves to false to skip default page rendering.

Parameters
scalenumber - Current zoom scale.
rotationnumber - Current document rotation.
Returns
CustomRenderResult - Return false (or a Promise that resolves to false) to abort default document page rendering.

Foxit Software Corporation Logo
@2026 Foxit Software Incorporated. All rights reserved.