PDF
- Delete attachment(s)
Declaration
<AMPDF ACTIVITY="delete_attachment" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" SAVETYPE="text (options)" DESTINATION="text" FILENAME="text" />
Description
Deletes one or more file attachments and/or file annotations from a PDF file. To specify more than one attachment/annotation to delete, use a comma as a delimiter. An Attachment Browser is also provided allowing you to easily browse the files currently attached to the PDF file.
Practical usage
Used to permanently delete one or more file attachments and/or file annotations from a PDF file.
Parameters
Resource
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Resource | --- | --- | --- | --- | Specifies the source of the PDF file. The available options are:
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 delete file attachments and/or file annotations. 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 |
|
Specifies how changes to the PDF file are saved upon completion of this activity. The available
options are:
|
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. |
Attachment
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Delete | --- | Yes | All | --- | Determines the file attachments and/or file annotations
to delete. The
available options are:
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Specific file | Text | Yes if Delete is set to Specific file | (Empty) |
FILENAME="file.txt" |
The file names of the attachments and/or annoatations to delete. Click the folder icon to open the Attachment Browser which allows you browse and select attached files or manually enter the desired file names in the provided text-box. Use a comma to delimit each entry (for example, file1.txt,file2.txt,fileA.png) . |
Examples
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Example 1
This sample task deletes all files attached to a PDF file.
<AMPDF ACTIVITY="delete_attachment" SOURCE="C:\temp\sample.pdf" />
Example 2
This sample task deletes specific files from a PDF file.
<AMPDF ACTIVITY="delete_attachment" SOURCE="C:\temp\sample.pdf" FILENAME="Sales_Department.txt,Tech_Department.txt,xml_sample_data.txt" />