You can debug any Document Builder component. To do this, follow the instructions below.
Use the debugger command in your script:
debugger; var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); oParagraph.AddText("Hello world!");
Press the Run button to run your script.
The debugger command works as a breakpoint and pauses the execution at the script point where this command is inserted.
Set the V8_USE_INSPECTOR environment variable to 1:
SET V8_USE_INSPECTOR=1
export V8_USE_INSPECTOR=1
Run the Builder script with the docbuilder command:
docbuilder script.docbuilder
A link will appear in the terminal. You must open it in your Chrome/Chromium browser to connect to the JavaScript context.
Now you can debug the executed methods.