Skip to content

Accessibility documentation says to use unavailable subset value #1804

Open

Description

@taybin

What subset should be used to enable PDF/UA? The documentation says

Pass the option subset: 'PDF/UA' when creating your PDFDocument (if you wish the PDF to be identified as PDF/UA-1).

But that is not a valid value, as of 0.20.2.

Activity

  1. blikblum commented on Sep 24, 2026

    @blikblum
    Member

    Please open a PR

  2. taybin commented on Sep 24, 2026

    @taybin
    Author

    I'm not sure what the fix is. Is the documentation wrong or is the library type wrong, and if so can it be easily extended?

  3. blikblum commented on Sep 25, 2026

    @blikblum
    Member

    Add a document option to set PDF/UA and update docs

  4. tevinch commented on Sep 28, 2026

    @tevinch

    'PDF/UA' is the correct runtime value in 0.20.2: initSubset already handles it and calls initPDFUA().

    I reproduced the TypeScript mismatch with @types/pdfkit@0.17.6: its PDFKit.Mixins.PDFSubsets union lists only PDF/A values. With TypeScript 7.0.2 in strict mode, the documented option gives TS2322. For these versions, this temporary assertion on the supported literal compiles:

    import PDFDocument = require('pdfkit');
    
    const doc = new PDFDocument({
      subset: 'PDF/UA' as PDFKit.Mixins.PDFSubsets,
      tagged: true,
      lang: 'en-US',
      displayTitle: true,
      info: { Title: 'Accessible document' },
    });

    The declaration needs to include 'PDF/UA'; the existing runtime does not need a new option for that value. The assertion should be removed once the types include it, and should not be applied to arbitrary strings.

    I also compiled and ran a complete tagged-paragraph example against the published 0.20.2 package. With the upstream Roboto font fixture, the finished PDF contains the PDF/UA-1 metadata and passes veraPDF 1.30.2's UA-1 profile. That validates this small example; the constructor options alone do not make other content accessible.

  5. blikblum commented on Oct 4, 2026

    @blikblum
    Member

    One of the pending tasks is to get the types builtin in the package

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