Skip to content

[docs] Document tagged PDF generation for MDL-83411 - #1680

Open
junpataleta wants to merge 1 commit into
moodle:mainfrom
junpataleta:MDL-83411-pdfUpdates
Open

[docs] Document tagged PDF generation for MDL-83411#1680
junpataleta wants to merge 1 commit into
moodle:mainfrom
junpataleta:MDL-83411-pdfUpdates

Conversation

@junpataleta

Copy link
Copy Markdown
Collaborator

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.

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>
Copilot AI lite review requested due to automatic review settings August 21, 2026 12:23
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 27df875
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a88432cb324e200087cf262
😎 Deploy Preview https://deploy-preview-1680--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@junpataleta junpataleta added the blocked-by-tracker This issue is blocked by an issue in https://tracker.moodle.org/ label Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by getOutPDFString(). If the intended pattern is sending raw PDF bytes, this should point to send_file_content() (or to writing the string to a temp file before calling send_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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-tracker This issue is blocked by an issue in https://tracker.moodle.org/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants