Class AttachmentManager
- java.lang.Object
- 
- com.ironsoftware.ironpdf.attachment.AttachmentManager
 
- 
 public class AttachmentManager extends Object Class used to edit attachment to aPdfDocument.
- 
- 
Constructor SummaryConstructors Constructor Description AttachmentManager(InternalPdfDocument internalPdfDocument)Please get AttachmentManager byPdfDocument.getAttachment()instead.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttachment(String name, byte[] attachmentData)Add a new attachment.byte[]getAttachmentData(int index)Gets attachment data from attachment indexbyte[]getAttachmentData(String name)Gets attachment data from attachment nameList<String>getAttachments()A Collection of file attachment names (keys) contained within this PdfDocument.voidremoveAttachment(int index)Remove an attachment by attachment indexvoidremoveAttachment(String name)Remove an attachment by attachment name
 
- 
- 
- 
Constructor Detail- 
AttachmentManagerpublic AttachmentManager(InternalPdfDocument internalPdfDocument) Please get AttachmentManager byPdfDocument.getAttachment()instead.- Parameters:
- internalPdfDocument- the internal pdf document
 
 
- 
 - 
Method Detail- 
getAttachmentspublic final List<String> getAttachments() A Collection of file attachment names (keys) contained within this PdfDocument.- Returns:
- A list of attachments names
 
 - 
addAttachmentpublic final void addAttachment(String name, byte[] attachmentData) Add a new attachment.- Parameters:
- name- attachment name
- attachmentData- attachment data
 
 - 
removeAttachmentpublic final void removeAttachment(String name) Remove an attachment by attachment name- Parameters:
- name- attachment name
 
 - 
removeAttachmentpublic final void removeAttachment(int index) Remove an attachment by attachment index- Parameters:
- index- attachment index
 
 - 
getAttachmentDatapublic final byte[] getAttachmentData(String name) Gets attachment data from attachment name- Parameters:
- name- Attachment name
- Returns:
- a attachment data
 
 - 
getAttachmentDatapublic final byte[] getAttachmentData(int index) Gets attachment data from attachment index- Parameters:
- index- Attachment index
- Returns:
- a attachment data
 
 
- 
 
-