Closed Bug 941177 Opened 11 years ago Closed 10 years ago

unable to search whole pdf with pdfjs because of lazy loading

Categories

(Firefox :: PDF Viewer, defect)

25 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: rot_753, Unassigned)

Details

(Whiteboard: [pdfjs-f-fixed-upstream]https://github.com/mozilla/pdf.js/pull/3920)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release) Build ID: 20131112160018 Steps to reproduce: 1. open pdf in Firefox (e.g. http://www.hupfeld-software.de/files/Dynasys-Handbuch.pdf) 2. use pdfjs built-in search function and search for "zwicker" Actual results: Expression couldn't be found in the document (probably because pdfjs does not load the whole pdf file -> lazy loading). But by scrolling right to the end of the file and searching again the word can be found. If you repeat the whole procedure the word can be found in the beginning (probably because the file is in the cache already). Expected results: The expression should be found even if I don't scroll through the whole pdf.
Component: Untriaged → PDF Viewer
Whiteboard: [pdfjs-f-fixed-upstream]https://github.com/mozilla/pdf.js/pull/3920
Hm, we've got pdf.js 0.8.934 in FF29 now (https://bugzilla.mozilla.org/show_bug.cgi?id=960051), but i can still reproduce this.
Flags: needinfo?(ydelendik)
Flags: needinfo?(ryanvm)
Flags: needinfo?(ryanvm)
The pdf.js demo on github clearly has its own search functionality which works with lazy loading. http://mozilla.github.io/pdf.js/web/viewer.html It's unclear to me why the version included in FF lacks this search and uses the default FF search instead. Does it only work when pdf.js is server side?
(In reply to ropeladder from comment #2) > The pdf.js demo on github clearly has its own search functionality which > works with lazy loading. > http://mozilla.github.io/pdf.js/web/viewer.html > > It's unclear to me why the version included in FF lacks this search and uses > the default FF search instead. Does it only work when pdf.js is server side? You can avoid the 'built in' search functionality by using find as you type, in which case it doesn't seem to work - try enabling find as you type, load the page and type 'zaleski', then skip to the bottom and try again.
Attached video unable to reproduce
I was unable to reproduce the issue using steps above (see the movie). What's your steps?
Flags: needinfo?(ydelendik) → needinfo?(m8r-x3rq311)
Ok I figured it out, sort of. The bug happens when I open the pdf link in a new tab. When I left-click the link to open it in the same tab (like Yury's video) it works fine. But when I middle click or right click and open the link in a new tab (which is how I open them 99% of the time, so I had never even noticed that the search worked) the search functionality doesn't find the parts that have yet to lazy load.
> when I open the pdf link in a new tab Sounds like a different bug then. Just to be sure, your STR are: 1. Open a web with a PDF link, e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=941177#c0 2. Right click on the PDF line, e.g. http://www.hupfeld-software.de/files/Dynasys-Handbuch.pdf, and select "Open Link in New Tab" 3. Open find bar, and search e.g. "zwicker"?
Yes, exactly.
I just tried this, can confirm that opening in the same tab _does_ find the term, while opening in a new tab does not. Perhaps of some use in diagnosing, after loading a PDF in a new tab and search fails to find a term, clicking FindBar Tweak's 'Find in All Tabs' option _will_ find the search term. https://addons.mozilla.org/en-US/firefox/addon/findbar-tweak/
Flags: needinfo?(m8r-x3rq311)
Marking the original issue as WFM. The comment 6 problem will be addressed by bug 1006714
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: