←Select platform

ReadAttachments(Stream) Method

Summary

Reads the properties of the attachments embedded in the specified stream.

Syntax
C#
VB
C++
public CodecsAttachments ReadAttachments( 
   Stream stream 
) 
Public Function ReadAttachments( 
   ByVal stream As Stream 
) As CodecsAttachments 
public:  
   CodecsAttachments^ ReadAttachments( 
      Stream^ stream 
   ) 

Parameters

stream

Stream containing the owner file that may contain embedded attachments.

Return Value

Collection of CodecsAttachment objects containing the properties of any attachments found. If the owner file neither contains nor supports attachments, then an empty collection is returned.

Remarks

This method returns an empty collection in the following situations:

  • The owner file does not contain any attachments
  • The owner file does not support attachments
  • The owner file supports attachments, but reading support is not available in this version of the LEADTOOLS toolkit

The number of attachment items returned by this method is the same as the CodecsImageInfo.AttachmentCount value of the object returned by GetInformation.

Each CodecsAttachment contains the properties of its attachment such as its FileName, FileLength, and other extra information provided by the owner document.

Use ExtractAttachment to extract the binary content of an attachment file onto an output disk file or stream for further processing. Examples of further processing include calling GetInformation or Load.

LEADTOOLS supports reading the attachments embedded in the following file formats:

PDF

PDF files support embedded attachments of any number and file format (PDF, TIFF, XML, etc). PDF files can also be created as a portfolio which contains multiple files assembled into an integrated unit. In these types of documents, the file contains a single generic help page with text such as "For the best experience, open this PDF portfolio in a compatible viewer" and any number of attachments and a schema to control how to view the document. The value of CodecsImageInfo.IsPortfolio will be true if the file is a PDF portfolio; it is up to the application to determine how to further handle the file.

Example

For an example, refer to ReadAttachments(string).

Requirements
Target Platforms
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.