Merge pull request #12261 from Snuffleupagus/renderInteractiveForms-defaults

Also enable `renderInteractiveForms` by default in the viewer components (PR 12201 follow-up)
This commit is contained in:
Tim van der Meij 2020-08-22 16:48:42 +02:00 committed by GitHub
commit 9d7609d255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

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