←Select platform

ExtractEmbeddedFile(string,string,int,string) Method

Summary

Extracts an embedded file (attachment) from a PDF document file and saves it to disk.

Syntax
C#
Java
public static void ExtractEmbeddedFile( 
   string fileName, 
   string password, 
   int fileNumber, 
   string outputFileName 
) 

public static void extractEmbeddedFile( 
   java.lang.String string,  
   java.lang.String string2,  
   int intValue,  
   java.lang.String string3 
); 

Parameters

fileName

Name of the owner PDF document file.

password

The password to use when loading this PDF file (if the file is encrypted); otherwise, use null.

fileNumber

Embedded file number. This value must be between 1 and the total number of embedded files in the owner PDF document.

outputFileName

Name of the file that will contain the embedded file binary data.

Remarks

ExtractEmbeddedFile is used to extract one embedded file (attachment) from a PDF document.

The attachment to extract is identified using the fileNumber variable which must be a value between 1 (for the embedded file) and the total number of attachments in the file (for the last embedded file).

Use GetEmbeddedFileCount to quickly get the number of embedded files in a PDF document.

To find more information regarding the embedded files before extracting them (such as the file name and size), the application can perform the following:

Example

For an example refer to GetEmbeddedFileCount or PDFDocument.EmbeddedFiles.

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

Leadtools.Pdf Assembly