Pdf - PdfThreadAction
18 Nov 20264 minutes to read
Represents an action that navigates to a bead in an existing article thread.
// Load an existing PDF document containing an article thread
let document: PdfDocument = new PdfDocument(data, password);
let page: PdfPage = document.getPage(0);
// Create a thread action
let action: PdfThreadAction = new PdfThreadAction('Article1', 0);
// Create a button and assign the action
let field: PdfButtonField = new PdfButtonField(
page, 'OpenThread', { x: 20, y: 20, width: 120, height: 30 }
);
field.text = 'Open thread';
field.actions.mouseUp = action;
document.form.add(field);
// Save and destroy the document
document.save('output.pdf');
document.destroy();Properties
Get beadIndex number
Gets the zero-based index of the destination bead.
// Load an existing PDF document containing a thread action
let document: PdfDocument = new PdfDocument(data, password);
// Get the thread button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the thread action and bead index
let action: PdfThreadAction = field.actions.mouseUp as PdfThreadAction;
let beadIndex: number = action.beadIndex;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set beadIndex void
Sets the zero-based index of the destination bead.
// Load an existing PDF document containing an article thread
let document: PdfDocument = new PdfDocument(data, password);
// Get the thread button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the thread action and set the bead index
let action: PdfThreadAction = field.actions.mouseUp as PdfThreadAction;
action.beadIndex = 1;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | number |
The zero-based index of the destination bead. |
Get next PdfAction
Get the next action to be performed after the action represented by this instance.
Set next void
Set the next action to be performed after the action represented by this instance.
| Parameter | Type | Description |
|---|---|---|
| value | PdfAction |
The next action to be executed. |
Get threadId string
Gets the title of the destination article thread.
// Load an existing PDF document containing a thread action
let document: PdfDocument = new PdfDocument(data, password);
// Get the thread button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the thread action and thread title
let action: PdfThreadAction = field.actions.mouseUp as PdfThreadAction;
let threadId: string = action.threadId;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set threadId void
Sets the title of the destination article thread.
// Load an existing PDF document containing article threads
let document: PdfDocument = new PdfDocument(data, password);
// Get the thread button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the thread action and set the thread title
let action: PdfThreadAction = field.actions.mouseUp as PdfThreadAction;
action.threadId = 'Article2';
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | string |
The title of the destination article thread. |