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.GeneratePreview
Adds preview to an existing PDF container.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| PDFKit | 7.5 | Yes | No | No | Yes, macOS only | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| Container | A media value containing PDF data. |
Result
Returns OK or error.
Description
Adds preview to an existing PDF container.For Windows or Linux, please use DynaPDF.GeneratePreview.
Examples
Generate preview:
Set Field [ Merge PDFs::FinalPDF ; MBS("PDFKit.GeneratePreview"; Merge PDFs::InputPDF) ]
Add a preview to PDF container if needed:
# get a PDF somewhere
Set Variable [ $PDF ; Value: MBS( "Files.ReadFile"; "C:\Users\Christian\Desktop\test.pdf"; "auto") ]
# Does have PDF and no image?
Set Variable [ $types ; Value: MBS( "Container.GetTypes"; $PDF) ]
# PDF included?
If [ Position ( $types ; "PDF " ; 1 ; 1 ) > 0 ]
# Image preview missing?
If [ Position ( $types ; "JPEG" ; 1 ; 1 ) < 1 and Position ( $types ; "PNGf" ; 1 ; 1 ) < 1 ]
# Use DynaPDF if initialized, we can use it
If [ MBS( "DynaPDF.IsInitialized" ) ]
Set Variable [ $PDF2 ; Value: MBS( "DynaPDF.GeneratePreview"; $PDF) ]
If [ MBS("IsError") = 0 ]
# Success, so use the new PDF
Set Variable [ $PDF ; Value: $PDF2 ]
End If
Else If [ MBS( "IsMacOSX" ) = 1 ]
# On Mac use PDFKit
Set Variable [ $PDF2 ; Value: MBS( "PDFKit.GeneratePreview"; $PDF) ]
If [ MBS("IsError") = 0 ]
# Success, so use the new PDF
Set Variable [ $PDF ; Value: $PDF2 ]
End If
End If
End If
End If
# Store PDF with preview
Set Field [ test::Image ; $PDF ]
See also
- Container.GetType
- Container.GetTypes
- DynaPDF.GeneratePreview
- DynaPDF.IsInitialized
- Files.ReadFile
- IsError
Blog Entries
Release notes
- Version 7.5
- Added PDFKit.GeneratePreview.
Created 17th October 2017, last changed 11st February 2018
PDFKit.CombineRef - PDFKit.GetCurrentFilter
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins