diff --git a/apps/rn/src/tests/test3.js b/apps/rn/src/tests/test3.js index d6855e42d..0f6598985 100644 --- a/apps/rn/src/tests/test3.js +++ b/apps/rn/src/tests/test3.js @@ -14,11 +14,13 @@ export default async () => { catRidingUnicornBytes, cmykBytes, normalPdfBase64, + existingPdfBytes, ] = await Promise.all([ fetchAsset('pdfs/with_update_sections.pdf'), fetchAsset('images/cat_riding_unicorn_resized.jpg'), fetchAsset('images/cmyk_colorspace.jpg'), fetchAsset('pdfs/normal.pdf'), + fetchAsset('pdfs/with_annots.pdf'), ]); const pdfDoc = await PDFDocument.load(inputPdfBytes, { @@ -42,7 +44,6 @@ export default async () => { const page0 = pdfDoc.insertPage(0, [305, 250]); const page1 = pdfDoc.getPage(1); - const existingPdfBytes = await fetchBinaryAsset('pdfs/with_annots.pdf'); const docWithAnnots = await PDFDocument.load(existingPdfBytes); const [page2] = await pdfDoc.copyPages(docWithAnnots, [0]); page2.scaleContent(0.5, 0.5); diff --git a/apps/rn/yarn.lock b/apps/rn/yarn.lock index 4300185e4..d0ae7978d 100644 --- a/apps/rn/yarn.lock +++ b/apps/rn/yarn.lock @@ -4885,7 +4885,7 @@ path-type@^3.0.0: pify "^3.0.0" pdf-lib@./../..: - version "1.16.0" + version "1.17.0" dependencies: "@pdf-lib/standard-fonts" "^1.0.0" "@pdf-lib/upng" "^1.0.1" diff --git a/apps/web/test3.html b/apps/web/test3.html index 268dd5bfe..985198f0c 100644 --- a/apps/web/test3.html +++ b/apps/web/test3.html @@ -53,11 +53,13 @@ catRidingUnicornBytes, cmykBytes, normalPdfBase64, + existingPdfBytes, ] = await Promise.all([ fetchStringAsset('pdfs/with_update_sections.pdf.base64.uri'), fetchBinaryAsset('images/cat_riding_unicorn.jpg'), fetchBinaryAsset('images/cmyk_colorspace.jpg'), fetchStringAsset('pdfs/normal.pdf.base64'), + fetchBinaryAsset('pdfs/with_annots.pdf'), ]); const pdfDoc = await PDFDocument.load(inputPdfBase64, { @@ -82,8 +84,7 @@ const page0 = pdfDoc.insertPage(0, [305, 250]); const page1 = pdfDoc.getPage(1); - - const existingPdfBytes = await fetchBinaryAsset('pdfs/with_annots.pdf'); + const docWithAnnots = await PDFDocument.load(existingPdfBytes); const [page2] = await pdfDoc.copyPages(docWithAnnots, [0]); page2.scaleContent(0.5, 0.5); @@ -94,7 +95,7 @@ const [page4] = await pdfDoc.copyPages(docWithAnnots, [0]); page4.scale(0.5, 0.5); pdfDoc.addPage(page4); - + const page5 = pdfDoc.addPage([305, 250]); const hotPink = rgb(1, 0, 1); diff --git a/package.json b/package.json index ce32f76dc..60498bbbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdf-lib", - "version": "1.16.0", + "version": "1.17.0", "description": "Create and modify PDF files with JavaScript", "author": "Andrew Dillon ", "contributors": [