Skip to main content

Code

Description

Encapsulates a fragment of computer program text, preserving formatting and indicating that the content is intended as code.

Namespace
1.7
Category
inline

Differences

Well tagged PDF:

The 'Code' element in Well-Tagged PDF is used to encapsulate programming code or code snippets. It distinguishes code from regular text.

It must preserve formatting and be rendered in a monospaced font, ensuring that indentation and syntax are maintained for accurate content extraction and reflow.


PDFUA:

In PDF/UA, the 'Code' element ensures that code segments are accessible by providing clear semantic identification, which aids in maintaining the correct reading order.

Code blocks should be tagged with additional metadata or alternative text if necessary, to assist users in understanding the programming content through assistive technologies.

Use cases

Code element represents a block of Python code.

Try it

Inline code snippet within a paragraph

Try it

Tag Relationships

Related Matterhorn Protocol checkpoints