Attachment

Overview

Attachment is a class in Aspose.PDF FOSS for TypeScript.

A live handle over one embedded file’s /Filespec.

This class declares 5 methods for Attachment objects in TypeScript programs. Available methods include: GetBytes, GetField, RemoveField, SetField, constructor. All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package. Properties: CreationDate, Description, MimeType, ModDate, Name, Size.

Properties

NameTypeAccessDescription
NamestringReadGets the name.
Descriptionstring | undefinedReadGets the description.
MimeTypestring | undefinedReadGets the mime type.
Sizenumber | undefinedReadGets the size.
CreationDateDate | undefinedReadGets the creation date.
ModDateDate | undefinedReadGets the mod date.

Methods

SignatureDescription
constructor(doc: Document, Dict: PdfDict, fallbackName: string)Calls constructor(doc, Dict, fallbackName) on this Attachment instance.
GetBytes()Uint8ArrayDecode the embedded bytes, inflating FlateDecode if present.
GetField(field: string)string | number | Date | undefinedRead a custom /CI field.
SetField(field: string, value: string | number | Date)Upsert a custom /CI field value.
RemoveField(field: string)Remove a custom /CI field value, dropping /CI when only /Type remains.