diff --git a/examples/node/getinfo.js b/examples/node/getinfo.js index 944f9e930..1cd59bcfc 100644 --- a/examples/node/getinfo.js +++ b/examples/node/getinfo.js @@ -53,6 +53,8 @@ loadingTask.promise }); console.log("## Text Content"); console.log(strings.join(" ")); + // Release page resources. + page.cleanup(); }) .then(function () { console.log(); diff --git a/examples/node/pdf2png/pdf2png.js b/examples/node/pdf2png/pdf2png.js index 85e5a66ec..cc66cfcf1 100644 --- a/examples/node/pdf2png/pdf2png.js +++ b/examples/node/pdf2png/pdf2png.js @@ -103,6 +103,8 @@ const loadingTask = pdfjsLib.getDocument({ ); } }); + // Release page resources. + page.cleanup(); } catch (reason) { console.log(reason); } diff --git a/examples/node/pdf2svg.js b/examples/node/pdf2svg.js index 11d4d1101..0fa1cb41c 100644 --- a/examples/node/pdf2svg.js +++ b/examples/node/pdf2svg.js @@ -118,6 +118,8 @@ const loadingTask = pdfjsLib.getDocument({ svgGfx.embedFonts = true; const svg = await svgGfx.getSVG(opList, viewport); await writeSvgToFile(svg, getFilePathForPage(pageNum)); + // Release page resources. + page.cleanup(); } catch (err) { console.log(`Error: ${err}`); } diff --git a/examples/text-only/pdf2svg.js b/examples/text-only/pdf2svg.js index 201460324..df9652ede 100644 --- a/examples/text-only/pdf2svg.js +++ b/examples/text-only/pdf2svg.js @@ -58,6 +58,8 @@ async function pageLoaded() { // building SVG and adding that to the DOM const svg = buildSVG(viewport, textContent); document.getElementById("pageContainer").appendChild(svg); + // Release page resources. + page.cleanup(); } document.addEventListener("DOMContentLoaded", function () {