Bookmarking PDF Documents by Text Pattern Using the AutoBookmark™ Plug-in For the Adobe® Acrobat®
- Introduction
- The AutoBookmark™ software can automatically create multiple-level bookmarks in a PDF document that contains invoices, account statements, reports. The following tutorial shows how to take a PDF file with multiple invoices and create hierarchically structured multi-level bookmarks. The "billing" type would be at the first level, and invoice numbers – at the second level. Bookmarks will be arranged by the "billing" type. The resulting bookmark structure provides an effiient way to reveiw and navigate the document content.
- Input Document Description
- The input PDF document contains multiple invoices of variable page length. First page of each invoice contains an invoice number and one of the 3 different labels - COD, CORPCOD and CORPORATE ("billing" type).
- Bookmarking Approach
- Invoices always has an invoice number somewhere on the page. We are going to use the "Bookmark Text Patterns" function provided by the AutoBookmark® plug-in to create multiple-level bookmarks based on a billing type and invoice numbers. The "billing type" bookmarks will be created at the first level, while invoice numbers – at the second level.
- This operation is also available in the Action Wizard (Acrobat's batch processing tool) and can be used for automated processing of multiple PDF documents at once.
- This tutorial contains an advanced topic that shows how to create and use multiple text patterns for each bookmarking level. The order of the patterns can be used to produce different bookmarking results.
- Prerequisites
- You need a copy of the Adobe® Acrobat® along with the AutoBookmark™ plug-in installed on your computer in order to use this tutorial. You can download trial versions of both the Adobe® Acrobat® and the AutoBookmark™ plug-in.
- How To Create Multiple-Level Bookmarks In a PDF Document
- Step 1 - Open a PDF File
- Start the Adobe® Acrobat® application and open a PDF file using "File > Open…".
- Step 2 - Open the "Bookmark Text Patterns" Dialog
- Select "Plug-Ins > Bookmarks > Bookmark Text Patterns…" to open the "Bookmark Text Pattern" dialog.
- Step 3 - Add First Bookmark Level Settings
- Press the "Add Level…" button to create description of the first bookmark level. The "Bookmark Level Settings" dialog is going to appear on the screen.
- Step 4 - Configure Bookmark Level Settings
- The bookmark level will be automatically set to the level "1 (Top Level)". Specify text pattern by entering "COD|CORPCOD|CORPORATE" as a regular expression for the first bookmark level. This text pattern will bookmark any page that contains any of these labels: "COD", "CORPCOD", "CORPORATE". Check the "Match text case" box. Click "OK" once done.
- Step 5 - Add Second Bookmark Level Settings
- Press the "Add Level…" button to enter a description of the second bookmark level. The "Bookmark Level Settings" dialog is going to appear on the screen.
- Step 6 - Configure Bookmark Level Settings
- The bookmark level will be automatically set to the level "2". Specify text pattern by entering "Invoice Number: \d+" as a regular expression for this bookmark level. All occurrences of "Invoice Number: XXXXXXX" (where XXXXXX is a number) will be bookmarked by this text pattern. Check the "Match text case" box. Click "OK" button once done.
- Step 7 - Start the Bookmarking Process
- Now you should see 2 entries in the "Bookmark Levels Settings" box. One for each bookmark level. Optionally, press the “Save To File…” button to save bookmarking settings into a settings file (*.abmp extension). This file can be loaded and reused later. Click ‘OK” to start the bookmarking process.
- Step 8 - Check the Bookmarking Stats
- The dialog showing bookmarking results will be displayed at the end of the processing. Click "OK" to finish.
- Step 9 - Examine the Results
- The AutoBookmark™ plug-in automatically creates 2-level bookmarks for each invoice page: 1st level – "billing" type; 2nd level – invoice number. Thus, in certain cases the bookmarks are duplicated. Now the duplicated bookmarks need to be merged.
- Step 10 - Open the "Merge Duplicate Bookmark Titles" Dialog
- Select "Plug-ins > Bookmarks > Merge Duplicate Titles…" from menu to open the "Merge Duplicate Bookmark Titles" dialog.
- Step 11 - Configure Merging Duplicate Bookmarks Settings
- Define starting and ending bookmark level to be merged. Enter "1" in the "Starting bookmark level" box. Enter "2" in the "Ending bookmark level" box. Click "OK" to start the process.
- Step 12 - Examine the Results
- The AutoBookmark™ plug-in has automatically combined multiple bookmarks with the same title into a single bookmark. If bookmarks had child bookmarks, then they were consolidated under unified "parent" bookmark. Now this document has 2 bookmark levels and all bookmarks are arranged by the "billing" type (1st level – "billing" type; 2nd level – invoice number, that points at the first page of each invoice).
- Advanced Topic: Using Multiple Text Patterns for each Bookmarking Level
- The latest AutoBookmark™ version (from version 6.4) allows using multiple text patterns for each bookmarking level. The order of the text patterns in this case controls the order in which text patterns are applied. Changing the order of the text patterns may result in different bookmarking results and provides an additional control over the bookmarking process. Click on desired bookmark pattern in the "Bookmark Text Pattern" dialog to select it. Click "Edit" to open the "Bookmark Level Settings" dialog.
- Specify the bookmark level in the "Bookmark level" box. Now the bookmark text patterns could have multiple descriptions for the same bookmarking level. This allows creating of more sophisticated bookmarking rules.
- The order of the patterns in the list now matters and can be used to get different bookmarking results when bookmarked text is located on the same page. Each pattern is applied sequentially in the order it is listed. Click on a text pattern in the "Bookmark Levels" list to select it. Click "Move Up" and "Move Down" buttons to change text pattern order in the list.
- For example, consider a PDF document that contains on each page 5 text "lines" of text: Product, Description, Overview, Price, Weight. If there are 5 text patterns in the "Bookmark Levels" list:
- 1. Level 1: Product
- 2. Level 2: Description
- 3. Level 1: Overview
- 4. Level 2: Price
- 5. Level 2: Weight
- Then the output bookmarks will look like as:
- However, if the order of these 5 text patterns is different:
- 1. Level 1: Product
- 2. Level 1: Overview
- 3. Level 2: Description
- 4. Level 2: Price
- 5. Level 2: Weight
- Then the output bookmarks will be generated in a different order:
- Here is another example if the order and levels of these 5 text patterns are different:
- 1. Level 1: Overview
- 2. Level 2: Description
- 3. Level 3: Price
- 4. Level 2: Weight
- 5. Level 2: Product
- Then the output bookmarks will look like as follows: