[docs] Document tagged PDF generation for MDL-83411 - #1680
Open
junpataleta wants to merge 1 commit into
Open
Conversation
Add a PDF API guide covering the new \core\pdf\document class, which wraps tc-lib-pdf and emits tagged PDF/UA output by default, and add a Moodle 5.3 developer update entry pointing at it. The guide covers creating a document, writing content that tags correctly, the memory cost of the structure tree, font handling and the CLI conversion script that replaces addTTFfont(), the two constants TCPDF and tc-lib-pdf share, and a migration table for plugins currently extending \pdf. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new developer documentation for Moodle 5.3’s tagged (PDF/UA) PDF generation via the new \core\pdf\document wrapper around tc-lib-pdf, plus a 5.3 developer update entry linking to the guide.
Changes:
- Add a new “PDF API” guide describing how to generate tagged/accessible PDFs with
\core\pdf\document, including accessibility rules, fonts, coexistence notes, and migration guidance. - Add a Moodle 5.3 developer update entry announcing the new tagged PDF generation approach and font conversion requirements.
- Add “FPDI” to the cspell project word list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| project-words.txt | Adds “FPDI” to the spellchecker allowlist. |
| docs/devupdate.md | Adds a Moodle 5.3 developer update entry for tagged, accessible PDF generation and links to the new guide. |
| docs/apis/core/pdf/index.md | New PDF API guide for tc-lib-pdf and \core\pdf\document, including migration notes from \pdf/TCPDF. |
Suppressed comments (1)
docs/apis/core/pdf/index.md:232
- The migration table suggests using
send_file()with the string returned bygetOutPDFString(). If the intended pattern is sending raw PDF bytes, this should point tosend_file_content()(or to writing the string to a temp file before callingsend_file()).
| `Output($filename, 'D')` | `getOutPDFString()`, then `send_file()` |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+12
to
+13
| Moodle generates PDF documents using [tc-lib-pdf](https://github.com/tecnickcom/tc-lib-pdf), wrapped by | ||
| the `\core\pdf\document` class. This is the preferred way to create a PDF from Moodle code. |
Comment on lines
+54
to
+55
| $doc->setPDFFilename('coursereport.pdf'); | ||
| send_file($doc->getOutPDFString(), 'coursereport.pdf', 0, 0, true, true, 'application/pdf'); |
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.
Add a PDF API guide covering the new \core\pdf\document class, which wraps tc-lib-pdf and emits tagged PDF/UA output by default, and add a Moodle 5.3 developer update entry pointing at it.
The guide covers creating a document, writing content that tags correctly, the memory cost of the structure tree, font handling and the CLI conversion script that replaces addTTFfont(), the two constants TCPDF and tc-lib-pdf share, and a migration table for plugins currently extending \pdf.