PDF - Add annotation

Declaration

<AMPDF ACTIVITY="add_annotation" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" SAVETYPE="text (options)" DESTINATION="text" PDFDOCUMENTFROM="text (options)" NEWPDF="text" OVERWRITE="YES/NO" CREATEEMPTY="YES/NO" ANNOTATIONTYPE="text (options)" CONTENT="text" TITLE="text" PAGE="number" X="number" Y="number" WIDTH="number" HEIGHT="number" FONT="text (options)" SIZE="number" OPACITY="number" FOREGROUNDCOLOR="text (options)" />

Related Topics  

Description

Adds a sticky note, text box, or watermark annotation to an existing PDF file.

Practical Usage

Used to add a comment, note, or watermark to an existing PDF file.

Parameters

Resource

Property Type Required Default Markup Description
Resource --- --- --- --- Specifies the source of the PDF file. The available options are:
  • File (default) - The source derives from a PDF file located on the system. This option is normally selected if only a single activity is required to complete the operation.
  • Session - The source PDF is obtained from a pre-configured session created in an earlier step with the use of the PDF - Create session activity. This option is normally selected if a combination of related activities is required to complete an operation. Consolidating several activities to a single session can eliminate redundancy. Moreover, a single task supports multi-session executions which can improve efficiency and speed up production.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Session Text Yes, if Resource is set to Session PDFSession1 SESSION="mySession" The existing session to associate with this activity. This parameter becomes active and is required if the Resource parameter is set to Session.
Source PDF Text Yes, if Resource is set to File (Empty) SOURCE="C:\PDFFileName.pdf" The PDF path and file name of where to add the annotation. This parameter becomes active and is required if the Resource parameter is set to File.
Password (optional) Text No (Empty) PASSWORD="encrypted" The password required to open the PDF file (if required).
On completion Text (options) Yes, if Resource is set to File Save
  • SAVETYPE="save"
  • SAVETYPE="do_not_save"
  • SAVETYPE="save_as"
Specifies how changes to the PDF file are saved upon completion of this activity. The available options are:
  • Save (default) - Changes are saved under the PDF file's original file name.
  • Do not save changes - Any changes made to the existing PDF file are not saved.
  • Save As - Changes are saved to a new path and file name.
Destination PDF Text Yes, if On completion is set to Save As (Empty) DESTINATION="C:\PDFFileName.pdf" The path and file name where the modified PDF file is stored. This parameter becomes active and is required if the On completion parameter is set to Save as.

Annotation

Property Type Required Default Markup Description
Type Text (options) Yes Text
  • ANNOTATIONTYPE="Text"
  • ANNOTATIONTYPE="FreeText"
  • ANNOTATIONTYPE="Watermark"

 

Specifies the type of annotation to add to the PDF file. The available options are:
  • Text (default) - Adds a sticky note that can be opened and closed.
  • Free Text -Adds text within a box that is applied directly on the page and is always visible.
  • Watermark - Adds a watermark that appears in front of any content.
Title Text Yes, if Type is set to Text or Free Text (Empty) TITLE="Note" The title of the Text or Free Text annotation. This parameter becomes active and is required if Type is set to Text or Free Text.
Content Text Yes (Empty CONTENT="See latest version for more information." The text-based content of the annotation. Single and multiple lines of text are supported.

Advanced

Property Type Required Default Markup Description
Font Text (options) Yes, if Type is set to Free Text or Watermark Segoe UI FONT="Times New Roman" The font typeface to use in the annotation. The available list box allows selection from a predefined list of fonts. The default value is Segoe UI. This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
Font size Number Yes, if Type is set to Free Text or Watermark 11 SIZE="10" The size of the font to use in the annotation. The default value is 11. This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
Text color Text (options) Yes, if Type is set to Free Text or Watermark Black FORGROUNDCOLOR="Blue" The color of the text to use in the annotation. The default value is Black. This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
Opacity Number Yes, if Type is set to Free Text or Watermark 0.9 OPACITY="0.5" The opacity of the text to use in the annotation. The default value is 0.9, but can be adjusted from 0-1. This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
Bottom Text Yes 100 Y="55" The Y (bottom) position of the annotation, specified in points. The default value is 100.
NOTE: 1 inch = 72 points/96 pixels.
Left Text Yes 100 X="12" The X (left) position of the annotation, specified in points. The default value is 100.
NOTE: 1 inch = 72 points/96 pixels.
Width Number Yes, if Type is set to Free Text or Watermark 200 WIDTH="300" The width of the annotation, specified in points. The default value is 200.This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
NOTE: 1 inch = 72 points/96 pixels.
Height Number Yes, if Type is set to Free Text or Watermark 200 HEIGHT="400" The height of the annotation, specified in points. The default value is 200.This parameter becomes active and is required if the Type parameter is set to Free Text or Watermark.
NOTE: 1 inch = 72 points/96 pixels.

Page

Property Type Required Default Markup Description
Page number Number Yes 1 PAGE="2" Specifies the PDF page number of where to add the annotation.

Description

Error Causes

On Error

Examples

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task adds a Free Text annotation to a PDF file and then saves it using a different file name.

Copy
<AMPDF ACTIVITY="add_annotation" SOURCE="C:\Temp\SamplePDF.pdf" SAVETYPE="save_as" DESTINATION="C:\Temp\Output.pdf" ANNOTATIONTYPE="FreeText" CONTENT="This is a comment." TITLE="Note" OPACITY=".9" FOREGROUNDCOLOR="Crimson" />