You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
install the latest pdfjs-dist and attempt utilizing PDFJSViewer.PDFFindController
Attempt to new up PDFFindController, PDFThumbnailViewer
const PDFJSViewer = require('pdfjs-dist/web/pdf_viewer');
class ViewerComponent {
...
this.findController = new PDFJSViewer.PDFFindController({ pdfViewer: this.pdfViewer });
this.pdfViewer.setFindController(this.findController);
...
}
Additionally, the PDFPageProxy appears to have changed it's shape:
import { PDFPageProxy } from 'pdfjs-dist';
export class PdfPage {
constructor(public proxy: PDFPageProxy) { }
...
get removed(): boolean {
return !!this.proxy['pageInfo'].removed; // <-- Cannot read property 'removed' of undefined
}
...
}
What is the expected behavior?
No errors in the console
Viewer Renders
What went wrong?
Primarily, the following two errors. It seems like minor changes happened to the library in a semantically patch level release. E.g., from 2.0.489 to 2.0.943 has breaking changes.
this.pdfViewer.setFindController is not a function
this.findController.reset is not a function
a couple of others around PDFThumbnailViewer and PDFPageProxy
The text was updated successfully, but these errors were encountered:
Most of the changes were made in #10099 and follow-up patches, so the usage indeed needs to be adapted. It was done to both improve code quality and fix bugs, but also because we received feedback from third-party application developers that wanted to use the find controller in their own viewer, so we made it more modular and less dependent on the PDFViewer instance.
It seems like minor changes happened to the library in a semantically patch level release. E.g., from 2.0.489 to 2.0.943 has breaking changes.
Yes, but this was expected. Version 2.0.943 is the actual stable release, whereas earlier versions like 2.0.489 were pre-release (beta) versions that were expected to change. We published the beta version because there was a demand for it and to gather feedback for the final stable version. So, anything before 2.0.943 in the 2.x release series was never stable and thus the API could still change, whereas now it can't until the next major version.
We had forked and heavily modified ng2-pdf-viewer which was relying on 2.0.489 at the time, which is also why I didn't even think to look to see if it was a pre-release version (dependency of a dependency).
Viewer Repo/Link
Configuration:
Steps to Reproduce
What is the expected behavior?
What went wrong?
Primarily, the following two errors. It seems like minor changes happened to the library in a semantically patch level release. E.g., from 2.0.489 to 2.0.943 has breaking changes.
this.pdfViewer.setFindController is not a function
this.findController.reset is not a function
The text was updated successfully, but these errors were encountered: