ImageEn, unit iexUserInteractions

TIEPdfViewer.AttachmentCount

TIEPdfViewer.AttachmentCount

Declaration

property AttachmentCount: Integer;

Description

Returns the number of files embedded in the document.

Note:
To add an attachment to a PDF file, use AddAttachment
In Delphi versions before 2007, some attachment functionality is not supported

Demo

Demo  Demos\PDF\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;

// Delete all attachments from document
While ImageEnView1.PdfViewer.AttachmentCount > 0 do
  ImageEnView1.PdfViewer.DeleteAttachment( 0 );

See Also

Attachment
SaveAttachment
AddAttachment