Skip to Content
Developing with PDF
book

Developing with PDF

by Leonard Rosenthol
October 2013
Intermediate to advanced content levelIntermediate to advanced
215 pages
4h 29m
English
O'Reilly Media, Inc.
Content preview from Developing with PDF

Chapter 6. Annotations

This chapter will go into detail on a special type of object in PDF—the annotation. Annotations are PDF objects that enable user-clickable actions as well as new types of content including 3D, video, and audio.

Introduction

The content that a user sees on a PDF page is described using a content stream of PDF graphic operators (see Content Streams for more). However, sometimes it is necessary to overlay that content with active or “hot” areas, or additional graphics. You may also want to incorporate new types of content onto your pages, such as 3D graphics or videos that cannot be described using those graphic operators. To accomplish these things, the annotation object is used.

As with page content, annotations are associated directly with a page. In any page dictionary for a page containing annotations, there has to be an Annots key whose value is an array of the annotations.

Annotation Dictionaries

Annotation objects are dictionary objects containing at least two keys: Rect and Subtype. The Rect key, of course, has a value that is a rectangle representing the page coordinates where the annotation is to be placed by the viewing application. The Subtype key has a name value that represents which one of the 27 types of annotations is being described by this particular dictionary. Many types of annotations will also have a Contents key whose value is a text string that is displayed either directly on the page or is an alternate description of the annotation’s content ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PDF Hacks

PDF Hacks

Sid Steward
Fonts & Encodings

Fonts & Encodings

Yannis Haralambous
iText in Action

iText in Action

Bruno Lowagie

Publisher Resources

ISBN: 9781449327903Errata Page