Skip to content

Tagged PDF edges left after #114 #116

Open

Description

@czj

#114 shipped tagged PDF for the native API. Its reviews left these edges, each rare and each failing safe or already true for PDF/A before:

  • Imported pages: the check for marked content of their own reads the page's content streams only, not its form XObjects. It errs on refusing: optional-content layers (/OC … BDC) and text containing BDC or BMC as a word count as marked content. Scanning with the reader's lexer instead of a regex would fix both. Pages with several streams are also decoded twice, once for the check and once to join them.
  • A rescued CannotFit: tag_structure adds the element and moves the heading level before the box draws, so a box that raises and is rescued leaves an empty element, an H1 that counts for the heading-level check.
  • delete_page: marked-content references still point at the deleted page, which is then written as an orphan.
  • to_s twice: finalize_tagging builds the structure tree again on each render, so the second output carries both (PDF/A's metadata already did this before Tagged PDF: PDF/UA-1 and PDF/A-3a from the boxes' roles #114).
  • Default font: save_font loads the default family even when the text names its own font, so registering the default family late raises UnknownFont; default_font_family stays set when :default is restyled without a font.

Part of #76, with the Prawn API's tag and artifact blocks, ActualText and the benchmarks page.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions