metadata-pdfua

This example shows two things. First, it demonstrates how to generate PDF metadata directly from HTML <meta> elements. This works out-of-the-box with all converters. Some converters all you to specify the metadata through their API or through commandline parameters. Second, the example demonstrates how to generate a PDF with UA (universal accesiblity) profile (support for screen readers). Only Antennahouse, PDFreactor and PrinceXML support the PDF/UA profile as an optional conversion option. This is usually combined with the inclusion of tagged content which is usually named a tagged PDF.

Check the Makefile in the Github repository (link above) for investigating the related commandline parameters for PDF/UA and tagged PDF.

We used the PAC Checker (https://www.access-for-all.ch/ch/pdf-werkstatt/pdf-accessibility-checker-pac.html) for checking PDF/UA compliance.

Repository files

PDF files

Converter Status PDF Preview
PDFreactor  OK
full support for PDF/UA and tagged PDFs
PrinceXML  OK
full support for PDF/UA and tagged PDFs
Antennahouse  OK
full support for PDF/UA and tagged PDFs
Weasyprint  OK
no PDF/UA support
PagedJS  OK
no PDF/UA support

HTML input

<html lang="en">
    <head>
        <title>Print CSS Metadata test</title>
        <meta name="author" content="Andreas Jung"/>
        <meta name="subject" content="Print CSS Metadata"/>
        <meta name="keywords" content="printcss,pdf,xml,html,css"/>
        <meta name="date" content="2020-07-21"/>
        <meta name="generator" content="print-css-rocks"/>
        <link rel="stylesheet" type="text/css" href="styles.css">
    </head>
    <body language="en">
        <h1>This is chapter one</h1>
            <p>
            Nibh. Maecenas a lacus. Mauris porta quam non massa molestie scelerisque.
            Nulla sed ante at lorem suscipit rutrum. Nam quis tellus. Cras elit nisi,
            ornare a, condimentum vitae, rutrum sit amet, tellus. Maecenas a dolor.
            Praesent tempor, felis eget gravida blandit, urna lacus faucibus velit, in
            consectetuer sapien erat nec quam. Integer bibendum odio sit amet neque.
            Integer imperdiet rhoncus mi. Pellentesque malesuada purus id purus. Quisque
            viverra porta lectus. Sed lacus leo, feugiat at, consectetuer eu, luctus quis,
            risus. Suspendisse faucibus orci et nunc. Nullam vehicula fermentum risus.
            Fusce felis nibh, dignissim vulputate, ultrices quis, lobortis et, arcu. Duis
            aliquam.
            </p>
        <h2>This is chapter one.one</h2>
        <p>
            Sint et aute ad duis eu esse aliquip. Aliquip velit magna elit excepteur
            dolore id sint sint elit veniam in eu. Sint voluptate in esse laboris
            exercitation. Id sint non culpa est. Lorem adipisicing anim occaecat cillum
            duis ullamco aliqua anim ut consectetur aliqua. Incididunt labore fugiat
            cupidatat culpa ad anim qui ad irure ut nisi ad. Eu ea veniam non magna
            nostrud laborum aliqua ullamco consectetur velit laboris officia laborum
            nostrud.
        </p>
        <p>
            Cupidatat duis adipisicing ad fugiat minim. Cupidatat magna dolore commodo
            enim. Eiusmod ex incididunt irure laborum officia amet amet laborum voluptate
            fugiat eiusmod. Sint deserunt id elit adipisicing et consequat.
        </p>
        <h3>This is chapter one.one.one</h3>
        <img src="kangaroo.png" alt="This is a kangaroo"/>
        <h1>This is chapter two</h1>
         <p>
            Nibh. Maecenas a lacus. Mauris porta quam non massa molestie scelerisque.
            Nulla sed ante at lorem suscipit rutrum. Nam quis tellus. Cras elit nisi,
            ornare a, condimentum vitae, rutrum sit amet, tellus. Maecenas a dolor.
            Praesent tempor, felis eget gravida blandit, urna lacus faucibus velit, in
            consectetuer sapien erat nec quam. Integer bibendum odio sit amet neque.
            Integer imperdiet rhoncus mi. Pellentesque malesuada purus id purus. Quisque
            viverra porta lectus. Sed lacus leo, feugiat at, consectetuer eu, luctus quis,
            risus. Suspendisse faucibus orci et nunc. Nullam vehicula fermentum risus.
            Fusce felis nibh, dignissim vulputate, ultrices quis, lobortis et, arcu. Duis
            aliquam.
        </p>
    </body>
</html>

Stylesheet

@import url("../styles/a5.css");

img {
    width: 75%;
}