EmbeddedFiles

EmbeddedFiles

Overview

EmbeddedFiles is a type in Aspose.PDF FOSS for Go.

EmbeddedFiles is the document’s collection of attached (embedded) files — the /Catalog/Names/EmbeddedFiles name tree (ISO 32000-1 §7.11.4).

This type provides 9 methods for working with EmbeddedFiles objects in Go programs. Available methods include: Add, AddFromStream, All, Clear, Count, Get, Has, Names, Remove. All public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

Methods

SignatureDescription
Names()[]stringNames returns the attachment names (name-tree keys), lexicographically sorted.
Count()intCount returns the number of embedded files.
Has(name: string)boolHas reports whether an attachment with the given name exists.
Get(name: string)*EmbeddedFileGet returns the named attachment, or nil if absent.
All()[]*EmbeddedFileAll returns every attachment, in sorted-name order.
Add(path: string)(*EmbeddedFile, error)Add embeds the file at path under its base name, detecting the MIME type from its extension, and returns the new attachment.
AddFromStream(name: string, r: io.Reader)(*EmbeddedFile, error)AddFromStream embeds the bytes read from r under the given name (the MIME type is detected from the name’s extension), and returns the new attachment.
Remove(name: string)boolRemove deletes the named attachment, returning whether it existed.
Clear()Clear removes every attachment.

See Also

 English