Repository navigation
Add a PDF export service and OSS::PdfExport component - #764
Draft
JulienVannier66 wants to merge 3 commits into
Draft
JulienVannier66 wants to merge 3 commits into
JulienVannier66 wants to merge 3 commits into
Conversation
This branch has not been deployed
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.
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-exportservice: captures an element with modern-screenshot (SVGforeignObject, 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.break-before/break-after: page, and split a block taller than a page between its children.OSS::PdfExport: renders itscontentandfooterblocks off-screen at@width, exports once the content callsready, then calls@onSuccessor@onError. It fails after@timeout, and cancels the export when it is destroyed.@loadingonOSS::ButtonDropdown: a spinner replaces the icon, and the dropdown and the main action are blocked.Browser workarounds:
contentwould print a "/" next to each icon;crossorigin);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::PdfExportstory, and aloadingcontrol onOSS::ButtonDropdown.Once ember-influencer is bumped, the Print menu of the side panel downloads PDF files (see the ember-influencer PR).
Good PR checklist