Frequently Asked Question:
What is the difference between Layers and Optional Content Groups (OCGs) in Quick PDF Library?
There are functions for working with both Layers and Optional Content Groups (OCGs) in Quick PDF Library -- and I see that in the world of Acrobat, Layers and OCGs refer to the same feature -- so what is the difference between Layers and OCGs in Quick PDF Library and why are there different functions that make use of both terms?
In Quick PDF Library layers and optional content groups do not refer to the same technology, however, in Adobe Acrobat, they do. Confused? There's a simple explanation for this anomaly:
A page can have one or more content streams. These content streams are combined into one long string by the PDF viewer.
When Quick PDF Library was first developed (about 10 years ago) we called these individual content streams "layers" as they enabled you to move groups of things on top of and below other things and each new function in this area included the term layer in its name (NewLayer, LayerCount, MoveLayer, etc).
However, in version 1.5 of the PDF specification (after we'd already began using the term layer to describe content streams) Adobe added a new feature called optional content groups. This new feature was technically referred to as optional content groups (OCGs) in the PDF specification, but in Adobe Acrobat and Adobe Reader, Adobe elected to use the term layers instead. And thus the confusion began:
We call content streams layers and Adobe calls optional content groups layers.
So what do we call optional content groups in Quick PDF Library? Well, we call them optional content groups (NewOptionalContentGroup, OptionalContentGroupCount, etc). We didn't think it was necessary to change our terminology, since we've taken our terminology straight from the PDF specification.
In addition, if we were to rename our functions in order to accommodate Adobe's slightly different terminology, then it would break the backwards compatibility of our library for our customers, and so renaming the functions for clarity is unfortunately not an option at this stage.