Skip to content

Commit

Permalink
Also enable renderInteractiveForms by default in the viewer compone…
Browse files Browse the repository at this point in the history
…nts (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.
  • Loading branch information
Snuffleupagus committed Aug 22, 2020
1 parent 37c5660 commit 579d2af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions web/base_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 579d2af

Please sign in to comment.