Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  

DynaPDF.GetOCG

Returns properties for layer.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 9.1 Yes Yes Yes Yes Yes
MBS( "DynaPDF.GetOCG"; PDF; Handle; Selector )   More

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Handle The OCG handle. $OCG
Selector Which value to return. "Name"

Result

Returns value or error.

Description

Returns properties for layer.
returns the properties of the Content Usage dictionary that is associated with an OCG or layer. If the OCG is not included in an application event, then the contents in this dictionary serves as pure information.
If the OCG is included in one or more application events, then these settings control also the visibility state of the OCG. The function DynaPDF.GetOCG returns the events and categories which control the layer visibility.
If UserNamesCount is greater zero, the dictionary contains also user names. The user names can be accessed with DynaPDF.GetOCGUsageUserName.

Properties:
HandleHandle or array index
IntentBitmask, see TOCGIntent. For Intent and visibility state
NameLayer name
HaveContUsageIf 1, the layer contains a Content Usage dictionary. See DynaPDF.GetOCGContUsage
AppEventsBitmask, see TOCAppEvent. If non-zero, the layer is included in one or more app events which control the layer state.
CategoriesBitmask, see TOCGUsageCategory. The Usage Categories which control the layer state.

See also GetOCG function in DynaPDF manual.

Examples

Find layers in PDF:

Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
#
# import file
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Layers::Input PDF) ]
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFPage"; $pdf; 1) ]
#
# look for layers
Set Variable [ $count ; Value: MBS ( "DynaPDF.GetOCGCount" ; $pdf ) ]
Set Variable [ $index ; Value: 0 ]
Loop
    Exit Loop If [ $index ≥ $count ]
    #
    Set Variable [ $Name ; Value: MBS ( "DynaPDF.GetOCG" ; $pdf ; $index; "Name" ) ]
    Set Variable [ $Intent ; Value: MBS ( "DynaPDF.GetOCG" ; $pdf ; $index; "Intent" ) ]
    Set Variable [ $Visible ; Value: MBS( "Math.BitwiseAND"; $intent; 32 ) = 32 ]
    #
    New Record/Request
    Set Field [ Layers::Name ; $name ]
    Set Field [ Layers::Visible ; $visible ]
    Commit Records/Requests [ With dialog: Off ]
    #
    Set Variable [ $index ; Value: $index + 1 ]
End Loop
#
Set Variable [ $r ; Value: MBS( "DynaPDF.Release"; $pdf ) ]

See also

Blog Entries

Created 18th February 2019, last changed 18th February 2019


DynaPDF.GetMetadata   -   DynaPDF.GetOCGContUsage

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins