EmbeddedFile
Overview
EmbeddedFile is a type in Aspose.PDF FOSS for Go.
EmbeddedFile is one attachment: a /Filespec dictionary with an embedded stream.
This type provides 8 methods for working with EmbeddedFile objects in Go programs.
Available methods include: Data, Description, MIMEType, Name, Save, SetDescription, Size, WriteTo.
All public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.
Methods
| Signature | Description |
|---|---|
Name() → string | Name returns the attachment’s name (its name-tree key). |
Description() → string | Description returns the /Filespec /Desc text, or "" if none. |
SetDescription(s: string) | SetDescription sets (or, for “”, removes) the /Filespec /Desc text. |
MIMEType() → string | MIMEType returns the embedded stream’s /Subtype as a MIME type (e.g. |
Size() → int | Size returns the attachment’s size in bytes (0 if no content). |
Data() → ([]byte, error) | Data returns the attachment’s decoded content bytes. |
WriteTo(w: io.Writer) → (int64, error) | WriteTo writes the attachment’s content to w (implements io.WriterTo). |
Save(path: string) → error | Save writes the attachment’s content to a file. |