-1

This is what I have done:

  1. I have loaded a pdf file in web browser,
  2. Now I want to select text from that file and paste into a text box.

Can anyone help me?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • 1
    ...what have you tried? What are you using to "load" your PDF? A custom component? The Adobe Acrobat plugin for that web browser? *Details!* – J. Steen Sep 25 '12 at 07:39
  • I think he was trying to pragmatically copy/paste the selected/highlighted text from pdf to text-box. – RSB Sep 25 '12 at 07:42
  • Programmatically - but yes. That much is obvious. What isn't, is what technologies the OP is using to try and support this feature. Depending on those details, the answers will be more or less complex. As it stands, it's just guesswork. – J. Steen Sep 25 '12 at 07:50

2 Answers2

1

I'm pretty sure that this is going to be prohibitively difficult, if not impossible, to do.

The browser does not 'run' the PDF, it acts as a host for the PDF application, which ends up sharing it's main window. After that, control of the cursor etc passes to the PDF application and the browser is effectively no longer aware of what happens inside it. If the PDF application being used exposes COM interfaces for manipulating the cursor/text selection (doubtful), then it's possible to script against those interfaces from client script - but you won't be able to actually run any script in that window because the browser is showing a PDF, not a web page.

It might be possible if you hosted the web control on a windows forms application, but even so I wouldn't even know where to start on that one.

If your goal is to extract text from the PDF then you're probably better off pushing it through a .Net PDF library. A quick google on that one will yield you some suitable libraries.

Andras Zoltan
  • 41,961
  • 13
  • 104
  • 160
0

if your pdf file has form elements then the file can be submitted to a url. check this link.. it might help. Can a PDF fillable form post itself to an HTTPS URL?

Community
  • 1
  • 1
th1rdey3
  • 4,176
  • 7
  • 30
  • 66