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.5
7.0
7.1
7.2
7.3
7.4
7.5
8.0
8.1
8.2
Statistic
DynaPDF.Print
Prints the PDF file that is currently in memory.
Component | Version | macOS | Windows | Server | FileMaker Cloud | FileMaker iOS SDK |
DynaPDF | 5.4 | No | Yes | Yes, Windows only | No | No |
MBS( "DynaPDF.Print"; PDF { ; printerName; TempPath; DocName; PrintFlags; MarginLeft; MarginTop; MarginRight; MarginBottom; ShowDialog } )
Parameters
Parameter | Description | Example value |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
printerName | Optional Printer name. Ignored if dialog is shown. See Printer.PrinterNames functiomn for printer names. |
"myPrinter" |
TempPath | Optional The path to temporary folder. Can be empty for default folder. |
"" |
DocName | Optional The name of the print job. |
"My PDF Print" |
PrintFlags | Optional The flags for printing. Can be Default, 1bit, Color, AutoRotateAndCenter, PrintAsImage or ShrinkToPrintArea. Can be just the text name of an option or the sum of the numbers. |
"Color" |
MarginLeft | Optional The margin for the left for the page. Pass zero if you don't need an extra margin. |
|
MarginTop | Optional The margin for the top for the page. |
|
MarginRight | Optional The margin for the right for the page. |
|
MarginBottom | Optional The margin for the bottom for the page. |
|
ShowDialog | Optional Available in MBS FileMaker Plugin 6.5 or newer. Whether to show dialog. Default is 0 as we want no dialog. Pass 1 to show a dialog here. |
0 |
Result
Returns OK or error.
Description
Prints the PDF file that is currently in memory.At time of publication the function is implemented on Windows only and pages are printed as image.
The parameter DocName is optional but should be set if possible. The document name is set to "out" if no name is provided.
Output color format
It is possible to determine which color formats a printer supports as input, but it is not possible to determine whether a printer outputs black & white, gray shades, or color. The default should be set to gray or 1 bit but the user should be able to configure the color format.
Maximum output resolution
The maximum output resolution is 600 DPI to restrict the memory usage and to reduce the amount of data that must be send to the printer.
Name | Value | Description |
Default | 0 | Gray printing |
1Bit | 1 | B/W printing. Recommended for b&w printers |
Color | 2 | Color printing |
AutoRotateAndCenter | 4 | Rotate and center pages if necessary |
PrintAsImage | 8 | Default on Windows |
ShrinkToPrintArea | 16 | Useful if a page contains no margins |
PrintPageAsIs | 256 | Print page as is, ignoring paper size. |
Please use PDFKit.Print for Mac OS X. Requires DynaPDF Pro license.
If you only want to print a selection of pages, please only import those pages via DynaPDF.ImportPDFPage function. Or use DynaPDF.DeletePage to remove the pages you don't want to print.
Examples
Prints a PDF to printer
MBS( "DynaPDF.Print"; $PDF; "MyPrinter")
Import PDF and print:
#Initialize DynaPDF if needed
If [MBS("DynaPDF.IsInitialized") ≠ 1]
Perform Script [“InitDynaPDF”]
End If
#Clear current PDF document
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
#Load PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Print PDFs::InputPDF)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf; $destpage)]
#Print
Set Variable [$r; Value:MBS("DynaPDF.Print"; $pdf; Print PDFs::Printer Name; 2+4+16)]
#Cleanup
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
Print with dialog:
MBS("DynaPDF.Print";
$pdf;
""; // printer name
""; // temp path
""; // job name
"Default"; // options
""; // margins
"";
"";
"";
1) // show dialog
See also
- DynaPDF.DeletePage
- DynaPDF.ImportPDFFile
- DynaPDF.ImportPDFPage
- DynaPDF.IsInitialized
- DynaPDF.List
- DynaPDF.New
- DynaPDF.OpenPDFFromContainer
- DynaPDF.Print.GetDevMode
- DynaPDF.Print.GetDevNames
- DynaPDF.Print.SetDevMode
- DynaPDF.Print.SetDevNames
- DynaPDF.Release
- PDFKit.Print
- Printer.Print
- Printer.PrinterName
- Printer.PrinterNames
Example Databases
DynaPDF.PlaceTemplateEx - DynaPDF.Print.GetDevMode
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins