This short tutorial guides you on how to add checkbox in PDF with Node.js REST API. You will learn to automatically add check boxes to pdf with Node.js RESTful Service using Node.js-based Cloud SDK without installing any third-party tool. You will learn to set the position of the checkbox on the desired page in the loaded PDF file.
Prerequisite
- Create an account API credentials to add a check box in a PDF
- Download Aspose.PDF Cloud SDK for Node.js to create a checkbox in PDF
- Setup Node.js project with the above SDK for adding a tick mark field
Steps to Add Checkbox to PDF with Node.js-Based API
- Configure the PdfApi using your credentials to add a tick mark in a PDF
- Create a checkbox field by setting the name, type, default value, and rectangular boundary
- Upload the source PDF file where the check mark is to be added into the Cloud with a name
- Call the PostCreateField method to add a check box on the desired page in the uploaded PDF file
- Download the output PDF file with a ticked checkbox in it
These steps describe how to put tick mark in PDF with Node.js Low Code API. Create a checkbox field by setting its type, default value, and a rectangular area describing the position and dimensions of the checkbox. Upload the source PDF file and call the PostCreateField() method to add the tick mark on the defined page in the PDF.
Code to Insert Check Mark in PDF with Node.js REST API
This code demonstrates how to add tick marks in PDF with Node.js REST API. The FieldType.Boolean creates the checkbox and the rectangular area describes the start and end position of the checkbox in terms of points from the bottom left corner of the page. The PostCreateField() method requires the name of the PDF file assigned while uploading the file, the page number, and the field you want to add.
This article has guided us on how to insert check mark in PDF with Node.js REST Interface. If you want to add a page to a PDF file, refer to the article on Add new page in PDF with Node.js REST API.