Skip to content

Add a PDF export service and OSS::PdfExport component - #764

Draft
JulienVannier66 wants to merge 3 commits into
masterfrom
jv/vel-8639/exploration-exports-download-a-real-pdf-file-instead-of-opening-a
Draft

JulienVannier66 wants to merge 3 commits into
masterfrom
jv/vel-8639/exploration-exports-download-a-real-pdf-file-instead-of-opening-a

Conversation

@JulienVannier66

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds what is needed to download content as a real PDF file instead of opening a print page. The first consumer is the side panel of ember-influencer (Creator channels report and Brand safety report).

  • pdf-export service: captures an element with modern-screenshot (SVG foreignObject, so the PDF looks exactly like the design system), splits it into A4 pages between blocks, rasterizes each page at ×2 and assembles them with jsPDF, with an optional footer on every page.
    • Page breaks never cut a block that fits on a page, follow break-before / break-after: page, and split a block taller than a page between its children.
    • jsPDF and modern-screenshot sit in a chunk that is only loaded on the first export.
  • OSS::PdfExport: renders its content and footer blocks off-screen at @width, exports once the content calls ready, then calls @onSuccess or @onError. It fails after @timeout, and cancels the export when it is destroyed.
  • @loading on OSS::ButtonDropdown: a spinner replaces the icon, and the dropdown and the main action are blocked.

Browser workarounds:

  • the Font Awesome 7 alt text in content would print a "/" next to each icon;
  • an image cached without CORS headers is fetched again without cache;
  • the font faces of cross-origin style sheets are fetched in CORS, so icons are embedded (Font Awesome is loaded from S3 without crossorigin);
  • inside a cross-origin iframe without user activation (the Chrome extension), the download is offered in a toast.

Related to: https://linear.app/upfluence/issue/VEL-8639/exploration-exports-download-a-real-pdf-file-instead-of-opening-a
Used by: upfluence/ember-influencer (link added once its PR is open)

What are the observable changes?

Nothing changes on existing screens. In Storybook: a new OSS::PdfExport story, and a loading control on OSS::ButtonDropdown.

Once ember-influencer is bumped, the Print menu of the side panel downloads PDF files (see the ember-influencer PR).

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation with Figma design link. Don't forget to replace "design" by "file" in the URL. For example https://www.figma.com/file/example
  • Migrated touched components to Glimmer Components
  • Properly labeled

@JulienVannier66 JulienVannier66 self-assigned this Dec 3, 2026
@linear-code

linear-code Bot commented Dec 3, 2026

Copy link
Copy Markdown

VEL-8639

This branch has not been deployed

No deployments
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.

1 participant