SaveAllAttachments

Document properties, Extraction

Description

Exports every attachment returned by EnumAttachments to a directory.

Existing disk files are overwritten, and duplicate names within the same export receive numeric suffixes, preserving the original method contract; attachments that collide with existing directories receive numeric suffixes while the directories are preserved.

Use SaveAllAttachmentsEx when the caller must choose overwrite, skip or rename behaviour, or customise each output name.

Syntax

Delphi

Function TPDFlib.SaveAllAttachments(Const OutputDir: WideString): Integer;

Parameters

OutputDirDestination directory, created recursively when missing; a trailing separator is optional

Return values

0No document is selected, the directory cannot be created, no attachments exist or no file could be written
> 0Number of attachment files written