Repository navigation
v0.2.3
A document's title is no longer read twice, heading counts match the headings you can move to, and the libraries underneath are current. The extension now declares the browsers it needs.
What changes for a reader
- The title is read once. The Reader shows the PDF's title as the page heading and drops a first heading that repeats it. Word tags its Title-style paragraph as a heading, and when the title has a space between two Japanese characters the two did not match: extraction drops that space, and the title metadata keeps it. A test document titled 「アクセシビリティ検証用文書 その1」 had it read again as 「アクセシビリティ検証用文書その1」. They are now compared the same way.
- Heading counts are the headings you can move to. The structure picker's counts, and the notice that says another reading has headings, used to count the title heading the Reader does not show. A reading whose only heading was the title was offered as having one. The Markdown view also no longer repeats the title under its own
#. - A tagged document whose only heading tag is its title can now get the combined reading (構造タグ+推測した見出し), on the same terms as one with no heading tags: when the inferred reading has headings that can be placed on the author's text. Before, Word's Title-style heading made it look as if the author had tagged headings, and it was never offered.
- Chrome 147 or later is required (Edge 147; Firefox 144, whose build is not published yet). The bundled PDF.js calls newer JavaScript without checking for it first, and every earlier release already depended on it. Without
Math.sumPrecise, which Chrome has from 147, embedded fonts fail to load and text is read from a substitute font: seen in testing, where that method was missing, though not run in an old browser. What the other methods' absence does in older browsers was not observed. The extension can no longer be installed or updated from the Chrome Web Store in a browser below these versions. A copy already installed there stays on 0.2.2 until the browser is updated. (#23)
What does not change
- PDF.js 6.4.299 (was 6.3.289) and pdf-inspector 1.25.2 (was 1.25.0), still with this project's fix for Japanese and Chinese text in fonts without a ToUnicode map. Measured on fourteen documents, each opened with every reading preference, the structure the Reader exposes is the same as with the previous versions: every heading, list, table, figure and their text. That comparison does not cover how figures are drawn, which was looked at in Chrome on a few documents only.
- The extension is 0.45 MB smaller installed, and 0.21 MB smaller to download, measured against a build of 0.2.2. PDF.js's module for running a PDF's own JavaScript, which was being copied in and used by nothing, is no longer included; that alone saves a little more, and the updated libraries add some back.
Not changed yet
- A tagged figure under 24pt on a side is still not shown as an image. Where to draw that line is #15.
- An author's alternative text is still read by screen readers but not drawn on screen when the image is shown. Drawing it on screen every time would mean either hiding visible text from assistive technology or turning a described image decorative, and we decided against both. A setting or a hover would leave it unseen by default or out of print. #17 is closed for now with the reasons.
Under the hood
- Hand-written expectations for what the Reader exposes to assistive technology. A Word document written for this project, exported as a tagged PDF, is now in the repository with an outline of the accessibility tree the Reader should produce: headings, lists, table headers, figures, and what must be absent. It is computed from the rendered page, not from a screen reader. CI checks it on every change. That check found the title bug above.
THIRD_PARTY_NOTICES.mdnamed PDF.js 6.2.108 while 6.3.289 shipped. It is correct now, lists the packages bundled with each component, and a test fails if it drifts from the lockfile again.
Pull requests: #20, #21, #22, #24, #25.
日本語
文書のタイトルを二重に読まなくなりました。見出しの件数は、実際に移動できる見出しの数と一致するようになりました。内部で使うライブラリも最新にしています。また、動作に必要なブラウザを明示しました。
- タイトルを 1 回だけ読みます。 Reader は PDF のタイトルをページの見出しとして表示し、本文の先頭にある同じ見出しは省きます。Word は「表題」スタイルの段落を見出しとしてタグ付けしますが、タイトルの日本語の文字と文字の間に空白があると、この 2 つが一致しませんでした。本文からはその空白が除かれ、タイトルの情報には残っているためです。テスト用の文書では、タイトル「アクセシビリティ検証用文書 その1」が「アクセシビリティ検証用文書その1」としてもう一度読まれていました。今は同じ方法で比べます。
- 見出しの件数が、移動できる見出しの数になりました。 構造の読み取り方の選択欄の件数と、別の読み取り方には見出しがあることを知らせるメッセージは、Reader が表示しないタイトルの見出しまで数えていました。タイトルだけが見出しの読み取り方が、見出し 1 件として案内されることがありました。Markdown 表示でも、
#のタイトルの下に同じタイトルを繰り返さなくなりました。 - 見出しのタグがタイトルだけのタグ付き PDF でも、「構造タグ+推測した見出し」の読み取りを用意できるようになりました。 条件は見出しのタグがない文書と同じで、推測した見出しを作成者の文章の上に置ける場合です。これまでは Word の「表題」の見出しがあるだけで、作成者が見出しを付けた文書として扱い、この読み取りを用意していませんでした。
- Chrome 147 以降が必要になりました(Edge 147。Firefox 144。Firefox 版はまだ公開していません)。同梱の PDF.js は新しい JavaScript の機能を、あるかどうか確かめずに使います。これまでのリリースもすべてそうでした。Chrome 147 からある
Math.sumPreciseがないと、埋め込みフォントの読み込みに失敗し、代わりのフォントから文字を読みます。これは同じ機能がないテスト環境で確認したもので、古いブラウザでは試していません。ほかの機能がない場合に何が起きるかは確認していません。今後、これより古いブラウザには Chrome ウェブストアからインストールも更新もできなくなります。すでにインストールされているものは、ブラウザを更新するまで 0.2.2 のまま動きます。(#23)
変わらないこと:
- PDF.js 6.4.299(これまでは 6.3.289)と pdf-inspector 1.25.2(これまでは 1.25.0)にしました。ToUnicode のないフォントの日本語・中国語を読むための修正は、引き続き当てています。14 の文書をすべての読み取り方で開いて比べ、Reader が示す構造(見出し、リスト、表、図とその文字)が以前と同じであることを確かめています。図の描かれ方はこの比較の対象外で、Chrome ではいくつかの文書で目視したのみです。
- 拡張機能が、インストール後のサイズで 0.45 MB、ダウンロードのサイズで 0.21 MB 小さくなりました(0.2.2 をビルドして比較)。PDF に含まれる JavaScript を実行するための PDF.js のモジュールが、使われないまま同梱されていたので、外しました。これだけでもう少し小さくなり、ライブラリの更新で少し増えた分と差し引きした値です。
まだ変えていないこと: