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.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
PDFKit.AddImageFilePage
Adds a new page to PDF document with given image file.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| PDFKit | 7.2 | Yes | No | No | Yes, macOS only | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| A PDF reference number from PDFKit.Open. | $ref | ||
| FilePath | The file path to the image file to use. | "/Users/cs/Desktop/test.png" | |
| Width | The width for the new PDF page. | 600 | Optional |
| Height | The height of the new PDF page. | 800 | Optional |
Result
Returns OK or error.
Description
Adds a new page to PDF document with given image file.If you need more control about details, you may want to check DynaPDF functions.
Your changes are only done in memory, so please remember to write modified pdf back to disk, e.g. by using PDFKit.WriteToPath. Or use PDFKit.GetPDFDocument to get a PDF for storing in a container.
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.
Examples
Create PDF from image file:
Set Variable [$ref; Value:MBS("PDFKit.NewPDFDocument")]
Set Variable [$r; Value:MBS("PDFKit.AddImageFilePage"; $ref; "/Users/cs/Desktop/test.jpg"; 640; 480)]
Set Variable [$r; Value:MBS("PDFKit.WriteToPath"; $ref; "/Users/cs/Desktop/test.pdf")]
Set Variable [$result; Value:MBS("PDFKit.Release"; $ref)]
See also
- Path.FileMakerPathToNativePath
- PDFKit.AddImagePage
- PDFKit.GetPDFDocument
- PDFKit.NewPDFDocument
- PDFKit.Open
- PDFKit.Release
- PDFKit.WriteToPath
Blog Entries
Release notes
- Version 7.2
- Added PDFKit.AddImageFilePage function.
- Reduced memory usage for PDFKit.AddImageFilePage and PDFKit.AddImagePage.
Created 9th May 2017, last changed 9th May 2017
PDFKit.AddEmptyPage - PDFKit.AddImagePage
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins