Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.CreateExtGState
Creates an extended graphics state object from the structure GS.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 14.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
JSON | The JSON describing the entries you like to initiaize. |
Result
Returns OK or error.
Description
Creates an extended graphics state object from the structure GS.An extended graphics state can be used to adjust certain properties which are not part of the normal graphics state. Such properties can only be modified with a special PDF object called the Extended Graphics State.
The most important properties of an extended graphics state are the transparency settings (PDF 1.4) and the overprint control (PDF 1.2 or 1.3, see below).
The function creates an internal graphics state object and returns the handle of it. The extended graphics state can now be applied with DynaPDF.SetExtGState.
Note that there is only way to restore the values of an extended graphics state, you must set a second extended graphics state that restores the values changed before. See DynaPDF.SaveGraphicsState and DynaPDF.RestoreGraphicsState.
The following values are allowed in the JSON:
Key | value | PDF Version | default |
AlphaIsShape | 0 or 1 | PDF 1.4 | unknown, does nothing |
AutoStrokeAdjust | 0 or 1 | PDF 1.4 | 0 |
BlendMode | Number of BlendMode | PDF 1.4 | Normal |
FlatnessTol | 0.0..1.0 | all | none |
FillAlpha | 0.0..1.0 | PDF 1.4 | 1.0 |
OverPrintFill | 0 or 1 | PDF 1.2 if used alone, PDF 1.3 otherwise | 0 |
OverPrintStroke | 0 or 1 | PDF 1.3 | 0 |
OverPrintMode | 0 or 1 | PDF 1.3 | 0 |
RenderingIntent | see RenderingIntents | PDF 1.1 | RelativeColorimetric |
SmoothnessTol | 0.0..1.0 | PDF 1.3 | none |
StrokeAlpha | 0.0..1.0 | PDF 1.4 | 1.0 |
TextKnockout | 0 or 1 | PDF 1.4 | 1 |
SoftMaskNone | true or false | all | false |
A value that should not be modified must not be changed.
If an image should be inserted with transparency it is usually best to disable image transparency which based on color key masking (see DynaPDF.SetUseTransparency). Images use the fill alpha constant as alpha channel. Blend modes can be applied too. However, the result of blend modes depends strongly on the used color space. If the image is not defined in an ICC based color space then the result depends on the color management settings.
Whenever transparency related settings are changed (FillAlpha, StrokeAlpha, or BlendMode) it is strongly recommended to attach an ICC profile of the output color space for which the file was created with DynaPDF.AddOutputIntent.
If no output intent was specified, Adobe's Acrobat or Reader simulate a default CMYK color space as output color space if transparency is used on a page, also if the page uses RGB colors only! This differs from normal RGB files which use no transparency and causes often unwanted color changes.
Note that this rule applies also to images which contain an alpha channel!
If the PDF file uses RGB colors only, then attach an sRGB profile to the file. Such a profile is very small but it makes a huge difference whether the profile is present or not.
If the function succeeds the return value is the extended graphics state handle, a value greater or equal zero. If the function fails the return value is an error.
Rendering intents:
AbsoluteColorimetric | 0 |
Perceptual | 1, |
RelativeColorimetric | 2 |
Saturation | 3 |
Blend modes:
NotSet | 0 |
Normal | 1 |
Color | 2 |
ColorBurn | 3 |
ColorDodge | 4 |
Darken | 5 |
Difference | 6 |
Exclusion | 7 |
HardLight | 8 |
Hue | 9 |
Lighten | 10 |
Luminosity | 11 |
Multiply | 12 |
Overlay | 13 |
Saturation | 14 |
Screen | 15 |
SoftLight | 16 |
See also CreateExtGState function in DynaPDF manual.
Examples
Set transparency:
Set Variable [ $json ; Value: JSONSetElement ( JSONSetElement ( "{}" ; "FillAlpha" ; .5 ; JSONNumber ) ; "StrokeAlpha" ; .5 ; JSONNumber ) ]
Set Variable [ $gs ; Value: MBS("DynaPDF.CreateExtGState"; $pdf; $json) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetExtGState"; $pdf; $gs) ]
Enable overprint fill:
Set Variable [ $json ; Value: JSONSetElement ( JSONSetElement ( "{}" ; "OverPrintFill" ; 1; JSONNumber ) ; "OverPrintMode" ; 1 ; JSONNumber ) ]
Set Variable [ $gs ; Value: MBS("DynaPDF.CreateExtGState"; $pdf; $json) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetExtGState"; $pdf; $gs) ]
See also
- DynaPDF.AddOutputIntent
- DynaPDF.CreateDeviceNColorSpace
- DynaPDF.Initialize
- DynaPDF.New
- DynaPDF.Save
- DynaPDF.SetAlpha
- DynaPDF.SetExtGState
- DynaPDF.SetUseTransparency
Release notes
- Version 14.4
- Added DynaPDF.CreateExtGState and DynaPDF.SetExtGState functions.
Blog Entries
- New in MBS FileMaker Plugin 14.4
- Neues MBS Plugin 14.4 für Claris FileMaker
- MBS Plugin 14.4 for Claris FileMaker
- MBS FileMaker Plugin, version 14.4pr6
This function checks for a license.
Created 4th September 2024, last changed 4th September 2024
DynaPDF.CreateDeviceNColorSpace - DynaPDF.CreateGeospatialMeasure