1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[api-minor] Combine the textContent/textContentStream parameters

Rather than handling these parameters separately, which is a left-over from back when streaming of textContent was originally added, we can simply pass either data directly to the `TextLayer` and let it handle things accordingly.

Also, improves a few JSDoc comments and `typedef`-imports.
This commit is contained in:
Jonas Jenwald 2022-12-04 17:42:24 +01:00
parent 67e1c37e0f
commit fe8fded23b
5 changed files with 58 additions and 62 deletions

View file

@ -263,7 +263,7 @@ class Rasterize {
// Rendering text layer as HTML.
const task = renderTextLayer({
textContent,
textContentSource: textContent,
container: div,
viewport,
});

View file

@ -33,7 +33,7 @@ describe("textLayer", function () {
const textContentItemsStr = [];
const textLayerRenderTask = renderTextLayer({
textContentStream: page.streamTextContent(),
textContentSource: page.streamTextContent(),
container: document.createElement("div"),
viewport: page.getViewport(),
textContentItemsStr,