DynaPDF.DeleteEmbeddedFile
--------------------------

The function deletes an embedded file.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [5.0](newinversion50.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.DeleteEmbeddedFile"; PDF; Handle ) 

**MBS**( **"DynaPDF.DeleteEmbeddedFile";** /\* The function deletes an embedded file. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Handle**) /\* The index number for the embedded file. Range from 0 to [DynaPDF.GetEmbeddedFileCount](DynaPDFGetEmbeddedFileCount.md).e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Handle | The index number for the embedded file. Range from 0 to [DynaPDF.GetEmbeddedFileCount](DynaPDFGetEmbeddedFileCount.md). | 0 |

### Result

Returns OK or error.

### Description

The function deletes an embedded file.   
The parameter Handle must be a valid embedded file handle. Such a handle is a simple array index. [DynaPDF.GetEmbeddedFileCount](DynaPDFGetEmbeddedFileCount.md) returns the remaining number of embedded files. If all embedded files should be deleted then delete the files from top to bottom by decrementing the loop variable. This is faster because it is not required to reorganize the array in which the files are stored in this case. All handles above the deleted file index become invalid after the file was deleted.   
See also [DeleteEmbeddedFile](https://www.monkeybreadsoftware.com/DynaPDF-Manual/DeleteEmbeddedFile.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.FindEmbeddedFile](DynaPDFFindEmbeddedFile.md)
- [DynaPDF.GetEmbeddedFile](DynaPDFGetEmbeddedFile.md)
- [DynaPDF.GetEmbeddedFileCount](DynaPDFGetEmbeddedFileCount.md)
- [DynaPDF.New](DynaPDFNew.md)

This function checks for a license.

Created 6th February 2015 , last changed 6th February 2015

  
[DynaPDF.DeleteDPartNode](DynaPDFDeleteDPartNode.md) - [DynaPDF.DeleteField](DynaPDFDeleteField.md)

[HTML Version](DynaPDFDeleteEmbeddedFile.shtml)