Documentation: Scripting: PDF Bookmarking

PDF Bookmarking can be accomplished by either inserting PB- sheets where you desire a PDF bookmark to be set (see screenshot) or via scripting (see code below):

 

   )>

 

 

Or…

 

This code will create a PDF Bookmark on the first page of a document based on the value entered in the field PDFBookmarkName:

 

public virtual bool DocumentDataRecordValidated(IDocument document, IDataRecord dataRecord, bool valid, ref string validationMessage)
  {
    try
    {
      document.Pages[0].PDFBookmarks.Clear();
      document.Pages[0].PDFBookmarks.Add(dataRecord["PDFBookmarkName"].StringValue, 1, Color.Black, FontStyle.Regular);
      return valid;
    }
    catch (Exception exception)
    {
      base.ProcessException(exception);
      return false;
    }
  }

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.