Understanding the PDF file Format – ActualText

Text is defined in the PDF file format as a display value (normally what you see onscreen) and an extraction value. It is useful to have 2 options because some characters are displayed differently to what you extract (for example fl is one glyf onscreen but two in extracted text).

But did you know you can have an additional value set to show the actual Text enclosed in a Tj command? If you are using MArked Content, the Dictionary can contain a Dictionary value /ActualText which will be used in place of whatever is shown in the Tj command, which is ignored. So if you want to add something different (or just ensure that the value comes out exactly as you want, it is a useful feature. What would you use it for? 

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!

Related Posts:

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.
Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>