PDF - Stamp

Declaration

<AMPDF ACTIVITY="stamp" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" SAVETYPE="text (options)" DESTINATION="text" PDFDOCUMENTFROM="text (options)" NEWPDF="text" OVERWRITE="YES/NO" CREATEEMPTY="YES/NO" STAMP="text (options)" TEXT="text" IMAGE="text" PDF="text" PAGEINDEX="number" WIDTH="number" HEIGHT="number" FONT="text (options)" SIZE="text (options)" FORGROUNDCOLOR="text (options)" BACKGROUNDCOLOR="text (options)" X="number" Y="number" ANGLE="number" PAGE="number" ISBACKGROUND="YES/NO" />

Related Topics

Description

Adds a text-, image-, or template- based stamp to one or more pages of a PDF file at the specified coordinates.

Practical Usage

A PDF stamp is intended to be viewed just like an ink stamp on a paper document. This activity is used to place a stamp of approval, or add stamps as placement markers on a document (for example, a check mark to indicate an item has been reviewed/signed or a sign here marker).

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.
Use Text (options) Yes, if Resource is set to File Existing PDF
  • PDFDOCUMENTFROM="existing_file"
  • PDFDOCUMENTFROM="new_file"
Specifies whether to add attachments to an existing or newly-created PDF file.  This parameter becomes active and is required if the Resource parameter is set to File. The available options are:
  • Existing PDF (default) - Attachments are added to an existing PDF file.
  • New PDF - Attachments are added to a newly-created PDF file.
Source PDF Text Yes, if Use is set to Existing PDF (Empty) SOURCE="C:\PDFFileName.pdf" The path and file name of the PDF file to stamp. This parameter becomes active and is required if the Use parameter is set to Existing PDF.
Password (optional) Text No (Empty) PASSWORD="encrypted" The password required to open the existing PDF file (if required). This parameter becomes active if the Use parameter is set to Existing PDF.
On completion Text (options) Yes, if Use is set to Existing PDF Save
  • SAVETYPE="save"
  • SAVETYPE="do_not_save"
  • SAVETYPE="save_as"
Specifies how changes to the PDF file are saved upon completion of this activity. This parameter becomes active and is required if the Use parameter is set to Existing PDF. 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 existing PDF file is stored. This parameter becomes active and is required if the On completion parameter is set to Save as.
New PDF Text Yes, if Use is set to New PDF (Empty) NEWPDF="C:\PDFFileName.pdf" The path and file name where the newly-generated PDF file is stored. This parameter becomes active and is required if the Use parameter is set to New PDF.
Overwrite if PDF already exists Yes/No No No OVERWRITE="YES" If selected, a PDF file with the same filename in the destination folder is overwritten when this activity runs. If disabled (default), a PDF file with the same filename in the destination folder is not overwritten, however, a runtime error occurs as a result.
Create empty PDF file Yes/No No No CREATEEMPTY="YES" If selected, the activity creates an empty, single-page PDF file. This parameter becomes active if the Use parameter is set to New PDF.

Data

Property Type Required Default Markup Description
Type Text (options) Yes Text
  • STAMP="text"
  • STAMP="image"
  • STAMP="template_pdf"
Specifies the type of stamp to use in the PDF file. The available options are:
  • Text - The source data will be text.
  • Image - The source data will be an image.
  • Template - The source data will be a PDF template.
Text Text Yes, if Type is set to Text (Empty) TEXT="theStampText" The text to be stamped. This parameter becomes active and is required if the Type parameter is set to Text.
Image Text Yes, if Type is set to Image (Empty) IMAGE="C:\temp\image.jpg" The path and file name of the source image to use to stamp the document. Image types supported are .jpg, .gif, and .png. This parameter becomes active and is required if the Type parameter is set to Image.
Page index Number Yes, if Type is set to Template 1 PAGEINDEX="2" The page index of where to retrieve the desired PDF template. This parameter becomes active and is required if the Type parameter is set to Template.
Template PDF Text Yes, if Type is set to Template (Empty) PDF="c:\temp\file.pdf" The path and file name of the source PDF file that contains the template to stamp. This parameter becomes active and is required if the Type parameter is set to Template.

Advanced

Property Type Required Default Markup Description
Font Text (options) Yes, if Type is set to Text Segoe UI FONT="Times New Roman" The font typeface to use in the stamp. The default value is Segoe UI. This parameter becomes active and is required if the Type parameter is set to Text.
Font size Number Yes, if Type is set to Text 11 SIZE="10" The size of the font to use in the stamp. The default value is 11. This parameter becomes active and is required if the Type parameter is set to Text.
Text color Text (options) Yes, if Type is set to Text Black FORGROUNDCOLOR="Blue" The color of the text to use in the stamp. The default value is Black. This parameter becomes active and is required if the Type parameter is set to Text.
Background color Text (options) Yes, if Type is set to Text White BACKGROUNDCOLOR="SeaShell" The background color to use in the stamp. The default value is White. This parameter becomes active and is required if the Type parameter is set to Text.
Width Number Yes, if Type is set to Image 200 WIDTH="300" The width of the image to use in the stamp, specified in points. The default value is 200. This parameter becomes active and is required if the Type parameter is set to Image.
NOTE: 1 inch = 72 points/96 pixels.
Height Number Yes, if Type is set to Image 200 HEIGHT="400" The height of the image to use in the stamp, specified in points. The default value is 200. This parameter becomes active and is required if the Type parameter is set to Image.
NOTE: 1 inch = 72 points/96 pixels.
Bottom Number Yes 10 Y="11" The Y (bottom) position of the stamp, specified in points. The default value is 10.
NOTE: 1 inch = 72 points/96 pixels.
Left Number Yes 10 X="11" The X (left) position of the stamp, specified in points. The default value is 10.
NOTE: 1 inch = 72 points/96 pixels.
Rotation angle Number Yes 45 ANGLE="40" The rotation angle of the stamp, specified in points. The default value is 45.
NOTE: 1 inch = 72 points/96 pixels.
Stamp as background Yes/No No Yes ISBACKGROUND="NO" If selected, the stamp is added in the background, behind content in the PDF file. If disabled, the stamp is added on top of content. The default value is YES.

Page

Property Type Required Default Markup Description
Page range --- Yes All --- Specifies the pages to stamp in the PDF file. The available options are:
  • All - Stamps all pages in the PDF file.
  • Page(s) - Stamps one or more specific pages in the PDF file.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Page(s) Text Yes, if Page range is set to Page(s) (Empty) PAGE="1,3,5" If selected, specifies the pages to stamp in the PDF file. For a single page, enter the page number. Use a comma (,) to specify more than one page (for example, 1,3,5). Use a dash (-) to specify a range of pages (for example, 5-10).

Description

Error Causes

On Error

Example

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 simple task adds a Template-based stamp to more than one page in a PDF file and then saves it using a different file name.

Copy
<AMPDF ACTIVITY="stamp" SOURCE="C:\temp\sourceForm.pdf" PASSWORD="AM2SsRQOTDCxvUrxCM5UcK19Q==aME" SAVETYPE="save_as" DESTINATION="C:\temp\targetPDF.pdf" STAMP="template_pdf" PDF="C:\temp\template.pdf" PAGEINDEX="2" X="35" Y="35" ANGLE="42" PAGE="2-4" ISBACKGROUND="NO" />