Repository navigation
Conversation
Two small uncompressed PDFs that exercise checks none of the existing examples can reach: headings, lists, tables, figure alt text, bookmarks, form field descriptions, and the Suspects flag. One passes each check and one fails each check.
The PDF Version flag now warns when the effective version is below 1.7, which PDF/UA-1 requires. A catalog /Version entry that raises the header version is honored. A new Suspects check warns when the mark information dictionary sets Suspects to true, and stays silent otherwise.
Bookmarks reports whether the catalog references an outline. No count is shown because the first /Count in a file is usually the page tree. Form Fields appears only when the file has an AcroForm, and compares the number of fields with the number of TU descriptions. Adds countMatches and pluralize helpers for the structure checks to share.
Structure checks run only when the file is tagged and the tag tree is readable as plain text. Producers that store the tag tree in compressed object streams get a single Structure flag saying it could not be inspected, instead of false warnings. Every structure regex requires the /S key so names in other dictionaries, such as /L in a linearization dictionary, can't match. Headings warns when no H1 is present, tables warns when no TH cells are present, and figures warns when alt text entries are fewer than figure tags.
Short callout above the file picker saying the tool detects missing features but can't confirm a feature is correct, and naming PAC 2024, Acrobat's checker, and a screen reader as the next steps.
Every flag is also recorded in a results array as it is rendered, and a Download results as CSV button appears once checks finish. Cells are quoted, inner quotes doubled, and values that start with a formula character get a leading apostrophe because titles and producer strings come from the PDF. The file starts with a byte order mark so spreadsheets read accented characters correctly.
README lists the new checks under features, results, and visual states, adds the export step to usage, and replaces two limitations that are now partly covered with accurate wording about compressed tag trees and unvalidated tags. The example result on the page gains the Bookmarks and Structure rows the PAC 2024 file now produces.
The regex assumed Marked was the first key in the mark information dictionary with exactly one space before the value. A producer that writes Type first or uses other whitespace reported Marked as missing.
The number shown was the StructTreeRoot object number captured by the regex, not a count of tags. There is no reliable count to put in its place, because most producers compress the tag tree, so the check now reports Yes or No. The regex also requires the full indirect reference so a stray mention of the key can't match.
addFlagWithLink kept linkHref and linkText parameters that nothing read after result links were removed, and every caller passed the label twice. Renamed to addLabeledFlag with status, label, and value.
Status was conveyed to sighted users only by background and border color, which fails WCAG 1.4.1 Use of Color. The visually hidden ::after text that already existed for screen readers is now visible and reads (pass), (warning) or (failure). Default flags remain unlabeled because they carry neutral information. addFlag now wraps its content in a span, matching addLabeledFlag, so the label gets the same spacing on file-level error flags. The data-status values and the CSV export are unchanged.
Warning flags are labeled (inspect) and success flags carry no label, so the README now describes those states the same way the page renders them.
Owner
Author
|
Actions needed a bump |
Contributor
Accessibility scan: all applicable checks passedTo see scan details, download the accessibility report. Scan summary
This scan used axe-core 4.11.3 with Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/155.0.0.0 Safari/537.36 and browser resolution 1920x1080. |
The help sidebar showed a document title as success and a missing title as a warning, while the checks report them as default and failure. The Language check also emitted a lowercase value that no other check uses. The examples, the README, and the Language value now agree with the rendered output.
Contributor
Accessibility scan: all applicable checks passedTo see scan details, download the accessibility report. Scan summary
This scan used axe-core 4.11.3 with Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/155.0.0.0 Safari/537.36 and browser resolution 1920x1080. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds eight regex-based checks, a disclaimer, CSV export, and two handwritten fixture PDFs. Also fixes three pre-existing issues found while reviewing the checks.
New checks
/Versionentry that raises the header version is honored./Countin a file is usually the page tree.The structure checks run only when the tag tree is readable as plain text. Producers that store it in compressed object streams, including Acrobat and Word, get a single Structure flag saying it could not be inspected, instead of false warnings. Every structure regex requires the
/Skey so names in other dictionaries can't match. Without that,/Lin the linearization dictionary made every linearized file report a list.Other changes
examples/, one that passes each new check and one that fails each. No existing example contained forms, tables, figures, or a Suspects flag.::aftertext that only screen readers received is replaced by this visible text, so nothing is announced twice. Success and default flags carry no label. File-level error flags now wrap their text in a span, matching labeled flags, so the label gets the same spacing.Fixes to existing behavior
addLabeledFlagwith status, label, and value.Verification