Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

attach元素
Question mark
0.14.0起可用Go to source

A file that will be attached to the output PDF.

This can be used to distribute additional files associated with the PDF within it. PDF readers will display the files in a file listing.

Some international standards use this mechanism to attach machine-readable data (e.g., ZUGFeRD/Factur-X for invoices) that mirrors the visual content of the PDF.

Example

#pdf.attach(
  "experiment.csv",
  relationship: "supplement",
  mime-type: "text/csv",
  description: "Raw Oxygen readings from the Arctic experiment",
)

Notes

参数
Question mark

path
str or path
必需参数
Question mark
位置参数
Question mark

The path of the file to be attached.

Must always be specified, but is only read from if no data is provided in the following argument.

data
bytes
必需参数
Question mark
位置参数
Question mark

Raw file data, optionally.

If omitted, the data is read from the specified path.

relationship
none or str
可用set规则
Question mark
默认值:none

The relationship of the attached file to the document.

Ignored if export doesn’t target PDF/A-3.

VariantDetails
"source"The PDF document was created from the source file.
"data"The file was used to derive a visual presentation in the PDF.
"alternative"An alternative representation of the document.
"supplement"Additional resources for the document.

mime-type
none or str
可用set规则
Question mark
默认值:none

The MIME type of the attached file.

description
none or str
可用set规则
Question mark
默认值:none

A description for the attached file.