This tutorial guides how to highlight PDF document with Node.js REST API. You will learn to develop a PDF highlighter with Node.js RESTful Service using a Node.js-based Could SDK. All the details are available to customize the highlighting by setting various parameters.
Prerequisite
- Create an account API credentials
- Download Aspose.PDF Cloud SDK for Node.js to highlight in a PDF file
- Setup Node.js project with the above SDK for working with annotations
Steps to Highlight Text in PDF Document with Node.js Low Code API
- Configure the PdfApi class object by providing the API key and application SID for highlighting the text
- Create a HighlightAnnotation object by setting the rectangular area and color
- Set the creation and modified date of the annotation
- Upload the target PDF file to a Cloud storage for highlighting the text
- Call the PostPageHighlightAnnotations() method by setting the input file, page number, and annotations
- Download the PDF file after highlighting
These steps describe how to highlight in a PDF with Node.js Low Code API. Create a PdfApi object, instantiate a HighlightAnnotation by setting the rectangular area with color, modification, and creation date, and upload the PDF file to the Cloud storage. Finally, call the PostPageHighlightAnnotations() method to highlight the area around the target contents.
Code to Highlight Text in PDF with Node.js REST Interface
This code demonstrates how to highlight PDF documents with Node.js REST Interface. You may set different attributes such as unique ID, contents, ZIndex, horizontal alignment, vertical alignment, and subject. Note that you may set the modified and creation date properly for smooth execution of the API call.
This article has taught us to highlight PDFs online with Node.js-based API. To add a checkbox in a PDF file, refer to the article on Add Checkbox in PDF with Node.js REST API.