Skip to content

Refactor Loading of NutrientPDF SDK - #1374

Merged
ronaldo-macapobre merged 5 commits into
masterfrom
update-nutrient-cdn
Oct 14, 2026
Merged

ronaldo-macapobre merged 5 commits into
masterfrom
update-nutrient-cdn

Conversation

@ronaldo-macapobre

@ronaldo-macapobre ronaldo-macapobre commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

A bug was raised by the client where changing the size of the Nutrient text annotation box "drags/re-expands" which makes adjusting it very hard. Upon investigation, JASPER is referencing a hard-coded Nutrient JS v1.6 which is very old. The issue was actually fixed in v1.9.1 release. This PR refactors how Nutrient PDF SDK viewer is loaded which was also introduced to make asset loading simpler.

This also updates the default values (e.g. font-size, font-family) when using the Text tool.

Since it is a huge version jump, I have asked the client to perform regression testing to ensure everything still works as expected.

@ronaldo-macapobre ronaldo-macapobre self-assigned this Oct 6, 2026
@ronaldo-macapobre ronaldo-macapobre added bug Something isn't working dependencies Pull requests that update a dependency file labels Oct 6, 2026
@ronaldo-macapobre ronaldo-macapobre changed the title Refactor Loading of NutrientPDF SDK [DO NOT REVIEW-TESTING] Refactor Loading of NutrientPDF SDK Oct 6, 2026
@ronaldo-macapobre
ronaldo-macapobre force-pushed the update-nutrient-cdn branch 2 times, most recently from 3ecfe3d to 073fad9 Compare October 6, 2026 20:58
@ronaldo-macapobre
ronaldo-macapobre marked this pull request as ready for review October 8, 2026 20:38
@ronaldo-macapobre ronaldo-macapobre changed the title [DO NOT REVIEW-TESTING] Refactor Loading of NutrientPDF SDK Refactor Loading of NutrientPDF SDK Oct 8, 2026
@ronaldo-macapobre

Copy link
Copy Markdown
Contributor Author

Setting this as ready for review as client said testing looks good.

Comment thread web/index.html
href="/styles/nutrient-toolbar.css"
/>
<link rel="icon" href="/images/jasper-favicon.svg" />
<script

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.

Make sure this doesn't mess anything up in the prod build - I recall there being issues with that when I first added Nutrient in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh I see! This branch has been in TEST for few days now and appears to be working fine. I appreciate the heads up and will do some additional tests once this goes to PROD.

props.strategy.generatePDF(processedData),
props.strategy.initialize?.(),
// Recommended to preload the worker for better performance.
nutrientViewer.preloadWorker(configuration),

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.

This does make the Promise.all dependent on preloadWorker running without error.

could do something like this above the promise.all instead to avoid that:
const preload = nutrientViewer.preloadWorker(configuration);
void preload.catch((error) => {
console.warn('Nutrient worker preload failed:', error);
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Will update.

},
text: {
...presets.text,
font: 'Calibri',

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.

Is this working ok on our linux-based aws image? Calibri is common on windows but not unix-based systems. Might end up falling back to sans-serif.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yup, Longine and I were testing it and Calibri looks to be working fine.

@sonarqubecloud

Copy link
Copy Markdown

@ronaldo-macapobre
ronaldo-macapobre merged commit e6ae8c2 into master Oct 14, 2026
8 checks passed
@ronaldo-macapobre
ronaldo-macapobre deleted the update-nutrient-cdn branch October 14, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants