ImageEn, unit iexUserInteractions |
|
TIEPdfViewerInteraction.Attachment
Declaration
property Attachment[Index: Integer]: TIEPdfAttachment;
Description
Returns details on a file embedded in the document.
Demo
| Demos\Other\PdfViewer\PdfViewer.dpr |
Examples
// Add names of all attached files to a TListView
lvwAttachments.Items.BeginUpdate;
lvwAttachments.Clear;
try
cnt := ImageEnView1.PdfViewer.AttachmentCount;
for i := 0 to cnt - 1 do
begin
att := ImageEnView1.PdfViewer.Attachment[i];
listItem := lvwAttachments.Items.Add();
listItem.Caption := Format('%s (%d Bytes)', [ att.Name, att.SizeBytes ]);
end;
finally
lvwAttachments.Items.EndUpdate;
end;
// Prompt the user to save the first attachment to file
idx := 0;
att := ImageEnView1.PdfViewer.Attachment[idx];
SaveDialog1.FileName := att.Name;
if SaveDialog1.Execute() then
ImageEnView1.PdfViewer.SaveAttachment( idx, SaveDialog1.FileName );
See Also
-
AttachmentCount-
SaveAttachment