The following example will show you how to add text elements to a PDF document. Take into account that by simply adding a text element, it will come with properties by default.
You can learn more about how to customize elements properties later in advanced samples.
As the whole process of creating the editpdf task (uploading your PDF, processing it and downloading it) works as explained in Processing a PDF, let’s focus on creating elements.
There are a few elements that can be added to a pdf: text, image or svg. Use the class associated to create the corresponding element, modify its properties if it is required and add it to the task. After doing this, you have a PDF file with a new element on it and ready to process.
Now it’s time to see more advanced examples to set element properties or add image elements to the PDF.
First, take a look at the properties applicable to any element:
These properties will customize an edition element, no matter the type. However, the API also provides properties related specifically to text. See the following: