| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
DynaPDF.Parser.Content
Queries page content as JSON.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| DynaPDF | 16.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "DynaPDF.Parser.Content"; PDF { ; Filter } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| The PDF reference. | |||
| Filter | Pass an operator name or number to only return these operators. | "DrawPath" | Optional |
Result
Returns JSON or error.
Description
Queries page content as JSON.Examples
Extract all the DrawPath operators:
Set Field [ DynaPDF Replace Text::Content ; MBS( "DynaPDF.Parser.Content"; $pdf; "DrawPath") ]
Example result:
[ { "OperatorIndex": 5, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 0, "OP": [5, 4, 4, 4, 3], "OPNames": ["MoveTo", "LineTo", "LineTo", "LineTo", "ClosePath"], "OPCount": 5, "Vertices": [ { "x": 0, "y": 595.275574 }, { "x": 842, "y": 595.275574 }, { "x": 842, "y": -0.724426 }, { "x": 0, "y": -0.724426 } ], "VerticesCount": 4 }, { "OperatorIndex": 23, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [ 6 ], "OPNames": [ "Rectangle" ], "OPCount": 1, "Vertices": [ { "x": 0, "y": 0 }, { "x": 645, "y": 400 } ], "VerticesCount": 2 }, { "OperatorIndex": 285, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 }, { "OperatorIndex": 321, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 } ]
Example result:
[ { "OperatorIndex": 5, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 0, "OP": [5, 4, 4, 4, 3], "OPNames": ["MoveTo", "LineTo", "LineTo", "LineTo", "ClosePath"], "OPCount": 5, "Vertices": [ { "x": 0, "y": 595.275574 }, { "x": 842, "y": 595.275574 }, { "x": 842, "y": -0.724426 }, { "x": 0, "y": -0.724426 } ], "VerticesCount": 4 }, { "OperatorIndex": 23, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [ 6 ], "OPNames": [ "Rectangle" ], "OPCount": 1, "Vertices": [ { "x": 0, "y": 0 }, { "x": 645, "y": 400 } ], "VerticesCount": 2 }, { "OperatorIndex": 285, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 }, { "OperatorIndex": 321, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 } ]
Query content of a page as JSON:
# Initialize DynaPDF if needed
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ “InitDynaPDF” ; Specified: From list ; Parameter: ]
End If
# Clear current PDF document
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Load PDF from container
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; DynaPDF Replace Text::InputPDF) ]
# import a page
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFPage"; $pdf; 1) ]
# initialize parser
Set Variable [ $OptimizeFlags ; Value: 0 ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.Create"; $pdf; $OptimizeFlags ) ]
# parse page
Set Variable [ $page ; Value: 1 ]
Set Variable [ $r ; Value: MBS("DynaPDF.Parser.ParsePage"; $pdf; $page; "EnableTextSelection") ]
# Query content as JSON
Set Field [ DynaPDF Replace Text::Content ; MBS( "DynaPDF.Parser.Content"; $pdf) ]
# Cleanup
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ “InitDynaPDF” ; Specified: From list ; Parameter: ]
End If
# Clear current PDF document
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Load PDF from container
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; DynaPDF Replace Text::InputPDF) ]
# import a page
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFPage"; $pdf; 1) ]
# initialize parser
Set Variable [ $OptimizeFlags ; Value: 0 ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.Create"; $pdf; $OptimizeFlags ) ]
# parse page
Set Variable [ $page ; Value: 1 ]
Set Variable [ $r ; Value: MBS("DynaPDF.Parser.ParsePage"; $pdf; $page; "EnableTextSelection") ]
# Query content as JSON
Set Field [ DynaPDF Replace Text::Content ; MBS( "DynaPDF.Parser.Content"; $pdf) ]
# Cleanup
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
See also
- DynaPDF.ImportPDFPage
- DynaPDF.IsInitialized
- DynaPDF.OpenPDFFromContainer
- DynaPDF.ParseContent
- DynaPDF.Parser.Create
- DynaPDF.Parser.Delete
- DynaPDF.Parser.FindText
- DynaPDF.Parser.Line
- DynaPDF.Parser.ParsePage
- DynaPDF.Release
Release notes
- Version 16.2
- Added DynaPDF.Parser.Content and DynaPDF.Parser.Delete functions.
Blog Entries
This function checks for a license.
Created 2nd April 2026, last changed 30th April 2026