data-id=working-with-pdf-features

Working with PDF Features

This chapter discusses how you can work with various features of PDF documents using the Acrobat SDK.

data-id=48010
data-id=navigation-in-pdf-documents
data-id=61268
data-id=bookmarks

Bookmarks

A bookmark corresponds to an outline object in a PDF document. A document outline consists of a tree-structured hierarchy of bookmarks

that displays the document’s structure, allowing the user to navigate interactively from one part of the document to another. Each bookmark has a title that appears on screen and an action that specifies what happens when the user clicks on the bookmark.

Bookmarks can be either created interactively through the Acrobat user interface or generated programmatically. Typically, a user-created bookmark is used to move to another location in the current document, although other actions can be specified, such as opening a web link, opening a file, playing a sound, or executing JavaScript.

You can use JavaScript, a plug-in, or IAC to get or set the following properties:

data-id=48703
data-id=thumbnails

Thumbnails

Page thumbnails are miniature previews of the pages in a document. You can use page thumbnails in Acrobat to jump quickly to a selected page and to adjust the view of the page.

When you move, copy, or delete a page thumbnail, you actually move, copy, or delete the corresponding page. You can embed page thumbnails in a PDF document so that they need not be redrawn every time you select the Pages tab. They can easily be removed and embedded again if necessary.

You can use the Acrobat SDK to create and remove thumbnails in a PDF document.

data-id=74764
data-id=links

Links, or hyperlinks, let users jump to other locations in the same document, to other electronic documents, or to websites. You can use links when you want to ensure that your reader has immediate access to related information. You can also use links to initiate actions.

The Acrobat SDK provides support for the addition, customization, or removal of links within PDF documents. These links can be used to access URLs, file attachments, or destinations within the document.

In addition, JavaScript can be used to specify whether cross-document links are opened in the same window or in a new one.

data-id=36257
data-id=actions-for-special-effects

Actions for special effects

Thumbnails, bookmarks, links, and other objects have actions associated with them, and you can use JavaScript to customize their behavior. For example, you can use them to display messages, jump to destinations in the same document or any other, open attachments, open web pages, execute menu commands, or perform a variety of other tasks.

You can also customize these actions so that they change their appearance after the user has clicked on them.

data-id=67060
data-id=pdf-page-manipulation

PDF page manipulation

You can use the Acrobat SDK to insert or remove pages from a PDF document. For example, you can do the following tasks:

You can also access JavaScript functionality from an external application.

data-id=70311
data-id=page-content

Page content

Page content is a major component of a PDF file. It represents the visible marks on a page that are drawn by a set of PDF marking operators. The set of marking operators for a page is also referred to as a display list, since it is a list of marking operations that represent the displayed portion of a page. For more information on page content streams, see the PDF Reference.

You can use the PDFEdit API to access PDF page contents. With PDFEdit, your plug-in can treat a page’s contents as a list of objects rather than manipulating the content stream’s marking operators. There is no JavaScript equivalent to the PDFEdit API to allow you to manipulate page content. For more information on this API, see the Acrobat and PDF Library API Reference and the Snippet Runner Cookbook.

data-id=89157
data-id=document-logical-structure

Document logical structure

You can insert logical structure into a PDF document by creating a tagged PDF document. The PDSEdit API provides the ability to add, modify, and view this logical structure. For more information, see the Acrobat and PDF Library API Reference.

Authoring applications can also add structure pdfmarks to the PostScript language code generated when a document is printed. For more information, see the. pdfmark Reference.

data-id=56283
data-id=other-ways-of-modifying-pdf-documents

Other ways of modifying PDF documents

You can use a plug-in or JavaScript to modify a PDF document by cropping and rotating pages, numbering pages, and adding headers and footers.

data-id=67602
data-id=watermarks

Watermarks

JavaScript provides methods to create watermarks within a document, and place them in optional content groups (OCGs). You can also add watermarks using C APIs. The Acrobat SDK contains a sample plug-in that adds a watermark. For more information, see the Acrobat SDK Samples Guide.

data-id=53850
data-id=spell-checking

Spell-checking

Acrobat provides a Spelling plug-in that can scan a document for spelling errors. Using any of the Acrobat SDK technologies, you can do the following tasks:

The following additional functionality is available to plug-ins and external applications, but is not available using JavaScript:

data-id=13204
data-id=multimedia

Multimedia

Multimedia objects can be included in the content of PDF documents, as well as in annotations. You can only manipulate multimedia objects and players using JavaScript; you cannot use a plug-in. Using JavaScript, you can perform the following tasks:

For more information, see Acrobat JavaScript Developer Guide.

data-id=39330
data-id=printing-pdf-files

Printing PDF files

Using the Acrobat SDK, you can control the way that Acrobat, Acrobat Reader, or your external application prints PDF files. Using any of the Acrobat technologies, you can customize the way that a PDF document is printed.

Since printing involves sending pages to an output device, there are many options that can affect print quality. JavaScript can be used to enhance and automate the use of these options in print production workflows. For more information, see the Acrobat JavaScript Developer Guide.

With plug-ins, you can use methods to customize and control how a PDF file is printed from Acrobat or Acrobat Reader. Depending on the methods you use, a user interface may be invoked. For example, you can use a method to print a document to the current printer using the current print settings and job settings with no user interface. You can specify a page range, a PostScript version, and whether to shrink the pages to fit the printer. For more information, see Acrobat Plugin Developer Guide.

Using the IAC APIs, you can print a PDF file from an external application. For more information, see Interapplication Communication Developer Guide.

data-id=56377
data-id=embedded-fonts

Embedded fonts

Acrobat Distiller and the PDF Library add font embedding information to fonts that are embedded in PDF files. With the inclusion of this information, your code can determine how an embedded font can be used. These operations also may apply to code used with the PDF Library SDK.

Acrobat plug-in developers can remove and embed fonts in an existing PDF document. You can also use fonts that are already embedded in a PDF document for preview and printing, as well as editing. However, allowing editing using embedded fonts is not recommended, and in some cases it is impractical. For example, Chinese, Japanese and Korean (CJK) fonts potentially include thousands of glyphs, so applications must subset these fonts when embedding them in a PDF file. This precludes embedded CJK fonts from being used for editing by a plug-in.

PDF Library users can perform these operations using an existing PDF document, or they can create a PDF document from scratch that includes embedded fonts. Creating a document from scratch cannot be performed by a plug-in, but it can be done by using PDF Library calls from within a compiled application that includes the PDF Library.