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

What is replacement for PageImpl constructor #69

Closed
securelyshare-shiva-kumar opened this issue Oct 10, 2021 · 1 comment
Closed

What is replacement for PageImpl constructor #69

securelyshare-shiva-kumar opened this issue Oct 10, 2021 · 1 comment
Assignees

Comments

@securelyshare-shiva-kumar

Project details:
Spring

I changed the Groupdocs viewer dependency to 21.2 and ran into compilation error in Utils.java class, applyWidthHeightFix method in this line of code.

pages.set(n, new Page(page.getNumber(), page.isVisible(), (fixWidth == 0) ? lastFixWidth : fixWidth, (fixHeight == 0) ? lastFixHeight : fixHeight, page.getLines()));

In 21.2 version Page is an interface and default implementation PageImpl is deprecated what is the suitable replacement for this.

@liosha2007
Copy link
Collaborator

Hello.
You can still use PageImpl class, it will not be deleted. But in this way you will not have opportunity to create custom models for your own implementation of serialization. The recommended way is to use CacheableFactory. There are methods for creating new instances of models.
For example:
CacheableFactory.getInstance().newPage(page.getNumber(), page.isVisible(), (fixWidth == 0) ? lastFixWidth : fixWidth, (fixHeight == 0) ? lastFixHeight : fixHeight, page.getLines()));

More details can be found in documentation

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

No branches or pull requests

3 participants