Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
DynaPDF.AttachFile
Attaches a file to the document.
Component |
Version |
macOS |
Windows |
Linux |
Server |
iOS SDK |
DynaPDF
|
6.0 |
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
MBS( "DynaPDF.AttachFile"; PDF; FilePath { ; Description; Compress } )
More
MBS(
"DynaPDF.AttachFile"; /* Attaches a file to the document. */
$PDF; /* The PDF reference returned from
DynaPDF.New. */
$FilePath; /* The native file path for the file to attach.e.g. "/Users/cs/Desktop/invoice.xml" */
$Description; /* Optional; The description for the file.e.g. "ZUGfERD-invoice.xml" */
$Compress) /* Optional; Pass 1 to compress or 0 to not compress.
You should pass 1 for text data like XML or JSON.e.g. 0 */
Less
Parameters
Parameter |
Description |
Example |
Flags |
PDF |
The PDF reference returned from DynaPDF.New. |
$pdf |
|
FilePath |
The native file path for the file to attach. |
"/Users/cs/Desktop/invoice.xml" |
|
Description |
The description for the file. |
"ZUGfERD-invoice.xml" |
Optional |
Compress |
Pass 1 to compress or 0 to not compress.
You should pass 1 for text data like XML or JSON. |
0 |
Optional |
Result
Returns handle for embedded file 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.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
See also AttachFile function in DynaPDF manual.
See also
Blog Entries
FileMaker Magazin
Created 15th December 2015, last changed 15th August 2016
DynaPDF.AssociateEmbFile
-
DynaPDF.AttachFileContainer
Feedback: Report problem or ask question.