Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Understanding the PDF file format – Layers

1 min read

One of the really cool features about PDF files is that they are not a boring, static file format – they can interact with the user and the display can change. One of my favourite interactive features is Layers.

You can think of Layers as a separate overlaid page on which text or images can be added. The Layer can have a name and the user (or the PDF itself) can alter whether this Layer is visible or not.

This has lots of practical and fun uses. There is a PDF version of the Hangman game which uses Javascript to think of a word and progressively update the display as the user plays the game.

All the parts to the Hangman drawing are on Layers and updated by Javascript.

A more practical example is to allow additional information to be included on plans, diagrams or maps

And we can see just the detail we want with a couple of clicks…

Layers are also useful as we can display different things in a printout compared with onscreen display.

So Layers offer a very powerful and user-friendly way to enhance your PDF files for useful purposes or just for fun. If you have seen any really interesting uses of Layers, why not drop me an email or post the link here.

If you would like to play with Layer in JPedal, the functionality is built into Java PDF Viewer and there is a tutorial here.

This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.