pdf.js/examples
Jonas Jenwald c6d400ed06 Export the XFA/StructTree-layers in the viewer components
While e.g. the `simpleviewer` and `singlepageviewer` examples work, since they're based on the `BaseViewer`-class, the standalone `pageviewer` example currently doesn't support either XFA- or StructTree-layers. This seems like an obvious oversight, which can be easily addressed simply by exporting the necessary functionality through `pdf_viewer.component.js`, similar to the existing Text/Annotation-layers.

While working on, and testing, these changes I happened to notice a number of smaller things that's also fixed in this patch:

 - Ensure that `XfaLayerBuilder.render` always have a *consistent* return type, to prevent possible run-time failures in `PDFPageView`; PR 13908 follow-up.

 - Change the order of the options in the `XfaLayerBuilder`-constructor to agree with the parameter order in the `DefaultXfaLayerFactory.createXfaLayerBuilder`-method.

 - Add a missing `textHighlighterFactory`-option, in the JSDocs for the `PDFPageView`-class.

 - A couple of small tweaks in the `TextLayerBuilder.render`-method: Re-use an existing Array rather than creating a new one, and replace an `if` with optional chaining instead.

*Please note:* For now XFA-support is currently disabled by default, similar to the regular viewer.
2021-08-28 18:43:08 +02:00
..
browserify Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
components Export the XFA/StructTree-layers in the viewer components 2021-08-28 18:43:08 +02:00
image_decoders Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
learning Add direction: ltr; to the canvases used in examples/learning, to ensure correct text rendering (issue 11457) 2020-01-12 12:25:23 +01:00
mobile-viewer Simplify the animationStarted handling in the mobile-viewer/ example 2021-03-12 17:52:58 +01:00
node Stop encoding the value in the DOMElement.setAttribute method (issue 8558) 2021-06-20 11:55:24 +02:00
svgviewer Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
text-only Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
webpack Update webpack import instructions 2021-05-28 20:46:56 -04:00
.eslintrc Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00