Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

DynaPDF.AttachFileText

Attaches a file to the document.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 6.0 Yes Yes Yes Yes Yes

MBS( "DynaPDF.AttachFileText"; PDF; Text; TextEncoding; FileName { ; Description; Compress } )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Text The text content for the file. $xml
TextEncoding The text encoding for the text.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
"UTF-8"
FileName The file name to display in PDF viewer. "ZUGfERD-invoice.xml"
Description Optional
The description for the file.
"invoice.xml"
Compress Optional
Pass 1 to compress or 0 to not compress.
You should pass 1 for text data like XML or JSON.
0

Result

Returns OK or error.

Description

Attaches a file to the document.
The description is optional, the parameter can be set to "". The embedded file is compressed if the parameter Compress is set to 1. Otherwise it is left uncompressed. It is not always useful to compress embedded files especially if the file is already compressed, e.g. Zip files or already compressed image formats require no further compression. In the worst case the compressed file becomes larger as the uncompressed version. However, text files and most document formats should be compressed to reduce the file size.

Examples

Add ZUGFeRD invoice xml file:

Set Variable [$FileHandle; Value:MBS("DynaPDF.AttachFileText"; $pdf; ZUGFeRD Invoice::Invoice XML; "UTF-8"; "ZUGFeRD-invoice.xml"; "Invoice as XML")]
Set Variable [$r; Value:MBS("DynaPDF.AssociateEmbFile"; $pdf; "Catalog"; -1; "Alternative"; $FileHandle)]

See also

Example Databases


DynaPDF.AttachFileContainer   -   DynaPDF.BeginContinueText

Feedback: Report problem or ask question.




Links
MBS Xojo blog