- PDF.co API Key
- Source File and Destination
- Setup Text Annotations
- Run the Program
- Generated PDF Output
- PDF from Scratch Demo
Step 2: PDF.co API Key
- In line 10, add your PDF.co API Key. You can get the API Key in your PDF.co dashboard.
Step 3: Source File and Destination
- In line 14, blank the source file to create a new PDF.
- In line 23, type in your desired output PDF file name.
Step 4: Setup Text Annotation
Let’s set up the text annotation.
- In lines 27 and 28, enter the text coordinates values of X and Y. Kindly click this link to find X and Y coordinates for placing text.
- In line 29, add your text value to set for this field.
- In lines 30-32, set the value of your font name, font size, and text color.
Step 5: Run the Program
- Now, let’s run the program. In your terminal, type
node your_program_name.jsto see the result.
Step 6: Generated PDF Output
- Here’s the generated PDF output from scratch.
Step 7: PDF from Scratch Demo
- Here’s a quick demo to create a PDF from scratch.