EmbeddedFile

EmbeddedFile

概述

EmbeddedFile 是 Aspose.PDF 为 Go 提供的 FOSS 中的一种类型。

EmbeddedFile 是一个附件:一个带嵌入流的 /Filespec 字典。

此类型提供 8 种方法,用于在 Go 程序中操作 EmbeddedFile 对象。可用的方法包括:Data、Description、MIMEType、Name、Save、SetDescription、Size、WriteTo。在安装 Aspose.PDF 为 Go 提供的 FOSS 包后,所有公共成员对任何 Go 应用程序均可访问。

方法

签名描述
Name() → stringName 返回附件的名称(其 name-tree 键)。
Description() → stringDescription 返回 /Filespec /Desc 文本,如果没有则返回 “"。
SetDescription(s: string)SetDescription 设置(或在 "” 时删除) /Filespec /Desc 文本。
MIMEType() → stringMIMEType 返回嵌入流的 /Subtype 作为 MIME 类型(例如.
Size() → intSize 返回附件的字节大小(如果没有内容则为 0)。
Data() → ([]byte, error)Data 返回附件的已解码内容字节。
WriteTo(w: io.Writer) → (int64, error)WriteTo 将附件的内容写入 w(实现 io.WriterTo)。
Save(path: string) → errorSave 将附件的内容写入文件。

另请参阅

 中文