Skip to content

Commit 8f2a6c7

Browse files
committed
Cleanup README
1 parent a24c1d6 commit 8f2a6c7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
- [Features](#features)
4141
- [Motivation](#motivation)
4242
- [Examples](#examples)
43-
- [Document Creation](#document-creation)
44-
- [Document Modification](#document-modification)
45-
- [Copying Pages](#copying-pages)
43+
- [Create Document](#create-document)
44+
- [Modify Document](#modify-document)
45+
- [Copy Pages](#copy-pages)
4646
- [Embed PNG and JPEG Images](#embed-png-and-jpeg-images)
4747
- [Embed Font and Measure Text](#embed-font-and-measure-text)
4848
- [Installation](#installation)
@@ -77,7 +77,7 @@ There are [other](#prior-art) good open source JavaScript PDF libraries availabl
7777

7878
## Examples
7979

80-
### Document Creation
80+
### Create Document
8181

8282
_This example produces [this PDF](assets/pdfs/examples/document_creation.pdf)._
8383

@@ -104,15 +104,15 @@ page.drawText('Creating PDFs in JavaScript is awesome!', {
104104
const pdfBytes = await pdfDoc.save()
105105
```
106106

107-
### Document Modification
107+
### Modify Document
108108

109109
_This example produces [this PDF](assets/pdfs/examples/document_modification.pdf)_ (when [this PDF](assets/pdfs/with_update_sections.pdf) is used for the `existingPdfBytes` variable).
110110

111111
<!-- prettier-ignore -->
112112
```js
113113
import { degrees, PDFDocument, rgb, StandardFonts } from 'pdf-lib';
114114

115-
// This should be a Uint8Array.
115+
// This should be a Uint8Array or ArrayBuffer.
116116
// This data can be obtained in a number of different ways.
117117
// If your running in a Node environment, you could use fs.readFile().
118118
// In the browser, you could make a fetch() call and use res.arrayBuffer().
@@ -138,7 +138,7 @@ firstPage.drawText('This text was added with JavaScript!', {
138138
const pdfBytes = await pdfDoc.save()
139139
```
140140

141-
### Copying Pages
141+
### Copy Pages
142142

143143
_This example produces [this PDF](assets/pdfs/examples/copying_pages.pdf)_ (when [this PDF](assets/pdfs/with_update_sections.pdf) is used for the `firstDonorPdfBytes` variable and [this PDF](assets/pdfs/with_large_page_count.pdf) is used for the `secondDonorPdfBytes` variable).
144144

@@ -148,8 +148,8 @@ import { PDFDocument } from 'pdf-lib'
148148

149149
const pdfDoc = await PDFDocument.create();
150150

151-
// This should be a Uint8Arrays.
152-
// These can be obtained in a number of different ways.
151+
// These should be a Uint8Arrays or ArrayBuffers.
152+
// This data can be obtained in a number of different ways.
153153
// If your running in a Node environment, you could use fs.readFile().
154154
// In the browser, you could make a fetch() call and use res.arrayBuffer().
155155
const firstDonorPdfBytes = ...
@@ -174,13 +174,13 @@ const pdfBytes = await pdfDoc.save()
174174

175175
### Embed PNG and JPEG Images
176176

177-
_This example produces [this PDF](assets/pdfs/examples/embed_png_and_jpeg_images.pdf)_ (when [this image](assets/images/cat_riding_unicorn.jpg) is used for the `jpgImageBytes` variable and [this image](assets/images/minions_banana_alpha.jpg) is used for the `pngImageBytes` variable).
177+
_This example produces [this PDF](assets/pdfs/examples/embed_png_and_jpeg_images.pdf)_ (when [this image](assets/images/cat_riding_unicorn.jpg) is used for the `jpgImageBytes` variable and [this image](assets/images/minions_banana_alpha.png) is used for the `pngImageBytes` variable).
178178

179179
<!-- prettier-ignore -->
180180
```js
181181
import { PDFDocument } from 'pdf-lib'
182182

183-
// These should be a Uint8Arrays.
183+
// These should be a Uint8Arrays or ArrayBuffers.
184184
// This data can be obtained in a number of different ways.
185185
// If your running in a Node environment, you could use fs.readFile().
186186
// In the browser, you could make a fetch() call and use res.arrayBuffer().
@@ -227,7 +227,7 @@ _This example produces [this PDF](assets/pdfs/examples/embed_font_and_measure_te
227227
import { PDFDocument, rgb } from 'pdf-lib'
228228
import fontkit from '@pdf-lib/fontkit'
229229

230-
// This should be a Uint8Array.
230+
// This should be a Uint8Array or ArrayBuffer.
231231
// This data can be obtained in a number of different ways.
232232
// If your running in a Node environment, you could use fs.readFile().
233233
// In the browser, you could make a fetch() call and use res.arrayBuffer().

0 commit comments

Comments
 (0)