Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text overlay, SVG

112 views
Skip to first unread message

tuom....@gmail.com

unread,
Jan 29, 2014, 6:18:12 AM1/29/14
to
Hello list,

from what I understand, PDF.js draws the PDF content onto a canvas element and then overlays bunch of divs on top of it for text selection, right? If I did not need the selection, could I somehow disable the creation of the whole text overlay? Would it speed-up the rendering?

On related note, I think I read somewhere sometime (wiki plans?) than there was some kind of plan to evaluate the possibility of using SVG instead of canvas, did that go somewhere? Is there any conclusion/opinion about it?

Thanks,

T.

J. Ryan Stinnett

unread,
Jan 29, 2014, 12:11:10 PM1/29/14
to tuom....@gmail.com, dev-p...@lists.mozilla.org
On Wed, Jan 29, 2014 at 5:18 AM, <tuom....@gmail.com> wrote:

> Hello list,
>
> from what I understand, PDF.js draws the PDF content onto a canvas element
> and then overlays bunch of divs on top of it for text selection, right? If
> I did not need the selection, could I somehow disable the creation of the
> whole text overlay? Would it speed-up the rendering?
>

You can disable the text layer by adding "#textLayer=off" at the end of the
PDF URL. See the debugging wiki[1] for more options.

I am not sure what impact it has on performance. You could instrument the
code with some console.time/timeEnd statements and compare.

[1]: https://github.com/mozilla/pdf.js/wiki/Debugging-pdf.js

- Ryan

Tuom Larsen

unread,
Jan 30, 2014, 10:27:23 AM1/30/14
to J. Ryan Stinnett, dev-p...@lists.mozilla.org
Thanks!

On Wed, Jan 29, 2014 at 6:11 PM, J. Ryan Stinnett <jry...@gmail.com> wrote:
> On Wed, Jan 29, 2014 at 5:18 AM, <tuom....@gmail.com> wrote:
>>
>> Hello list,
>>
>> from what I understand, PDF.js draws the PDF content onto a canvas element
>> and then overlays bunch of divs on top of it for text selection, right? If I
>> did not need the selection, could I somehow disable the creation of the
>> whole text overlay? Would it speed-up the rendering?
>
>
0 new messages