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 () => {
14
14
catRidingUnicornBytes ,
15
15
cmykBytes ,
16
16
normalPdfBase64 ,
17
+ existingPdfBytes ,
17
18
] = await Promise . all ( [
18
19
fetchAsset ( 'pdfs/with_update_sections.pdf' ) ,
19
20
fetchAsset ( 'images/cat_riding_unicorn_resized.jpg' ) ,
20
21
fetchAsset ( 'images/cmyk_colorspace.jpg' ) ,
21
22
fetchAsset ( 'pdfs/normal.pdf' ) ,
23
+ fetchAsset ( 'pdfs/with_annots.pdf' ) ,
22
24
] ) ;
23
25
24
26
const pdfDoc = await PDFDocument . load ( inputPdfBytes , {
@@ -42,7 +44,6 @@ export default async () => {
42
44
const page0 = pdfDoc . insertPage ( 0 , [ 305 , 250 ] ) ;
43
45
const page1 = pdfDoc . getPage ( 1 ) ;
44
46
45
- const existingPdfBytes = await fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ;
46
47
const docWithAnnots = await PDFDocument . load ( existingPdfBytes ) ;
47
48
const [ page2 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
48
49
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:
4885
4885
pify "^3.0.0"
4886
4886
4887
4887
pdf-lib@./../.. :
4888
- version "1.16 .0"
4888
+ version "1.17 .0"
4889
4889
dependencies :
4890
4890
" @pdf-lib/standard-fonts" " ^1.0.0"
4891
4891
" @pdf-lib/upng" " ^1.0.1"
Original file line number Diff line number Diff line change 53
53
catRidingUnicornBytes ,
54
54
cmykBytes ,
55
55
normalPdfBase64 ,
56
+ existingPdfBytes ,
56
57
] = await Promise . all ( [
57
58
fetchStringAsset ( 'pdfs/with_update_sections.pdf.base64.uri' ) ,
58
59
fetchBinaryAsset ( 'images/cat_riding_unicorn.jpg' ) ,
59
60
fetchBinaryAsset ( 'images/cmyk_colorspace.jpg' ) ,
60
61
fetchStringAsset ( 'pdfs/normal.pdf.base64' ) ,
62
+ fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ,
61
63
] ) ;
62
64
63
65
const pdfDoc = await PDFDocument . load ( inputPdfBase64 , {
82
84
83
85
const page0 = pdfDoc . insertPage ( 0 , [ 305 , 250 ] ) ;
84
86
const page1 = pdfDoc . getPage ( 1 ) ;
85
-
86
- const existingPdfBytes = await fetchBinaryAsset ( 'pdfs/with_annots.pdf' ) ;
87
+
87
88
const docWithAnnots = await PDFDocument . load ( existingPdfBytes ) ;
88
89
const [ page2 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
89
90
page2 . scaleContent ( 0.5 , 0.5 ) ;
94
95
const [ page4 ] = await pdfDoc . copyPages ( docWithAnnots , [ 0 ] ) ;
95
96
page4 . scale ( 0.5 , 0.5 ) ;
96
97
pdfDoc . addPage ( page4 ) ;
97
-
98
+
98
99
const page5 = pdfDoc . addPage ( [ 305 , 250 ] ) ;
99
100
100
101
const hotPink = rgb ( 1 , 0 , 1 ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " pdf-lib" ,
3
- "version" : " 1.16 .0" ,
3
+ "version" : " 1.17 .0" ,
4
4
"description" : " Create and modify PDF files with JavaScript" ,
5
5
"author" :
" Andrew Dillon <[email protected] >" ,
6
6
"contributors" : [
You can’t perform that action at this time.
0 commit comments