PDF Layers SDK

Since the PDF 1.5 specification, PDF has supported Layers or Optional Content Groups (OCG). To best understand this, it is helpful to first think about how content is organized within PDFs. All PDF content is grouped into Content Streams. A Content Stream might include, for example, formatted text, an image or a form field. These elements can be precisely placed to produce the familiar pages we see in our PDF viewers.

Perhaps the clearest analogy for PDF Layers is to imagine a PDF as a stack of transparent plastic pages. Each can contain content like text or images; in PDF language, we would say that Content Streams can be placed on individual Layers. Layers can then be laid on top of each other, and each can be revealed or hidden to produce the desired effect.

One key use of Layers was to translate engineering drawings into self-contained files that could be used by anyone with a PDF viewer. For example, think of a floor plan with associated plans for plumbing, electrical wiring, ducting, networking cables, etc. In the engineer’s design software, it was possible to individually set the visibility for each of these plans. This was especially important when having them all visible simultaneously would produce a confusing result.

PDF Layers allow for granular control of each layer’s visibility, similar to that offered in the original design software. This helps not only our hypothetical engineer, but also those looking to, for instance, produce a single PDF user manual that supports multiple languages through the magic of Layers. Want it in English? Turn on the Layer with English text. If you prefer Spanish, turn on the Spanish Layer.

Quick PDF Library allows users to exert fine control over both Content Streams and Layers.

Feature Overview

  • Set whether Layers will be visible or printable
  • Create, delete or combine Layers
  • Find the number or properties of Layers
  • Process only certain types of Layers (e.g., visible, printable, locked)
  • Create, move, delete or combine Content Streams
  • Assign Content Streams to Layers

Function Group Capabilities

With 40 separate functions within the function group, Quick PDF Library offers phenomenal Content Streams and Layers functionality. Browse the complete range of PDF Content Streams and Layers functionality that Quick PDF Library can build into your application. The documentation includes multiple code samples in various programming languages to help you get started.

Examples of Quick PDF Library being used for Content Streams and Layers

More examples of practical applications working with Content Streams and Layers can be found in our Knowledge Base as they are added.