EmbeddedFile

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

SignatureDescription
Name() → stringName returns the attachment’s name (its name-tree key).
Description() → stringDescription returns the /Filespec /Desc text, or "" if none.
SetDescription(s: string)SetDescription sets (or, for “”, removes) the /Filespec /Desc text.
MIMEType() → stringMIMEType returns the embedded stream’s /Subtype as a MIME type (e.g.
Size() → intSize 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) → errorSave writes the attachment’s content to a file.

See Also

 English