Also enable renderInteractiveForms by default in the viewer components (PR 12201 follow-up)

Given that `renderInteractiveForms` is now enabled by default in "full" viewer, it seems reasonable to enable it by default in the viewer components as well.
Especially considering that it's simple to disable, when creating the affected components, for anyone implementing their own viewer.
This commit is contained in:
Jonas Jenwald 2020-08-22 13:58:33 +02:00
parent 37c5660394
commit a8de614a9f
5 changed files with 17 additions and 8 deletions

View File

@ -1500,7 +1500,10 @@ class AnnotationLayer {
linkService: parameters.linkService,
downloadManager: parameters.downloadManager,
imageResourcesPath: parameters.imageResourcesPath || "",
renderInteractiveForms: parameters.renderInteractiveForms || false,
renderInteractiveForms:
typeof parameters.renderInteractiveForms === "boolean"
? parameters.renderInteractiveForms
: true,
svgFactory: new DOMSVGFactory(),
annotationStorage:
parameters.annotationStorage || new AnnotationStorage(),

View File

@ -41,7 +41,7 @@ class AnnotationLayerBuilder {
downloadManager,
annotationStorage = null,
imageResourcesPath = "",
renderInteractiveForms = false,
renderInteractiveForms = true,
l10n = NullL10n,
}) {
this.pageDiv = pageDiv;
@ -133,7 +133,7 @@ class DefaultAnnotationLayerFactory {
pdfPage,
annotationStorage = null,
imageResourcesPath = "",
renderInteractiveForms = false,
renderInteractiveForms = true,
l10n = NullL10n
) {
return new AnnotationLayerBuilder({

View File

@ -65,7 +65,7 @@ const DEFAULT_CACHE_SIZE = 10;
* @property {string} [imageResourcesPath] - Path for image resources, mainly
* mainly for annotation icons. Include trailing slash.
* @property {boolean} [renderInteractiveForms] - Enables rendering of
* interactive form elements. The default is `false`.
* interactive form elements. The default value is `true`.
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
* landscape pages upon printing. The default is `false`.
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
@ -152,7 +152,10 @@ class BaseViewer {
? options.textLayerMode
: TextLayerMode.ENABLE;
this.imageResourcesPath = options.imageResourcesPath || "";
this.renderInteractiveForms = options.renderInteractiveForms || false;
this.renderInteractiveForms =
typeof options.renderInteractiveForms === "boolean"
? options.renderInteractiveForms
: true;
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
this.renderer = options.renderer || RendererType.CANVAS;
this.enableWebGL = options.enableWebGL || false;

View File

@ -178,7 +178,7 @@ class IPDFAnnotationLayerFactory {
pdfPage,
annotationStorage = null,
imageResourcesPath = "",
renderInteractiveForms = false,
renderInteractiveForms = true,
l10n = undefined
) {}
}

View File

@ -50,7 +50,7 @@ import { viewerCompatibilityParams } from "./viewer_compatibility.js";
* @property {string} [imageResourcesPath] - Path for image resources, mainly
* for annotation icons. Include trailing slash.
* @property {boolean} renderInteractiveForms - Turns on rendering of
* interactive form elements. The default is `false`.
* interactive form elements. The default value is `true`.
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
* @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for
* some operations. The default value is `false`.
@ -90,7 +90,10 @@ class PDFPageView {
? options.textLayerMode
: TextLayerMode.ENABLE;
this.imageResourcesPath = options.imageResourcesPath || "";
this.renderInteractiveForms = options.renderInteractiveForms || false;
this.renderInteractiveForms =
typeof options.renderInteractiveForms === "boolean"
? options.renderInteractiveForms
: true;
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;