Forum Bugs

Unexpected results with tagged PDF overrides and UA-1

tonydewan
Hi there!

We are seeing unexpected results when making a PDF with the UA-1 profile and attempting to override the PDF tag type. Here's a minimum input that reproduces the results without error or warning:

<html lang="en">
  <title>Tag Test</title>
  <head>
    <style>
      div.div {
        prince-pdf-tag-type: Div;
      }
      div.sect {
        prince-pdf-tag-type: Sect;
      }
      div.none {
        prince-pdf-tag-type: none;
      }
    </style>
  </head>
  <body>
    <h1>Tag Test</h1>

    <div>
      <img src="https://picsum.photos/100/100" alt="a test image" />
    </div>

    <div class="div">
      <img src="https://picsum.photos/100/100" alt="a test image" />
    </div>

    <div class="none">
      <img src="https://picsum.photos/100/100" alt="a test image" />
    </div>

    <div class="sect">
      <img src="https://picsum.photos/100/100" alt="a test image" />
    </div>

    <img src="https://picsum.photos/100/100" alt="a test image" />
  </body>
</html>


See attachment for the resulting tags, at least according to Acrobat.

The default, unmodified <div> renders as a <P>. The 2 <div>s with overrides unexpectedly insert a <P> above the <Figure>. The <div> that attempts to override with none renders as a <P> just like the default. The top level <img> renders, as expected, as a <Figure>.

The desired result here is that the <div> set to `prince-pdf-tag-type: none` renders like the top level <img>, i.e. without the <P> tag. I've included the other <div>s because they exhibit similar unexpected behavior.

This PDF was rendered by Prince 14.1 via DocRaptor.

-
Tony from DocRaptor Engineering
  1. tags.png62.6 kB
mikeday
Thanks, we will have a fix for this issue shortly.
mikeday
We have made some adjustments to tagging in the latest build to avoid inserting unnecessary P tags in this case.