File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,13 @@ export default async () => {
1414 catRidingUnicornBytes ,
1515 cmykBytes ,
1616 normalPdfBase64 ,
17+ existingPdfBytes ,
1718 ] = await Promise . all ( [
1819 fetchAsset ( 'pdfs/with_update_sections.pdf' ) ,
1920 fetchAsset ( 'images/cat_riding_unicorn_resized.jpg' ) ,
2021 fetchAsset ( 'images/cmyk_colorspace.jpg' ) ,
2122 fetchAsset ( 'pdfs/normal.pdf' ) ,
23+ fetchAsset ( 'pdfs/with_annots.pdf' ) ,
2224 ] ) ;
2325
2426 const pdfDoc = await PDFDocument . load ( inputPdfBytes , {
@@ -42,7 +44,6 @@ export default async () => {
4244 const page0 = pdfDoc . insertPage ( 0 , [ 305 , 250 ] ) ;
4345 const page1 = pdfDoc . getPage ( 1 ) ;
4446
45- const existingPdfBytes = await fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ;
4647 const docWithAnnots = await PDFDocument . load ( existingPdfBytes ) ;
4748 const [ page2 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
4849 page2 . scaleContent ( 0.5 , 0.5 ) ;
Original file line number Diff line number Diff line change @@ -4885,7 +4885,7 @@ path-type@^3.0.0:
48854885 pify "^3.0.0"
48864886
48874887pdf-lib@./../.. :
4888- version "1.16 .0"
4888+ version "1.17 .0"
48894889 dependencies :
48904890 " @pdf-lib/standard-fonts" " ^1.0.0"
48914891 " @pdf-lib/upng" " ^1.0.1"
Original file line number Diff line number Diff line change 5353 catRidingUnicornBytes ,
5454 cmykBytes ,
5555 normalPdfBase64 ,
56+ existingPdfBytes ,
5657 ] = await Promise . all ( [
5758 fetchStringAsset ( 'pdfs/with_update_sections.pdf.base64.uri' ) ,
5859 fetchBinaryAsset ( 'images/cat_riding_unicorn.jpg' ) ,
5960 fetchBinaryAsset ( 'images/cmyk_colorspace.jpg' ) ,
6061 fetchStringAsset ( 'pdfs/normal.pdf.base64' ) ,
62+ fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ,
6163 ] ) ;
6264
6365 const pdfDoc = await PDFDocument . load ( inputPdfBase64 , {
8284
8385 const page0 = pdfDoc . insertPage ( 0 , [ 305 , 250 ] ) ;
8486 const page1 = pdfDoc . getPage ( 1 ) ;
85-
86- const existingPdfBytes = await fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ;
87+
8788 const docWithAnnots = await PDFDocument . load ( existingPdfBytes ) ;
8889 const [ page2 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
8990 page2 . scaleContent ( 0.5 , 0.5 ) ;
9495 const [ page4 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
9596 page4 . scale ( 0.5 , 0.5 ) ;
9697 pdfDoc . addPage ( page4 ) ;
97-
98+
9899 const page5 = pdfDoc . addPage ( [ 305 , 250 ] ) ;
99100
100101 const hotPink = rgb ( 1 , 0 , 1 ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " pdf-lib" ,
3- "version" : " 1.16 .0" ,
3+ "version" : " 1.17 .0" ,
44 "description" : " Create and modify PDF files with JavaScript" ,
55 "author" :
" Andrew Dillon <[email protected] >" ,
66 "contributors" : [
You can’t perform that action at this time.
0 commit comments