Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [CO-1377] enabled pdf preview on external window #150

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

mbarto
Copy link

@mbarto mbarto commented Feb 17, 2025

This PR adds a couple of configuration property to the PdfPreview, that used together enable the preview to work fine when the preview is shown on a different tab / window than the one running the code (e.g. email open on a distinct tab).

The issues we want to solve:

  • rendering of pdf pages stop when the main carbonio tab is in the background, and this is happening when the preview is invoked from a msg displayer in a separate tab
  • fonts are not properly loaded, because they are loaded in the main carbonio tab, but used by the other tab

The new properties are:

  • target: 'display' or 'print'; print mode uses the same name intent of react-pdf for page rendering (display is the default); this avoids rendering to stop when the main carbonio tab is in the background; to use the intent a custom version of the react-pdf Canvas renderer has been used
  • options: allows setting custom options for the react-pdf Document component (will be used to set a different ownerDocument), so that fonts are loaded in the tab where the preview is shown

@CLAassistant
Copy link

CLAassistant commented Feb 17, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

Failed Quality Gate failed

  • 7.70% Coverage on New Code (is less than 80.00%)

Project ID: carbonio-ui-preview

View in SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants