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

issue #3346: Text Selection Example #3347

Merged
merged 1 commit into from
Sep 10, 2013
Merged

Conversation

vivin
Copy link
Contributor

@vivin vivin commented Jun 7, 2013

Text selection example.

@yurydelendik
Copy link
Contributor

@vivin , can you change your example to use extracted text_layer_builder.js?

@vivin
Copy link
Contributor Author

vivin commented Jun 21, 2013

@yurydelendik Will do so! I will try and get to it this weekend.

@vivin
Copy link
Contributor Author

vivin commented Jun 25, 2013

@yurydelendik I've updated the example. I tested it out and it seems to work. Hope it's good to go!

@mitar
Copy link
Contributor

mitar commented Jul 3, 2013

How much this code depend on viewer.js? I see that it depends on find bar?

@vivin
Copy link
Contributor Author

vivin commented Jul 3, 2013

@mitar, PDFFindBar is not necessary, and TexLayerBuilder will work without it. I added in this case because viewer.js requires it.

@mitar
Copy link
Contributor

mitar commented Jul 3, 2013

I am just saying that it is useful to have clean and small examples. :-)

@vivin
Copy link
Contributor Author

vivin commented Jul 3, 2013

@mitar Oh, of course. I hope I didn't come across as rude. Was only trying to clarify. :)

@mitar
Copy link
Contributor

mitar commented Jul 3, 2013

:-) No problem. The issue is that we tried to implement text selection just few days ago. And we had to copy-paste some code from viewer.js to make it work. Why is not text selection code completely independent from viewer.js? There is text_layer_builder.js, but it is not enough. Our code we ended up using.

@vivin
Copy link
Contributor Author

vivin commented Jul 3, 2013

@mitar, The text selection code is actually independent from viewer.js. What was't working for you when you used it? You can simply use text_layer_builder.js as is, because what you pass into the constructor are references to PDFFindBar and PDFFindController, and if those aren't passed in, TextLayerBuilder doesn't use them.

@mitar
Copy link
Contributor

mitar commented Jul 3, 2013

I am not sure. It was done by a teammate. @speigg, can you fill us in here? Why was text_layer_builder.js not enough?

@vivin
Copy link
Contributor Author

vivin commented Jul 3, 2013

@mitar I think you will need ui_utils.js as well. I forgot about that. :)

@speigg
Copy link

speigg commented Jul 3, 2013

Yes, some code from ui_uitls.js was also needed

@mitar
Copy link
Contributor

mitar commented Jul 3, 2013

@speigg, OK, then no need for us to merge this into one file, but could just add two separate files. It is easier to track this then.

@mitar
Copy link
Contributor

mitar commented Jul 9, 2013

Yes, text_layer_builder.js and ui_uitls.js is enough.

@timvandermeij
Copy link
Contributor

@vivin What is the status of this PR?

@vivin
Copy link
Contributor Author

vivin commented Jul 18, 2013

Still waiting for a merge. Hope they haven't forgotten about it. :)

@timvandermeij
Copy link
Contributor

In that case, @yurydelendik might know more. :-)

@Snuffleupagus
Copy link
Collaborator

It might be a good idea to squash the commits in this PR, to keep the commit history cleaner.

<body>
This is a minimal pdf.js text-selection demo. The existing minimal-example shows you how to render a PDF, but not
how to enable text-selection. This example shows you how to do both. <br /><br />
<div id="pdfContainer" class = "pdf-content">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove extra spaces near 'class=' ?

@vivin
Copy link
Contributor Author

vivin commented Jul 18, 2013

Hey Yury!

Will make the changes as soon as I can and squash.

@brendandahl
Copy link
Contributor

Any updates on this?

@vivin
Copy link
Contributor Author

vivin commented Aug 26, 2013

Sorry, was caught up with work! I will try and get to this today.

squashing commits.
@vivin
Copy link
Contributor Author

vivin commented Aug 27, 2013

Commits have been squashed. Should be ok to merge.

yurydelendik added a commit that referenced this pull request Sep 10, 2013
issue #3346: Text Selection Example
@yurydelendik yurydelendik merged commit 4f243b3 into mozilla:master Sep 10, 2013
@yurydelendik
Copy link
Contributor

Thank you for the patch

@vivin
Copy link
Contributor Author

vivin commented Sep 11, 2013

@yurydelendik Glad to help! :)

@apoku
Copy link

apoku commented Jan 9, 2015

Just noticed this example recently underwent a complete re-write. I had a functional version working with the old example (just mis-aligned text issue I am working through). Is there significant or notable changes in the latest example?

Here is the commit I am referring to:
513a3d8

@yurydelendik
Copy link
Contributor

@apoku please open a separate issue for that an specify more information. Shortly, #5552 creates a better way to handle the painting of the entire page (including canvas, text layer and annotation). You may still use TextLayerBuilder (but it's really hard to tell since you did not provide any code you are refrerring to).

@apoku
Copy link

apoku commented Jan 15, 2015

Thanks @yurydelendik, your short explanation is perfectly sufficient--I was just wanting to understand conceptually what that re-write encompassed.

@vivin vivin mentioned this pull request Nov 7, 2015
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

Successfully merging this pull request may close these issues.

8 participants