Print Page | Close Window

Outline? Annotation? JavaScript?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2225
Printed Date: 05 May 25 at 10:45AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Outline? Annotation? JavaScript?
Posted By: cscooper
Subject: Outline? Annotation? JavaScript?
Date Posted: 11 Apr 12 at 10:41PM
I have an idea what I want the final product to look like, but I'm looking for suggestions what the underlying technology needs to be ...

I want my PDF document to have rectangular "hotspots" that as the user rolls their mouse over these spots, the hotspot becomes visible - maybe yellow highlight or something (and maybe it was a little bit visible to start with in a non-intrusive way) and a box pops up near the hotspot telling you about the hot-spotted area.  When the mouse moves on, the highlighting and the box go away.

In addition, I want an outline that contains a list of all of these hotspots - and when the user clicks on an item in the outline, it takes you to the correct page, and activates the hotspot as if the user had moved their mouse over it.

Ideas/suggestions on the best way to implement this (using the QuickPDF library of course)?

Thanks,
Chris




Replies:
Posted By: Ingo
Date Posted: 12 Apr 12 at 7:40AM
Hi Chris!

You can deal with the AddLinkTo-functionalities (but with
an empty linkstring... don't know if this is possible).

You should additionally have a look on:
AddNoteAnnotation and
SetAnnotQuadPoints.

Cheers, Ingo




Posted By: cscooper
Date Posted: 12 Apr 12 at 3:24PM
Thanks for the advice!

I tried a few things.  I called AddNoteAnnotation twice (once a Comment, once a Note) and AddTextMarkupAnnotation once (Highlight).  When I load the PDF in Reader, I have various things floating around the page, but none of them are quite what I was looking for.

Both of the "Note" annotations result in two items: (1) an icon on the page (either a yellow thought bubble for the Comment or a blue rectangle for the Note) and (2) a box that kind of floats around that contains some editable text.  Neither of the icons are transparent, so the user can't see the text beneath the icon, and that's a requirement.

The "Text Markup" annotation looks possible, it's just a highlighted rectangle and the underlying text is clearly visible, and when I double-click on it, it pops up a new comment box.  That's closer, now I need to tweak the UI a little.

How can I ...
(1) create a comment box linked to my Text Markup annotation?
(2) make it so the linked comment box is initially hidden, but as I mouse over the Text Markup annotation, the linked comment box becomes visible?
(3) make it so the linked comment box is read-only?

Thanks,
Chris



Posted By: cscooper
Date Posted: 12 Apr 12 at 4:03PM
I just made some very good progress ... by creating a "Text Markup" annotation and calling "SetAnnotContents" on it, when I open the resulting PDF in Adobe Reader, I get a popup that appears when I mouse-over the highlighted area, containing my text!  (and the popup goes away if I move the mouse away from the highlighted area which is perfect for my needs)

But I'd like to tweak it a little ... right now what I get for a popup is a yellowish box with a horizontal line in the middle; the box is empty above the line, and has my text below.  If I double-click on the popup (in Adobe Reader) and change the Highlight Properties in the resulting Comment box by adding an Author and a Subject, I see that it's the Author information that appears above the horizontal line in the original popup.  However, I don't see any way to set the Author information in QuickPDF; I don't even see any way to query the Author information (notice this is the author of the comment, not the author of the document).  I'd also like to set the "Locked" property in the Highlight Properties box; even though the user can easily just un-check this property and make any modifications they want, at least that would prevent accidental changes.

And then a more advanced question ... can I modify the color of the "Text Markup" annotation on-the-fly (maybe with JavaScript)?  What I'm hoping to do, is that when the user clicks on a specific item in the outline, to have it not only go to the right page with the right Text Markup Annotation in the middle of the view, but in case there are a few Text Markup Annotations on the screen, have the correct one indicated (by having it be a different color, or flash or something).  Is this possible?

Thanks,
Chris



Posted By: AndrewC
Date Posted: 13 Apr 12 at 12:03PM
This Javascript manual might be helpful as most Javascript is outside the scope of Quick PDF Library.

http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJSGuide.pdf - http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJSGuide.pdf


Posted By: cscooper
Date Posted: 13 Apr 12 at 2:02PM
OK, time to dive into JavaScript!

Thanks,
Chris




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk