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

Search and highlight not working when [show-all]="false" [page]="4" #375

Closed
sanjaybhaskar opened this issue Aug 31, 2018 · 2 comments
Closed
Milestone

Comments

@sanjaybhaskar
Copy link

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

My requirement is to display the single page in the Model window and highlight the particular text.
For this, lets say i need to display page 4 and try to execute the search text and having [show-all] attribute to "false".
Search functionality doesn't work and no highlight as well.
Here is the code

<pdf-viewer [src]="pdfSrc" 
             [render-text]="true" [show-all]="false" [page]="4"
             style="display: block;" (page-rendered)="onPageRendered($event)"
       ></pdf-viewer>
search() {
    this.pdfComponent.pdfFindController.executeCommand('find', {
      caseSensitive: false, findPrevious: undefined, highlightAll: true, phraseSearch: true, query: "DATE"
    });
  }

  onPageRendered(event){
    this.search();
  }

Can you please help me to fix this.

@tsanthoshreddy
Copy link

I"m seeing this error when implementing search, any ideas

core.js:1449 ERROR TypeError: Cannot read property 'pdfFindController' of undefined
at DisplayContentComponent.search (displaycontent.component.ts:99)
at SafeSubscriber.eval [as _next] (displaycontent.component.ts:88)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:243)
at SafeSubscriber.next (Subscriber.js:190)
at Subscriber._next (Subscriber.js:131)
at Subscriber.next (Subscriber.js:95)
at CatchSubscriber.Subscriber._next (Subscriber.js:131)
at CatchSubscriber.Subscriber.next (Subscriber.js:95)
at MapSubscriber._next (map.js:85)

@din-s
Copy link

din-s commented Jun 15, 2022

I"m seeing this error when implementing search, any ideas

core.js:1449 ERROR TypeError: Cannot read property 'pdfFindController' of undefined at DisplayContentComponent.search (displaycontent.component.ts:99) at SafeSubscriber.eval [as _next] (displaycontent.component.ts:88) at SafeSubscriber.__tryOrUnsub (Subscriber.js:243) at SafeSubscriber.next (Subscriber.js:190) at Subscriber._next (Subscriber.js:131) at Subscriber.next (Subscriber.js:95) at CatchSubscriber.Subscriber._next (Subscriber.js:131) at CatchSubscriber.Subscriber.next (Subscriber.js:95) at MapSubscriber._next (map.js:85)

can you please share more from your code OR You might be trying to access pdfFindController like here in question and not as per 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

4 participants