Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Returns properties for layer.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 9.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Handle | The OCG handle. | $OCG |
Selector | Which value to return. | "Name" |
Returns value or error.
Handle | Handle or array index |
Intent | Bitmask, see TOCGIntent. For Intent and visibility state |
Name | Layer name |
HaveContUsage | If 1, the layer contains a Content Usage dictionary. See DynaPDF.GetOCGContUsage |
AppEvents | Bitmask, see TOCAppEvent. If non-zero, the layer is included in one or more app events which control the layer state. |
Categories | Bitmask, see TOCGUsageCategory. The Usage Categories which control the layer state. |
See also GetOCG function in DynaPDF manual.
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 ) ]
Created 18th February 2019, last changed 18th February 2019
DynaPDF.GetMetadata - DynaPDF.GetOCGContUsage
Feedback: Report problem or ask question.