Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Mar 10, 2017 4:57 am

Hello,

I am working with a PDF that was scanned with OCR from an outside source. I know the basics of searching the PDF and highlighting or even creating a bookmark. Is it possible to use your tool to create a link that is overlaid on the pdf, and create an event that will be triggered when clicking on the overlay. For example, if the user clicks on the word DOG (assuming that words was searched and found using the Spire PDF tool), can the word be copied to another field on the form.

I'm creating a windows form.

Thank you.

FreeStan
 
Posts: 6
Joined: Thu Feb 23, 2017 5:28 am

Fri Mar 10, 2017 7:52 am

Dear FreeStan,

Thanks for your inquiry.
For your requirement, you can create a button field first, and then set a PdfJavaScriptAction for it.
Code snippet for your kind reference.
Code: Select all
            String script = "....";
            PdfJavaScriptAction action = new PdfJavaScriptAction(script);
            PdfButtonField field = new PdfButtonField(pageone, "buttonField");
            field.Bounds = new RectangleF(60,100, 100, 20);
            field.Visible = true;
            field.Actions.MouseDown = action ;

Hope this can helps, if there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Mar 14, 2017 9:43 am

Dear FreeStan,

How is your issue now ?
We will appreciate it if you could give us some feedback at your convenience.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sat Mar 18, 2017 2:28 am

Thank you for the response. I know it's a separate product, but is pdfviewer able to handle the onclick event?

I tried to test this today, but I got a message which I believe suggests I need to use Spire.Office.

An unhandled exception of type 'System.MissingMethodException' occurred in System.Windows.Forms.dll

Additional information: Method not found: 'System.Drawing.Rectangle spr᳦.ᜄ()'.

Thank you,

FreeStan
 
Posts: 6
Joined: Thu Feb 23, 2017 5:28 am

Mon Mar 20, 2017 6:54 am

Dear FreeStan,

Thanks for your inquiry.
Sorry that Spire.PDFViewer is just a viewer, not support to manipulate the pdf file, so I am afraid it cannot be used to create event on PDF.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF