Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.WriteStyledText
Writes styled text on current page.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 6.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
Align | The text alignment. Can be left, center, right or justify. | "left" | |
Text | The text to write. | "Hello World" | |
LeadingFactor | Available in MBS FileMaker Plugin 11.0 or newer. If you pass a value > 0, the plugin will add \LD[] commands to styled text to set leading relative to font size. This way you define the spacing beteween lines. |
1.2 | Optional |
Result
Returns OK or error.
Description
Writes styled text on current page.Converts for you the styled text to the formatted text commands from DynaPDF.
Use DynaPDF.GetFTextHeightEx or DynaPDF.GetFTextHeight to calculate the space needed for the text if you want to create a matching text rectangle for vertical alignment.
See DynaPDF.AllowPageBreak for whether to do page breaks or not.
Please set a font first with DynaPDF.SetFont function before you write on the page. As this function uses font settings from FileMaker field, it may ignore whatever font or style you loaded before.
Internally calls DynaPDF.ConvertStyledText and DynaPDF.WriteFText.
MBS Plugin in version 11.5 with DynaPDF 4.0.62.160 adds support for double underlined text.
Warning: FileMaker does not pass style information from the layout used to give a field as default style. If you put text into a field and use the style of the field, then the plugin doesn't know this detail. You have to explicit use different font for FileMaker to pass it.
e.g. if your field is set to Verdana 12 and you have "Hello World" inside with Hello using Verdana 12 and World using Times 13, then the plugin would get passed "Hello" without font, since it matches the default for the field.
See also WriteStyledText function in DynaPDF manual.
Examples
Write some styled text on a PDF page:
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
#Add page
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12)]
#Write some text
Set Variable [$pw; Value:MBS("DynaPDF.GetPageWidth"; $pdf)]
Set Variable [$ph; Value:MBS("DynaPDF.GetPageHeight"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.SetTextRect"; $pdf; 100; $ph-100; $pw-200; $ph-200)]
Set Variable [$r; Value:MBS("DynaPDF.WriteStyledText"; $pdf; "left"; Create Text::Text)]
#End page
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
#Render one page as Picture
Set Variable [$PDFData; Value:MBS("DynaPDF.Save"; $pdf; "hello.pdf")]
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
#Put in Container
Set Field [Create Text::PDF; $PDFData]
See also
- DynaPDF.ConvertStyledText
- DynaPDF.New
- DynaPDF.Release
- DynaPDF.Save
- DynaPDF.SetPageBreakExpression
- DynaPDF.WriteFText
- DynaPDF.WriteFTextEx
- DynaPDF.WriteFTextExRotated
- DynaPDF.WriteStyledTextEx
- DynaPDF.WriteStyledTextExRotated
Release notes
- Version 14.1
- Improved font mapping for DynaPDF.WriteStyledText to better handle bold fonts.
- Version 13.2
- Added new highlight style for DynaPDF.ConvertStyledText, DynaPDF.WriteStyledText and DynaPDF.WriteStyledTextEx.
- Version 11.0
- Added leading factor parameter for DynaPDF.ConvertStyledText, DynaPDF.WriteStyledText and DynaPDF.WriteStyledTextEx.
- Version 7.4
Example Databases
- DynaPDF/Book Creation
- DynaPDF/Live Styled Text
- DynaPDF/Multi Column Output
- DynaPDF/Page Layouting
- DynaPDF/Styled Text
Blog Entries
- Page Layouting in DynaPDF
- MBS FileMaker Plugin, version 14.1pr5
- MBS FileMaker Plugin, version 13.2pr4
- Double Underlined Text in DynaPDF
- New in MBS FileMaker Plugin 11.0
- MBS FileMaker Plugin 11.0 - More than 6400 Functions In One Plugin
- Adding leading factor for converting styled text
- MBS FileMaker Plugin, version 11.0pr6
- Multi Column Output for PDFs with FileMaker
- DynaPDF WriteFText with links inside
FileMaker Magazin
This function checks for a license.
Created 13th October 2016, last changed 27th February 2024
