Skip to Content
NexPDF

Document structure

Let users edit document properties, follow bookmarks, set page labels, show, add and delete layers, and add, save and delete file attachments in an Electron window with NexPDF.

English

License module

Following bookmarks and listing layers and attachments, and saving a copy of an attachment, work without a key. Editing document properties and page labels, showing, hiding, adding and deleting layers, and adding and deleting attachments need the editor module (Startup tier and above).

The user works with these in the window, and pdf.save(path) or pdf.bytes() returns the document with the changes. To read or change them in code, use the document API (openDocumentFile, then the calls of the Node.js SDK).

Document properties

Document properties in the Protect mode (security) edits the title, author, subject and keywords of the document.

Bookmarks

The Bookmarks tab of the side panel lists the document's bookmarks (its outline) with their page numbers. A click goes to the page. The window shows bookmarks; it does not edit them.

Page labels

Page labels in the Pages mode (pages) sets the page numbers the document shows, like a printed book: i, ii, iii for the front matter, then 1, 2, 3. Each range has:

FieldMeaning
Starting at pageThe first page of the range; a range runs until the next one starts
Style1, 2, 3, i, ii, iii, I, II, III, a, b, c, A, B, C, or a prefix only
PrefixText before the number, for example A-
First numberThe number the range starts counting from

Remove all labels goes back to plain page numbers.

Layers

The Layers tab of the side panel lists the document's layers (optional content groups), common in CAD drawings and maps. The user shows or hides each layer, adds a new layer and deletes one. Showing or hiding a layer is stored in the document, so it is saved with it.

Attachments

The Attachments tab of the side panel lists the files embedded in the PDF. The user attaches a new file, saves a copy of an attachment (the window asks where) and deletes one.

Offer it

The side panel tabs are part of every mode. The More menu has rows that open them, which you can hide with their ids:

await openPdfWindow({
  file,
  license,
  config: { toolbarConfig: { hiddenItems: ['menu.layers', 'menu.attachments'] } },
});

To hide the side panel itself, add navPanel to toolbarConfig.hiddenItems. Document properties and page labels are not offered when the Protect and Pages modes are left out of modeConfig.availableModes.

On this page