Repository navigation
Releases
v0.3.2
The Reader now marks each part of a document in the language the document declares for it, and lets you choose a document's language when the file has it wrong — as six of the seven tagged Romanian public PDFs measured do. Text with control characters in it now copies and pastes in full.
What changes for a reader
The language a document is read in
- Parts of a document are marked in their own language (#49). A tagged PDF can declare a language for any heading, paragraph, cell or run of text, and that declaration now reaches the page as
lang, where it differs from the text around it. An English document exported from a Japanese Word — which saysjafor the whole file andenon every run — was read in a Japanese voice from end to end. - Declarations the text cannot bear out are not followed. Word declares a language on every run, and not every declaration is the author's: in the Japanese Word documents measured, digits say English and plain Japanese says Chinese. Marked as declared, a date would be read in three voices. So text with no letters is never marked, Japanese text declared English is not marked English, Han characters declared Chinese inside Japanese are not marked Chinese, and English words declared Japanese are not marked Japanese.
- A document whose every passage declares one language is read in it, when its tags carry most of the page text: the article, the title at the top, and the inferred reading too, which cannot see a passage's language of its own.
- Choose the language of one document, from Document language in the toolbar, in the Reader view (#57, #62). Its first choice, Automatic, says which language that is right now. A language you choose also overrules the file's declarations for its parts, except where the text's writing system shows another language. It is kept for the tab — through a reload — until the tab is closed, when the PDF has an address; nothing about it is synced or kept after that.
- A usual document language, in the settings, off by default (#57). It applies only to a PDF that gives no language beyond the one declared for the whole file, or none at all, and only when the text is written in that language's alphabet. Where the file's language uses the same alphabet —
en-USover what may be Romanian — or the file declares none and the usual language is written in the Latin alphabet, the text must also show letters the usual language has and English does not: ă, ș, ț for Romanian. A language without such letters cannot overrule a declaration in its own alphabet. Measured with Romanian as the usual language, on ten Romanian public PDFs: eight of the nine whose declaration was wrong or missing were read as Romanian; the ninth declares languages for its parts and keeps them. All six English test documents stayed English. - Document information says which language the Reader uses, and why ("Read as"): the PDF's declaration, detection, the structure tags, your usual language, or your choice. The "Language" row beside it is still the PDF's own value.
- The Reader's own words inside a document keep the interface's language: a link's "opens in a new tab", a figure's notice, a page label. Inside a paragraph marked English, a Japanese notice was read in an English voice.
Checked with NVDA on Windows, with automatic language switching on: in Firefox and Chrome, the English Word document above is read in English (in Chrome, its title and the inferred reading too), and a Japanese Word press release stays Japanese through its dates and figures, switching only for its English words. In Chrome, choosing Romanian for a Romanian PDF declared en-US reaches NVDA as a switch to Romanian, and the choice survives a reload; this was checked with the choice in Document information, before it moved to the toolbar (#64). The toolbar control itself was checked on screen only, at narrow window widths. The choice and the usual language were also checked on screen in Firefox. Not heard in a Romanian voice: the machine had none.
Copying text
- Control characters no longer cut a copy short (#51, #53). A Word document whose logos' alternative text ended in a NUL character pasted only its first few lines from "Copy Markdown", because the Windows clipboard ends text at a NUL. Control characters are now removed from everything the Reader shows — body text, headings, tables, captions, alternative text, the title — and from the Markdown view, as shown and as copied. Line breaks and tabs are kept.
- The Markdown view follows the interface language when it is switched with the view open.
Firefox
- The view switch's list is readable in the light theme (#55). The highlighted entry was dark text on a dark background.
Not changed yet
- A PDF whose only language declaration is wrong is read in that language until you choose another. Detecting the language from the text (#56) and recognising a Japanese document declared English (#54) are not done.
- Bullets drawn from the Symbol or Wingdings font show as a box, beside the list's own marker; with NVDA in Chrome, one such document was heard reading them as an extra bullet (#59).
- In some fonts, the inferred reading loses the letters "ti" where the font draws them as one glyph (#60).
- The interface is in English and Japanese only (#61).
Under the hood
- Each run of text keeps what the file declared for it apart from the language it is shown in, so a document can be settled again when its language changes.
- One function decides a document's language and where it came from (
chooseDocumentLanguages), for every reading. - The usual document language is one more setting in the browser's sync storage; the per-document choice is in the Reader tab's session storage, with the document's address, until the tab closes.
Pull requests: #50, #51, #53, #55, #58, #64.
日本語
文書の各部分に、その文書が宣言している言語を付けるようにしました。ファイルの言語の宣言が誤っているときは、利用者が文書の言語を選べるようになりました。手元で測ったルーマニア語の公開 PDF のうち、構造タグ付きの 7 個では、6 個の宣言が誤っていました。また、制御文字を含む文書も、最後までコピーして貼り付けられるようになりました。
文書を読む言語
- 文書の各部分に、その部分の言語を付けるようにしました(#49)。構造タグ付きの PDF は、見出し、段落、表のセル、文中の一部分ごとに言語を宣言できます。その宣言を、周りと言語が違う部分にだけ
langとして付けます。日本語版の Word で書き出した英語の文書は、文書全体をja、各部分をenと宣言しています。これまでは、最初から最後まで日本語の音声で読まれていました。 - 文字と矛盾する宣言には従いません。 Word は文中のすべての部分に言語を宣言しますが、その全部が作成者の意図とは限りません。測った日本語の Word 文書では、数字に英語が、普通の日本語に中国語が宣言されていました。宣言どおりに付けると、日付が 3 つの音声で読まれます。そこで、文字(字母)を含まない部分には付けず、英語と宣言された日本語の文や、日本語の中で中国語と宣言された漢字、日本語と宣言された英字の語にも付けません。
- 文書のすべての部分が同じ言語を宣言していれば、その言語で読みます。 構造タグがページの文字の大部分を覆っている場合に限ります。記事全体、上部の題名、推測の読み取り(部分ごとの言語がわからない読み取り方)も、その言語になります。
- 文書ごとに言語を選べるようになりました(#57、#62)。ツールバーの「文書の言語」から選べます(リーダーの表示のとき)。最初の選択肢の「自動」には、今使っている言語が表示されます。言語を選ぶと、ファイル側の部分ごとの宣言も使わなくなります。ただし、文字の種類で明らかに別の言語とわかる部分は残します。選んだ言語は、PDF にアドレスがあれば、再読み込みしてもタブを閉じるまで使います。同期はせず、タブを閉じたあとには残りません。
- 設定に「よく読む文書の言語」を加えました(#57)。既定は「自動」で、何も変わりません。当てるのは、文書全体の宣言のほかに言語の手がかりがない PDF と、宣言のない PDF だけで、本文がその言語の文字で書かれている場合に限ります。ファイルの言語が同じ文字を使う場合(たとえば
en-USと宣言された、ルーマニア語かもしれない文書)と、宣言がなく、よく読む文書の言語が英字の言語の場合は、その言語特有の文字(ルーマニア語なら ă、ș、ț)が本文にあることも条件です。そうした文字のない言語では、同じ文字を使う言語の宣言を上書きできません。ルーマニア語を設定して、ルーマニア語の公開 PDF 10 個で測りました。宣言が誤っているかない 9 個のうち 8 個がルーマニア語になりました。残る 1 個は部分ごとに言語を宣言しているので、その宣言のままです。英語のテスト用文書 6 個は、すべて英語のままでした。 - 「文書情報」に、Reader が使っている言語と、その理由を表示します(「読み上げの言語」)。理由は、PDF の宣言、推定、構造タグ、よく読む文書の言語、利用者の指定のいずれかです。隣の「言語」の行は、これまでどおり PDF 自身の宣言です。
- 文書の中にある Reader 自身の言葉は、画面の言語で伝えます。 対象は、リンクの「新しいタブで開きます」、図の注記、ページ番号です。これまでは、英語と宣言された段落の中の日本語の注記が、英語の音声で読まれていました。
Windows の NVDA で、言語の自動切り替えをオンにして確かめました。Firefox と Chrome の両方で、上の英語の Word 文書は英語で読まれました(Chrome では、題名と推測の読み取りも確かめています)。日本語の Word の報道発表は、日付や数字も日本語のまま読まれ、英字の語のところだけ英語に切り替わりました。Chrome では、en-US と宣言されたルーマニア語の PDF でルーマニア語を選ぶと、NVDA にルーマニア語への切り替えが伝わり、再読み込み後も選択が残りました。これは、一覧がツールバーに移る前(#64 の前)に、「文書情報」から選んで確かめたものです。ツールバーの一覧そのものは、画面の幅を狭めたときの表示を確かめただけです。文書ごとの指定とよく読む文書の言語は、Firefox でも画面で確かめています。ルーマニア語の音声では聞いていません。確かめたパソコンに、ルーマニア語の音声がなかったためです。
テキストのコピー
- 制御文字のところでコピーが途切れなくなりました(#51、#53)。ロゴの代替テキストが NUL という制御文字で終わっている Word の文書では、「マークダウンをコピー」で貼り付けると、最初の数行しか入りませんでした。Windows のクリップボードは、NUL で文が終わったものとみなすためです。今後は、本文、見出し、表、図の説明、代替テキスト、題名など、Reader に表示するすべての文字と、マークダウン表示(表示もコピーも)から制御文字を取り除きます。改行とタブは残します。
- マークダウン表示を開いたまま表示言語を切り替えると、マークダウンも新しい言語になります。
Firefox
- ライトテーマで、「表示」の一覧が読めるようになりました(#55)。選択中の項目が、暗い背景に暗い文字で表示されていました。
まだ変えていないこと:
- PDF の言語の宣言が誤っていて、ほかに手がかりがない場合は、利用者が選ぶまでその言語で読みます。 本文から言語を推定すること(#56)や、英語と宣言された日本語の文書を見分けること(#54)は、まだできません。
- Symbol や Wingdings のフォントの箇条書き記号は、四角で表示されます。 箇条書き本来の記号と並んで表示されます。NVDA と Chrome で 1 つの文書を聞いたところ、記号が余分に読まれていました(#59)。
- 一部のフォントでは、推測の読み取りで「ti」の文字が抜けます。 フォントが「ti」を 1 つの字形で描いている場合です(#60)。
- 画面の表示言語は、英語と日本語だけです(#61)。
v0.3.1
Text that put two sentences side by side now joins them the way each language does, and the Japanese interface no longer points to tabs that do not exist.
What changes for a reader
- "…they wrote. 6 headings." In English, each reading in 「構造の読み取り方」 ("How the structure was read") had its heading count run into its description: "…any alternative text they wrote.6 headings." That text is also the radio's description, so it was built to be read out that way as well. There is now a space.
- No stray space after 「。」 in Japanese. Five places joined two sentences with a space, which is right in English and not in Japanese:
- the settings' on-device AI section when the model is unavailable: 「この端末では利用できません。このブラウザは…」
- the notice that pages need OCR
- the Markdown view's choice between the Reader's content and the parser's raw output
- the language note in the image-description panel
- the OCR panel's note when no OCR engine is available
- The Japanese interface names the views as you choose them. Three messages pointed to 「オリジナルタブ」 or 「リーダータブ」, but the views are chosen in the 「表示」 menu, not tabs. They now say 「「表示」で「オリジナル」を選ぶと…」 and 「「表示」で「リーダー」を選ぶと…」. The English already said "the Original view".
- Punctuation in the image-description panel. In Japanese, the per-image results and the language note used an ASCII colon, 「失敗: …」; they use 「:」 now. In English, the language note is now a sentence of its own: "(This document's language: ja.)" where it was "(this document's language: ja)".
- "Finished analysing the PDF (3 pages)." The English status line read "Finished analysing the PDF. 3 pages." In some typefaces, including the one it was noticed in, the full stop sits under the arm of the F and almost disappears; and "3 pages." is not a sentence. The Japanese, 「PDF の解析が完了しました。3 ページ。」, is unchanged.
These are covered by tests: some render the text in both languages, and a scan of the code finds any sentences still joined by a literal space. Each fails on the previous version. They have not been looked at in a browser or listened to with a screen reader.
Under the hood
- Sentences are joined by one function in the message catalogue, with a space in English and none in Japanese, and a test checks that every message joined this way is a whole sentence.
- Another test scans the code for messages joined by a literal space, so the next one is found without a reviewer.
Pull request: #46.
日本語
2 つの文を並べて表示しているところで、文と文を言語に合ったつなぎ方にしました。日本語の画面で、存在しないタブを案内することもなくなりました。
- 英語の「…they wrote. 6 headings.」 英語の画面の「構造の読み取り方」で、各選択肢の説明文のすぐ後ろに見出しの件数が空白なしで続き、「…they wrote.6 headings.」となっていました。この文はラジオボタンの「説明」でもあるため、読み上げでもそのまま読まれる作りでした。空白を入れました。
- 日本語で、句点のあとに余計な空白が入らなくなりました。 次の 5 か所で、2 つの文を空白でつないでいました。英語では正しいつなぎ方ですが、日本語では不要です。
- 設定の「端末内 AI」で、モデルが使えないときの説明(「この端末では利用できません。このブラウザは…」)
- OCR が必要なページの案内
- マークダウン表示で、リーダーの内容か解析器の生出力かを選ぶところ
- 画像の説明パネルの、説明の言語についての注記
- OCR エンジンがないときの、OCR パネルの注記
- 表示の切り替え方を、実際の画面どおりに案内します。 3 つのメッセージが「オリジナルタブ」「リーダータブ」を案内していましたが、表示は「表示」のメニューで選ぶもので、タブはありません。「「表示」で「オリジナル」を選ぶと…」「「表示」で「リーダー」を選ぶと…」と書くようにしました。英語の画面は、もともと「the Original view」と書いていました。
- 画像の説明パネルの句読点。 日本語では、画像ごとの結果と、言語についての注記で半角のコロン(「失敗: …」)を使っていたのを、全角の「:」にしました。英語では、言語についての注記を「(this document's language: ja)」から、それだけで 1 つの文になる「(This document's language: ja.)」にしました。
- 英語の状態表示「Finished analysing the PDF (3 pages).」 これまでは「Finished analysing the PDF. 3 pages.」でした。気づいたときの書体を含め、一部の書体では、ピリオドが F の横棒の下に入り込んでほとんど見えません。また「3 pages.」だけでは文になっていませんでした。日本語の「PDF の解析が完了しました。3 ページ。」は変えていません。
これらはテストで確かめています。英語と日本語の両方で画面の文字を確かめるテストと、文を決め打ちの空白でつないでいる箇所をソースから探すテストで、どれも前のバージョンでは失敗します。ブラウザで見ての確認と、スクリーンリーダーで聞いての確認はしていません。
v0.3.0
Accessible PDF View is now on Firefox Add-ons as well as the Chrome Web Store, and this version fixes what reading it in Firefox showed: a Japanese interface announced as English, and settings that do nothing there. Radio buttons are now named by their label alone.
What changes for a reader
Firefox
- Accessible PDF View is on Firefox Add-ons, for Firefox 144 or later on desktop: https://addons.mozilla.org/firefox/addon/accessible-pdf-view/ . 0.2.4 was the first version listed there; from this one on, each version is submitted to both stores, and each store publishes it after its own review.
- A Japanese interface is no longer announced as English. With NVDA, 「英語」 came before the Reader's Japanese text, as in 「リンク 英語 本文へスキップ」. Firefox tells screen readers the language an element had when it was created, and the page started out English and was switched afterwards. Its language is now set before the page is built, and switching it in the settings recreates the interface in the new language. This was checked in Firefox on Windows by reading the language each element reports, before and after switching, and by listening with NVDA to the top of the Reader and the structure picker. (#40)
- Settings that do nothing in Firefox are left out. Firefox has no on-device model an extension can use, so the Reader cannot generate image descriptions or run OCR there. The 「AI が生成する文章の言語」 setting, and the note under 「構造の読み取り方」 about generated results, no longer appear in Firefox. In Chrome they appear as before, on any machine. (#32, #38)
Every browser
- Each radio button is named by its label alone. In 「構造の読み取り方」 and in the settings, the explanation under each choice used to be part of the radio's name. The whole paragraph was spoken every time the radio was reached, and NVDA announced it as clickable. The explanation is now the radio's description, still shown on screen. With NVDA in Firefox it is read after the name when the radio has focus; how often a description is spoken varies between screen readers, and the settings panel's radios were not listened to. Clicking the explanation no longer selects the radio; clicking its name does. (#34)
- Switching the interface language rebuilds the Reader's interface, so that the new language reaches screen readers (see #40 above). OCR that is still running at that moment is stopped, and an image-description run may be; what either had already finished is kept. (#40)
- The document's title keeps the document's language. The page heading is the PDF's own title when it has one. It now carries the language the PDF declares, as the text below it does, so a Japanese title read with the interface in English is still marked Japanese. A title taken from the file name follows the interface, as before. (#42)
- PDF.js 6.5.438 (was 6.4.299). A tagged PDF whose structure tree has no ParentTree now offers its tagged readings. Until now such a file could only be read by inference. This was measured on 16 documents, each opened with every reading preference: the structure the Reader exposes is the same as before, and every image decodes to the same pixels.
Not changed yet
- In Firefox, the Reader's static content is exposed as clickable (#33). With TalkBack it is announced as something to double-tap. With NVDA on Windows, the paragraphs and headings were not announced as clickable; 「クリック可能」 was heard once, as focus entered the page, which is probably this cause.
- When the interface language is switched with a page open, the page's own name keeps the old language until the page is reopened. Everything inside the Reader follows the switch.
Under the hood
- The release workflow submits each tagged version to Firefox Add-ons as well as the Chrome Web Store, from separate jobs with separate credentials. The notes for Mozilla's reviewers travel with every version.
ACCESSIBILITY.mdstates what the project aims for, what has been checked with which assistive technology, and how to report a barrier, with a form for it.
Pull requests: #32, #35, #36, #37, #38, #39, #41, #43, #44.
日本語
Accessible PDF View を、Chrome ウェブストアに加えて Firefox アドオンでも公開しました。このバージョンでは、Firefox で使ってみてわかった問題を直しています。日本語の画面が英語として読み上げられること、Firefox では働かない設定が表示されることの 2 つです。ラジオボタンの名前も、短い名前だけにしました。
Firefox
- Firefox アドオンで公開しています。 デスクトップ版の Firefox 144 以降が必要です(https://addons.mozilla.org/firefox/addon/accessible-pdf-view/ )。Firefox アドオンに最初に掲載したのは 0.2.4 で、このバージョンからは、両方のストアに同じバージョンを提出します。公開されるのは、それぞれのストアの審査が終わってからです。
- 日本語の画面が「英語」として読み上げられなくなりました。 NVDA では、Reader の日本語の文字の前に「英語」と付き、「リンク 英語 本文へスキップ」のように読み上げられていました。Firefox は、要素が作られたときの言語をスクリーンリーダーに伝えます。Reader のページは英語として作られ、そのあとで日本語に切り替えていたので、この問題が起きていました。今後は、ページを作る前に言語を決めます。設定で言語を切り替えたときは、画面をその言語で作り直します。Windows の Firefox で、各要素がどの言語として伝わっているかを、切り替えの前後で読み取って確かめました。NVDA では、Reader の上のほうと「構造の読み取り方」を聞いて確かめています。(#40)
- Firefox では働かない設定を表示しなくなりました。 Firefox には拡張機能から使える端末内の AI モデルがないため、画像の説明も OCR も使えません。そこで Firefox では、「AI が生成する文章の言語」の設定と、「構造の読み取り方」の下にある生成結果についての注記を表示しなくなりました。Chrome では、どのパソコンでもこれまでどおり表示します。(#32、#38)
すべてのブラウザー
- ラジオボタンの名前を、短い名前だけにしました。 「構造の読み取り方」と設定画面では、各選択肢の下にある説明文までがラジオボタンの名前に含まれていました。そのため、ラジオボタンに移るたびに説明文全体が読み上げられ、NVDA は説明文を「クリック可能」と伝えていました。今後は、説明文はラジオボタンの「説明」として伝わり、画面にもこれまでどおり表示します。Firefox と NVDA では、ラジオボタンにフォーカスすると、名前のあとに説明文が読まれます。説明をどこまで読むかは読み上げソフトによって違い、設定画面のラジオボタンは聞いて確かめていません。説明文をクリックしてもラジオボタンは選ばれなくなりました。名前をクリックすれば選べます。(#34)
- 表示言語を切り替えると、Reader の画面を作り直します。 新しい言語をスクリーンリーダーに伝えるためです(上の #40 を参照)。その時点で実行中の OCR は止まり、画像の説明も止まることがあります。それまでに終わった分は残ります。(#40)
- 文書の題名に、文書自身の言語を付けるようにしました。 ページの見出しには、PDF に題名があればそれを使います。この見出しに、本文と同じく PDF が宣言している言語を付けるようにしました。表示言語を英語にしていても、日本語の題名は日本語として伝わります。ファイル名を題名にしている場合は、これまでどおり画面の言語に従います。(#42)
- PDF.js 6.5.438(これまでは 6.4.299)にしました。ParentTree のない構造タグ付き PDF でも、構造タグによる読み取りを選べるようになりました(これまでは推測による読み取りだけでした)。16 の文書をすべての読み取り方で開いて比べ、Reader が示す構造と、画像の中身が以前と同じであることを確かめています。
まだ変えていないこと:
- Firefox では、Reader の静的な内容がクリック可能として伝わります(#33)。TalkBack では「ダブルタップして有効」と読み上げられます。Windows の NVDA では、段落や見出しは「クリック可能」と読まれませんでした。ページにフォーカスが入ったときに一度だけ「クリック可能」と聞こえ、これはおそらくこの原因によるものです。
- ページを開いたまま表示言語を切り替えると、ページそのものの名前は、開き直すまで前の言語のままです。Reader の中の要素は、切り替えた言語に従います。
v0.2.4
Small figures the author described are now shown as pictures, and a figure whose alternative text is empty is no longer treated as one the author marked decorative.
What changes for a reader
These apply to PDF の構造タグ (the tagged reading), and to the combined reading built on it.
- A small figure the author described is shown as a picture. Until now a tagged figure under 24pt on a side was never shown; the notice took its place. Now, if the author wrote alternative text for it, it is shown however small it is, unless it is under 2pt on its thinner side, like a rule. In the flyer from #12, that is six icons, all with the author's alternative text: each of its 14 figures is now located for a picture, where 8 were, and the six icons were seen on screen in Chrome. (#15)
- A small figure is drawn finer than other figures, aiming for 48 pixels on its shorter side, so an icon can be made out instead of being 20 pixels across. A thin, wide figure is capped at 1200 pixels on its longer side. An icon that was embedded as a tiny bitmap stays coarse: drawing it finer cannot add detail it does not have.
- What a sighted reader sees changes for those figures. The notice 「画像: アイコン:PDF」 used to be on screen; now the picture is, and the author's words are in its alternative text, read by screen readers but not drawn. That is how the Reader has always treated an author's text when the image is shown (see #17).
- A small figure without the author's own words keeps the notice, as before. Size alone does not tell a small icon from a fragment of a larger drawing.
- An empty alternative text is no longer announced as decorative. Since 0.2.2, a figure whose
/Altwas present but empty was read as the author marking it decorative: where no image was shown, the Reader said 「装飾的な画像です。内容はありません。」, and where the image was shown, it said nothing, and screen readers skipped the image. In what was measured, Word and PowerPoint for Microsoft 365 do not use it that way: both leave a picture the author marked Decorative out of the structure altogether, and PowerPoint writes an empty/Altfor a shape the author gave no alternative text at all. Such a figure now gets the same notice as one with no/Alt, 「作成者による代替テキストはありません」, whether or not its image is shown, and where it is large enough to show, it can be offered for an AI description again. (#27) - PowerPoint's 「(グループ化されたオブジェクト)」 is removed from a group's alternative text. PowerPoint appends it when it exports a group, and the Reader showed it as part of the author's words. Only the Japanese form has been seen, and only it is removed. (#28)
Not changed yet
- A small figure is cropped by its rectangle, so anything else drawn inside that rectangle shows too. None did in the documents it was checked on, in Chrome; the lasting fix is to draw only the figure's own content.
- In the Word for Microsoft 365 build measured, an icon placed in the middle of a sentence is tagged as coming after the paragraph, so the sentence is read first and the icon after it.
Under the hood
- A Word document and a PowerPoint deck written for this project, each exported as a tagged PDF, are in the repository with the expectations they are checked against, so these cases are tested on every change.
日本語
作成者が代替テキストを付けた小さな図を、画像として表示するようになりました。代替テキストが空の図を、作成者が装飾と指定した図として扱うこともなくなりました。
以下は「PDF の構造タグ」と、それをもとにした「構造タグ+推測した見出し」の読み取りでの変更です。
- 作成者が代替テキストを付けた小さな図を、画像として表示します。 これまで、縦か横が 24pt に満たないタグ付きの図は画像を表示せず、メッセージを出していました。今後は、作成者が代替テキストを付けていれば、大きさに関係なく表示します。ただし、罫線のように細い側が 2pt に満たないものは除きます。#12 のフライヤーでは、どれも作成者の代替テキストがある 6 件のアイコンが該当し、画像を切り出せる図は 14 件中 8 件から 14 件すべてになりました。6 件のアイコンが画像で表示されることは、Chrome で確かめています。(#15)
- 小さな図はほかの図より細かく描き、短い辺を 48 ピクセル程度にします。20 ピクセルほどの大きさでは、何の絵か見分けにくいためです。細長い図は、長い辺を 1,200 ピクセルまでに抑えます。もともと小さな画像として埋め込まれているアイコンは、細かく描いても粗いままです。
- **これらの図では、画面の見え方が変わります。**これまで画面に出ていた「画像: アイコン:PDF」のようなメッセージの代わりに画像を表示し、作成者の文は画像の代替テキストになります。スクリーンリーダーでは読み上げられますが、画面には表示しません。画像を表示するときの作成者の文の扱いは、これまでと同じです(#17)。
- 作成者自身の文がない小さな図は、これまでどおりメッセージを表示します。大きさだけでは、小さなアイコンと、大きな図の一部を見分けられないためです。
- 空の代替テキストを、装飾の指定として伝えなくなりました。 0.2.2 から、
/Altがあって中身が空の図を、作成者が装飾と指定したものとして扱っていました。画像を表示しない図では「装飾的な画像です。内容はありません。」と表示し、画像を表示する図では何も伝えず、スクリーンリーダーも画像を読み飛ばしていました。確認した範囲では、Microsoft 365 の Word と PowerPoint は、空の/Altをその意味で使っていません。作成者が装飾と指定した画像は、どちらも文書の構造から外しています。また PowerPoint は、代替テキストを設定していない図形に空の/Altを書き出します。今後はこうした図も、画像を表示するかどうかにかかわらず、/Altのない図と同じく「作成者による代替テキストはありません」と伝え、表示できる大きさのものは AI による説明の対象にもなります。(#27) - PowerPoint がグループの代替テキストに足す「(グループ化されたオブジェクト)」を取り除きます。 PowerPoint はグループを書き出すときにこの文言を足しますが、Reader はそれを作成者の文の一部として表示していました。確認できたのは日本語の文言だけで、取り除くのもその文言だけです。(#28)
まだ変えていないこと:
- 小さな図は四角形で切り出すため、その範囲に描かれているほかのものも写ります。確認した文書では Chrome で見て写り込みはありませんでしたが、根本的には、図そのものの内容だけを描く必要があります。
- 確認した Microsoft 365 の Word では、文の途中に置いたアイコンが、段落の後ろにあるものとしてタグ付けされます。そのため、文を読んだ後にアイコンが続きます。
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 のモジュールが、使われないまま同梱されていたので、外しました。これだけでもう少し小さくなり、ライブラリの更新で少し増えた分と差し引きした値です。
まだ変えていないこと:
v0.2.2
Figures in the tagged reading now show their own picture, and the notice under a figure says what is actually known about it.
What changes for a reader
These apply to PDF の構造タグ (the tagged reading), and to the combined reading built on it.
-
Each figure shows its own part of the page. Many PDFs wrap each figure in a page-sized clip. Both InDesign and PowerPoint exports do this, and it is ordinary, valid PDF. The Reader counted that clip as part of the figure, so it showed the whole page in the figure's place, repeated once for every such figure. Measured on two documents: in a flyer, 6 of 14 figures showed the whole page; in a PowerPoint-exported notice, 6 of 29. Neither has any now. (#12)
-
A figure no longer shows another figure's picture. A tagged figure too small to crop could be matched by drawing order to an image nearby. Two small icons in the flyer showed two logos, and in the notice a thin rule and a small piece of lettering showed two other pictures. They now keep their notice instead.
-
A picture drawn larger than its frame is cropped to the frame. A code in the flyer is drawn as a large square cut down by its frame. Its crop ran 80pt below the page and was mostly empty; it is now the visible frame.
-
The notice under a figure without alternative text says what is known. It used to be 「画像があります。代替テキストを取得できませんでした。」 for every such figure. In the tagged reading:
- an image with no
/Alt: 「画像があります。作成者による代替テキストはありません。」 - a figure too small to crop, which shows no image: 「図としてタグ付けされていますが、小さいため画像は表示していません。作成者による代替テキストはありません。」
- an empty
/Alt (), the author marking the figure decorative: 「装飾的な画像です。内容はありません。」 It is no longer offered for an AI description.
The inferred reading cannot see
/Alt, so it keeps the old sentence, which is accurate there. (#14) - an image with no
Not changed yet
- A figure under 24pt on a side is still not shown as an image. In the flyer that is six icons, all with the author's alternative text. Where to draw that line is #15.
- An author's alternative text is read by screen readers but not drawn on screen or in print when the image is shown. #17.
Under the hood
- The figure locator now follows clipping through saving and restoring the graphics state and through form XObjects. It measures against the page's own box, so a page turned with
/Rotateor with a crop box away from the corner is measured in the right place.
日本語
構造タグの読み取りで、図がそれぞれ自分の画像を表示するようになりました。図の下のメッセージも、分かっていることをそのまま伝えるようにしました。
以下は「PDF の構造タグ」と、それをもとにした「構造タグ+推測した見出し」の読み取りでの変更です。
-
図ごとに、その図の部分だけを表示します。 多くの PDF では、図がページと同じ大きさの「クリップ」で囲まれています。InDesign や PowerPoint で書き出した PDF もそうで、規格どおりの普通の作りです。これを図の一部として数えていたため、図の場所にページ全体の画像が図の数だけ繰り返し表示されていました。2 つの文書で測ったところ、ページ全体が表示されていたのは、フライヤーで 14 件中 6 件、PowerPoint で書き出したお知らせで 29 件中 6 件でした。どちらも今は 0 件です。(#12)
-
ほかの図の画像を表示しなくなりました。 切り出すには小さすぎる図に、描かれた順番で近くの画像が割り当てられることがありました。フライヤーでは小さなアイコン 2 件に 2 つのロゴが、お知らせでは細い線と小さな文字の 2 件に別の画像が表示されていました。今はメッセージのみを表示します。
-
枠より大きく描かれた図は、枠の大きさで切り出します。 フライヤーのコードは、大きな四角形を枠で切り抜いて描かれています。これまでは切り出し範囲がページの下 80pt まで広がって大半が空白でしたが、今は見えている枠の大きさで表示します。
-
代替テキストのない図のメッセージを、分かっていることに合わせました。 これまでは一律に「画像があります。代替テキストを取得できませんでした。」でした。構造タグの読み取りでは次のようになります。
/Altのない画像:「画像があります。作成者による代替テキストはありません。」- 小さすぎて画像を表示しない図:「図としてタグ付けされていますが、小さいため画像は表示していません。作成者による代替テキストはありません。」
- 作成者が空の
/Alt ()で装飾と指定した図:「装飾的な画像です。内容はありません。」 AI による説明の対象にもなりません。
レイアウトからの推測では
/Altを読めないため、これまでの文言のままです。そちらでは事実どおりの文です。(#14)
まだ変えていないこと:
v0.2.1
A maintenance release: the layout analyser moves up two versions, still carrying the fix from 0.2.0.
What changes for a reader
-
The analyser behind the inferred reading is pdf-inspector 1.25.0 (was 1.23.0), with the fix for Japanese and Chinese text in fonts without a ToUnicode map still applied. It brings upstream's fixes, among them:
- text a PDF shows with the
"operator is no longer missing from the inferred reading; - two lines of very small type set close together are no longer merged into one line of interleaved words;
- a page drawn from many thin lines or rectangles no longer takes very long to analyse (upstream measured a page of about 200,000 from about 40 s to under 0.5 s).
On the ten documents the extension is tested against, the inferred reading comes out exactly as it did with 0.2.0.
- text a PDF shows with the
-
ビューアー is spelled one way in the Japanese interface. The note about a PDF that does not declare itself Tagged PDF said ビューア, next to the setting 「PDF を開くビューアー」.
Under the hood
- The mirror of pdf-inspector's result type is held to the package's own declaration at compile time, at every level, so the next change there fails the build instead of going unnoticed.
- Every pull request and push to main is type-checked, tested and built. Release notes are published from
releases/<tag>.md— this is the first.
Pull requests: #5, #6, #8, #9, #10.
日本語
保守のための版です。レイアウトの解析に使うライブラリを 2 つ新しい版に上げました。0.2.0 の修正はそのまま含んでいます。
-
推測の読み取りに使う pdf-inspector を 1.25.0 にしました(これまでは 1.23.0)。ToUnicode のないフォントの日本語・中国語を読むための修正は、引き続き当てています。上流での修正には、次のようなものがあります。
"演算子で描かれた文字が、推測の読み取りから抜け落ちなくなりました。- 間隔の狭いとても小さな文字の 2 行が、1 行に混ざって読まれなくなりました。
- 細い線や四角形を大量に使って描かれたページの解析に、長い時間がかからなくなりました(上流の測定では、約 20 万個のページが約 40 秒から 0.5 秒未満に)。
拡張機能の試験に使っている 10 件の文書では、推測の読み取りの結果は 0.2.0 とまったく同じです。
-
日本語の画面で「ビューアー」の表記をそろえました。 Tagged PDF の宣言がない PDF についての注記が「ビューア」と書いていて、隣の設定「PDF を開くビューアー」と食い違っていました。
v0.2.0
Prompted by #1, with thanks to its reporter: a PDF whose structure tags were ignored, and whose Japanese text read as noise.
What changes for a reader
- Structure tags are read even when the PDF does not declare itself Tagged PDF. Some PDFs carry a complete structure tree but leave out the
/MarkInfo /Marked truedeclaration the standard requires. Until now the Reader ignored such a tree and inferred the structure from the layout. It now reads the author's tags — headings, reading order, alternative text — provided they carry at least half of the text on the pages, since without the declaration nothing says the tree is the whole document. - The document information panel says when a PDF does not conform. For such a PDF, "Structure tags" reads Yes, but not declared as Tagged PDF, and a note explains that ISO 32000 and PDF/UA require the declaration, so other viewers and assistive technology may not use the tags.
- The panel no longer says a tagged PDF has no tags. Switching a tagged PDF to the inferred reading used to show the note for untagged PDFs. That note now appears only for a PDF with no structure tree.
- Japanese and Chinese text in fonts without a ToUnicode map is read. In the inferred reading and the Markdown view, text set in CID fonts that rely on their character collection came out as noise and the page was flagged for OCR. (Korean already read correctly.) It now reads as it does in other PDF readers, characters outside the BMP included.
Under the hood
- pdf-inspector is a patched build of 1.23.0 (
1.23.0-apv.2) invendor/pdf-inspector-wasm/, carrying the fix offered upstream as firecrawl/pdf-inspector#594. Its README records the source commit, build command and hash, and when it goes: once a pdf-inspector release on npm has the fix. - pdf-inspector's licence, with the notice for the Adobe CMaps its binary embeds, now ships in the extension as
pdf-inspector/LICENSE. Earlier builds shipped the binary without it. - A release workflow builds, tests and submits the extension to the Chrome Web Store from a version tag.
日本語
#1 の報告をきっかけにした版です。構造タグが使われず、日本語が文字化けしていた PDF を報告してくださった方に感謝します。
- Tagged PDF の宣言がない PDF でも、構造タグを読むようになりました。 構造ツリーがあっても、規格が求める
/MarkInfo /Marked trueの宣言がない PDF があります。これまではそのツリーを使わず、レイアウトから構造を推測していました。今後は作成者のタグ(見出し、読み順、代替テキスト)を読みます。ただし、宣言がない以上、ツリーが文書全体だとは限らないため、ページの文字の半分以上をタグが含んでいる場合に限ります。 - 規格に沿っていないことを文書情報パネルに表示します。 そのような PDF では「構造タグ」が あり(Tagged PDF の宣言なし) となり、ISO 32000 と PDF/UA が求める宣言がないため、ほかのビューアや支援技術ではタグが使われないことがある、という注記が出ます。
- タグ付きの PDF を「タグなし」と表示しなくなりました。 タグ付きの PDF を推測の読み取りに切り替えると、タグのない PDF 向けの注記が出ていました。この注記は、構造ツリーのない PDF でだけ出るようにしました。
- ToUnicode のないフォントの日本語・中国語を読めるようになりました。 推測の読み取りと Markdown 表示で、文字の対応を文字集合に頼る CID フォントの文字が文字化けし、ページが OCR 対象と判定されていました(韓国語はもともと読めていました)。今後は、ほかの PDF リーダーと同じように読めます。BMP 外の文字も含みます。
- 内部的には、pdf-inspector を 1.23.0 に修正を当てた版(
1.23.0-apv.2)に差し替えています。修正は上流に firecrawl/pdf-inspector#594 として提案済みで、修正を含む版が npm に出たら正規版に戻します。pdf-inspector のライセンス文(埋め込まれた Adobe CMap の告知を含む)も、拡張機能に同梱するようになりました。