Skip to content

✨(frontend) Can print a doc#1832

Merged
AntoLC merged 5 commits intomainfrom
feat/export-print
Feb 10, 2026
Merged

✨(frontend) Can print a doc#1832
AntoLC merged 5 commits intomainfrom
feat/export-print

Conversation

@AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Jan 26, 2026

Purpose

If we want to print our docs, they are now displayed correctly.

Demo

Enregistrement.2026-01-26.114028.mp4

@AntoLC AntoLC self-assigned this Jan 26, 2026
@AntoLC AntoLC linked an issue Jan 26, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

Size Change: +31 B (0%)

Total Size: 4.2 MB

Filename Size Change
apps/impress/out/_next/static/72b1ad95/_buildManifest.js 831 B +831 B (new file) 🆕
apps/impress/out/_next/static/6187331f/_buildManifest.js 0 B -831 B (removed) 🏆

compressed-size-action

@Ovgodd Ovgodd self-assigned this Feb 2, 2026
@Ovgodd Ovgodd force-pushed the feat/export-print branch from bb87039 to d9c3b8b Compare February 2, 2026 10:28
@AntoLC AntoLC force-pushed the feat/export-print branch 2 times, most recently from 88608a6 to d950526 Compare February 4, 2026 11:52
@AntoLC AntoLC marked this pull request as ready for review February 4, 2026 11:53
@AntoLC AntoLC added the preview label Feb 4, 2026
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🚀 Preview will be available at https://1832-docs.ppr-docs.beta.numerique.gouv.fr/

You can use the existing account with these credentials:

  • username: docs
  • password: docs

You can also create a new account if you want to.

Once this Pull Request is merged, the preview will be destroyed.

@AntoLC AntoLC changed the title ✨Export print #1831 ✨Export print Feb 4, 2026
@AntoLC AntoLC changed the title ✨Export print ✨(frontend) Can print a doc Feb 4, 2026
@AntoLC AntoLC force-pushed the feat/export-print branch from 859c3ae to 5576c01 Compare February 4, 2026 16:22
@AntoLC AntoLC force-pushed the feat/export-print branch from c2979d3 to 1df902a Compare February 5, 2026 12:25
@AntoLC AntoLC force-pushed the feat/export-print branch from 1df902a to b674d65 Compare February 5, 2026 15:51
@socket-security
Copy link

socket-security bot commented Feb 5, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm markdown-it is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/markdown-it@14.1.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/markdown-it@14.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm safer-buffer is 94.0% likely obfuscated

Confidence: 0.94

Location: Package overview

From: ?npm/safer-buffer@2.1.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/safer-buffer@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@AntoLC AntoLC force-pushed the feat/export-print branch 2 times, most recently from 113fa60 to 1a926bb Compare February 6, 2026 08:35
@socket-security
Copy link

socket-security bot commented Feb 6, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedjest@​30.2.01001006991100
Added@​types/​jest@​30.0.01001007781100
Addedclsx@​2.1.11001009480100
Addedts-node@​10.9.29710010082100
Addedeslint-plugin-react@​7.37.59910010083100
Addeduuid@​13.0.010010010084100
Addedeslint-config-prettier@​10.1.810010010088100
Addedwebpack@​5.104.1901009397100
Addedtypescript@​5.9.31001009010090

View full report

@AntoLC AntoLC requested a review from Ovgodd February 6, 2026 08:54
@AntoLC AntoLC removed the experiment label Feb 6, 2026
Copy link
Collaborator

@Ovgodd Ovgodd left a comment

Choose a reason for hiding this comment

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

👍

AntoLC and others added 2 commits February 9, 2026 16:17
We can now print a doc with the native browser
print dialog.
This feature uses the browser's built-in print
capabilities to generate a print preview and
allows users to print directly from the application.
It has as well a powerfull print to PDF feature
that leverages the browser's PDF generation
capabilities for better compatibility and
quality.

Co-authored-by: AntoLC <anthony.le-courric@mail.numerique.gouv.fr>
Co-authored-by: Cyril <c.gromoff@gmail.com>
We added a feature to print documents directly
from the browser. The function is called
`window.print()`, this name collides with Python's
`print()` function. To avoid false positives in our
CI when checking for print statements, we limit
the search to only the backend code.
When trying to print with a embed PDF the
browser's print dialog stays blocked and the user
can't print the document. Changing the PDF block
to use an iframe instead of an embed resolves
this issue.
We harden the security check on url to prevent attacks.
When comparing PDF screenshots, we can have some
minor differences due to the different environments
(OS, fonts, etc.).
To avoid false positives in our regression
tests, we can set a threshold for the number of
different pixels allowed before considering the
test as failed.
If the test fails we will now report the PDF
and the differences to identify quickly
what are the regressions.
@AntoLC AntoLC force-pushed the feat/export-print branch from 1a926bb to 1d8b730 Compare February 9, 2026 15:17
@AntoLC AntoLC merged commit 1d8b730 into main Feb 10, 2026
56 of 61 checks passed
@AntoLC AntoLC deleted the feat/export-print branch February 10, 2026 09:27
@StephanMeijer
Copy link
Collaborator

Seems like a sensible approach. You lose a bit of control versus first converting to Typst and then to PDF, but it gives you a bit more control on the front-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨Export print

3 participants