Web Design - Publish.com
Publish.com Ziff-Davis Enterprise  
SEARCH · ONLINE MEDIA · MOBILE · WEB DESIGN · GRAPHICS TOOLS · PRINTING · PHOTO · TIPS · OPINIONS
Home arrow Web Design arrow How to open a PDF with highlighted words
How to open a PDF with highlighted words
By Publish

Rate This Article:
Add This Article To:
The goal: to launch Acrobat Reader from an external application, automatically highlighting some words.

-Courtesy of www.PDFzone.com

Question: How can I launch Acrobat Reader from an external application, automatically highlighting some words?--Filippo Mariani


Answers:

For adding the highlights, there are two good possibilities:
1. Add highlighting to the document before you send it to the user. This is not easy, but Reader would draw the content stream happily without the user needing to install a plug-in. This avoids the user having to re-install your application to get the plug-in back if they reinstall Acrobat Reader.

2. Write a Reader plug-in that registers for the AVPageViewDidDraw notification and draws highlighting on the just-drawn page using platform-specific drawing calls or AVPageViewInvertRect or AVPageViewInvertQuad.

For navigating to the desired page, there are two possibilities:
1. Before you send the PDF to the user, set the page-open action to go to the proper page. Like choice 1 above, this would require some server software for manipulating the PDF.

2. I think Acrobat supports some kind of IAC for legally (and without a plug-in) navigating to the proper page. I'm a plug-in person, not an IAC person, so this is as specific as I can get.

Be careful, certain things may be allowed by the license but the calls you use in a plug-in may not be implemented in Reader. I stick mostly to full-Acrobat plug-ins and have not done a Reader plug-in for a while, so you will have to check to see if the calls I named above are available in Reader.
--Dan-Ari Feinberg



The FDFToolkit supports adding JavaScript to a document that will be executed when the document is first opened, though it isn't mentioned in the FDF spec (which is within the PDF spec: 7.6.6.). Inside JavaScript you can change the current page and create annotations like little boxes around the appropriate words.

You might even be able to do something a bit fancier than little boxes. If you're willing to stick to Acrobat 5, you can use transparency. Form fields and annotations don't support it directly, but form fields to support having their appearance set to some file (button icon). This file can be any PDF. . . including one that's just a X% opaque box of whatever color you choose.
Unless you can make the "highlight" PDF available to your readers through a path (I don't know if URLs are supported or not), you'd have to embed the icon appearance in a hidden field. In JavaScript, you can then use field.buttonGetIcon and field.buttonSetIcon. That way might actually be easier. You set the icon scaling using buttonScaleWhen property (to always). --Mark Storer

 




Discuss How to open a PDF with highlighted words
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Web Design Articles          >>> More By Publish
 


Buyer's Guide
Explore hundreds of products in our Publish.com Buyer's Guide.
Web design
Content management
Graphics Software
Streaming Media
Video
Digital photography
Stock photography
Web development
View all >

ADVERTISEMENT


FREE ZIFF DAVIS ENTERPRISE ESEMINARS AT ESEMINARSLIVE.COM
  • Dec 10, 4 p.m. ET
    Eliminate the Drawbacks of Traditional Backup/Replication for Linux
    with Michael Krieger. Sponsored by InMage
  • Dec 11, 1 p.m. ET
    Data Modeling and Metadata Management with PowerDesigner
    with Joel Shore. Sponsored by Sybase
  • Dec 12, 12 p.m. ET
    Closing the IT Business Gap: Monitoring the End-User Experience
    with Michael Krieger. Sponsored by Compuware
  • Dec 12, 2 p.m. ET
    Enabling IT Consolidation
    with Michael Krieger. Sponsored by Riverbed & VMWare
  • VTS
    Join us on Dec. 19 for Discovering Value in Stored Data & Reducing Business Risk. Join this interactive day-long event to learn how your enterprise can cost-effectively manage stored data while keeping it secure, compliant and accessible. Disorganized storage can prevent your enterprise from extracting the maximum value from information assets. Learn how to organize enterprise data so vital information assets can help your business thrive. Explore policies, strategies and tactics from creation through deletion. Attend live or on-demand with complimentary registration!
    FEATURED CONTENT
    IT LINK DISCUSSION - MIGRATION
    A Windows Vista® migration introduces new and unique challenges to any IT organization. It's important to understand early on whether your systems, hardware, applications and end users are ready for the transition.
    Join the discussion today!



    .NAME Charging For Whois
    Whois has always been a free service, but the .NAME registry is trying to change that.
    Read More >>

    Sponsored by Ziff Davis Enterprise Group

    NEW FROM ZIFF DAVIS ENTERPRISE


    Delivering the latest technology news & reviews straight to your handheld device

    Now you can get the latest technology news & reviews from the trusted editors of eWEEK.com on your handheld device
    mobile.eWEEK.com

     


    RSS 2.0 Feed


    internet
    rss graphic Publish.com
    rss graphic Google Watch

    Video Interviews


    streaming video
    Designing Apps for Usability
    DevSource interviews usability pundit Dr. Jakob Nielsen on everything from the proper attitude for programmers to the importance of prototyping in design to the reasons why PDF, Flash and local search engines can hurt more than they help.
    ADVERTISEMENT