« MBS Xojo Plugins, ver… | Home | FileMaker Konferenz 2… »

DynaPDF graphics flags

You can set optional flags affecting the graphics state, coordinate handling, as well as color and image conversion rules in DynaPDF.

MBS( "DynaPDF.SetGStateFlags"; PDF; Value { ; Reset } )

If the parameter Reset is true, the new flags replace current flags. If set to false, the flags are combined with the current flags.
Let's check the possible flags to use:

RestorePageCoords

If set, the current base coordinate system like bottom or top down is saved and restored with the graphics state.
This affects calls to DynaPDF.SaveGraphicState and DynaPDF.RestoreGraphicState calls. If not set, this will restore to Bottom-Up coordinates. The DynaPDF.SetPageCoords function can be used at anytime to change the coordinate systems to Bottom-Up or Top-Down.

NativeBlackWhite

If set, RGB black or white is not converted to DeviceGray. This flag affects text and vector graphics but no images.
Usually you want this to be off, so you get black and white as gray scale color values.

This may help when color conversion happens like if this PDF gets printed on a CMYK printer and the gray value can go into the K value directly. When printing you don't want a gray tone to be mixed by using Cyan, Magenta and Yellow.

We recommend to keep this off.

UseImageColorSpace

If set, the active color space is ignored when inserting an image. The color space is taken from the image file instead.

You may want to set this flag if you need to have images be added with their ICC Profile. If the flag is not set, DynaPDF converts the image to the current colorspace (e.g. RGB or CMYK) when using DynaPDF.InsertImage or DynaPDF.InsertImageFile. You may prefer to pass through images with DynaPDF.SetSaveNewImageFormat and RealPassThrough flag below.

Please note you may want to use DynaPDF.InitColorManagement to initialize the color management before.

IgnoreICCProfiles

If set, embedded ICC profiles in image files are ignored when inserting an image with DynaPDF.InsertImage or DynaPDF.InsertImageFile. The image is inserted in the base color space instead. This flag is not meaningful if the flag UseImageColorSpace is absent.

You may not want this as it would replace the CMYK color space in an image with the current CMYK profile.

We recommend to keep this off.

RealPassThrough

If set, JPEG images are inserted as is. JPEG images are normally rebuild, also in pass-through mode, to avoid issues with certain malformed JPEG images which cannot be displayed in Adobes Acrobat or Reader. If you know that your JPEG images work then set this flag to avoid unnecessary processing time.

We recommend to keep this off.

NoBitmapAlpha

If set, the alpha channel in bitmaps files will be ignored. This is sometimes useful since many 32 bit bitmaps contain an invalid alpha channel that makes the image fully transparent.

We recommend to keep this off.

NoImageDuplCheck

If set, no duplicate check for images will be performed. This can significantly improve processing speed especially for memory based images.
Usually the processing is quickly with a simple MD5 hash, so not a lot of work compared to compressing images.

We recommend to keep this off.

ComplexText

This flag enables complex text layout.

Support for complex text layout is required for languages like Arabic, Thai, Devanagari, Lao, and many others. At time of publication DynaPDF supports complex text layout on Windows only.
The implementation in DynaPDF based on Microsofts Uniscribe. This is the Unicode library that is used behind the scenes in almost all Windows controls and Unicode aware applications.
Complex text layout depends on the availability of OpenType fonts. Most fonts which are delivered with Windows are OpenType fonts.

We recommend to turn this on for Windows when using the above languages.

NoObjCompression

If set, object compression will be disabled. Object compression is enabled by default if the PDF version is set to PDF 1.5 or higher.

See also DynaPDF.SetCompressionLevel, where you can pass 0 to disable compression.

We recommend to keep this off unless you need to read the uncompressed content of the PDF.

DisableJavascript

If set, Javascript actions associated with the OnFormat event of text fields are not executed to format the field value.

We recommend to keep this off, so all the JavaScript formatting works.

DisableBidiCtrls

Meaningful only if ComplexText is set too. If set, bidi control characters are ignored.
This flag can be useful if the result of web browsers should be emulated since web browsers do not support bidi control characters. This flag is also used internally to create the appearance stream of form fields since form fields do not support bidi control characters.

DoNotComprMetadata

If set, metadata streams assiciated with fonts, templates, or images, for example, will not be compressed. Metadata streams of PDF/X files are always left uncompressed.

See also DynaPDF.SetCompressionLevel, where you can pass 0 to disable compression.

We recommend to keep this off unless you need to read the uncompressed content of the PDF.

UpdatePDFVTModDate

If set, the key GTS_PDFVTModDate will be set to the file's modification date. The key exists in PDF/VT files only.


There are three flags, which you don't use with our plugin: Compatible, RealTopDownCoords, AnsiStringIsUTF8.
02 08 23 - 09:29