Click hyperlinks in pdf via vbscript

hi all,
i'm pretty new to using adobe sdk. i have win xp with ie 6. i have adobe professional 8.0 installed. via vbscript, i can create acroexch.app, avdoc, pddoc. but i can't create acroexch.pdannot object.
this is my problem: i have pdf documents, which open in ie browser. i can search / extract text from the document.
i know, for sure, that there are hyperlinks in that document. i want a way to identify all the hyperlinks & click on each 1 of them. they, inturn, lead to opening of another browser, which contains a pdf with hyperlinks & so on...
problem is, i can't create an acroexch.app object in vbscript. is there any way to do this via vbscript & iac?
any help is appreciated..

can any1 please help me out?
i have a requirement of clicking on a specific annot object. i'm using vbscript.
the problem is, the code is clicking only on the last annot object, no matter what.
problem: i have a pdf document, which has many link annot objects. i need to click on the specific annot object. how can i click a particular annot, based on it's index or annot count?
below is my code, which tries to get the index, subtype & annot name.
i can get all 3, but the code just doesn't click on the annot i want.
i have been trying for quite some time & i seriously need some help...
below is my code:
private sub get_link_name(leftVal, rightVal)
Dim strText()
For lpj = 0 to annotCnt-1
Set pdPage=AcroPDDoc.AcquirePage(0)
Set pdAnnot=pdPage.GetAnnot(lpj)
If not pdAnnot is nothing Then
annotType= pdAnnot.GetSubType
If pdAnnot.IsValid and annotType="Link" Then
index=pdPage.GetAnnotIndex(pdAnnot)
Set acroRect = nothing
Set acroRect = CreateObject("AcroExch.Rect")
acroRect.Bottom =bottom : acroRect.Top = top
acroRect.Left = leftVal : acroRect.Right = rightVal
Call PDTextSelect.Destroy()
Set PDTextSelect = AcroPDDoc.CreateTextSelect(0, acroRect)
If not PDTextSelect is nothing Then
For nElem = 0 To PDTextSelect.GetNumText() - 1
ReDim preserve strText(PDTextSelect.GetNumText())
strText(nElem)= PDTextSelect.GetText(nElem)
annotname = strText(nElem)
Next
end if 'for pd text select
end if ' for pd annot
'reporter.ReportEvent micDone, "annot name: ", annotname
End If
Next 'loop to click the multiple annots in 1 page
Erase strText
End Sub
Private function f_click_on_total(leftVal, rightVal, limit, colname, yr)
Dim ileft, iright
ileft = leftVal : iright = rightVal
bottom = empty
bottom = bottomlimit+5
top = bottom+5
position = empty
'Set avDoc = nothing : set AcroApp = nothing
Set AcroApp = CreateObject("Acroexch.App")
Set avDoc = AcroApp.GetAVDoc(AcroApp.GetNumAVDocs - 1)
Set AcroPDDoc = avDoc.GetPDDoc()
If (bottom = bottomlimit+5) or (bottom < bottomlimit -10) Then
Set acroRect = CreateObject("AcroExch.Rect")
acroRect.Top = top : acroRect.Bottom = bottom
acroRect.Left = leftVal : acroRect.Right = rightVal
Set PDTextSelect = AcroPDDoc.CreateTextSelect(0, acroRect)
flag = false
While flag = false
If rightVal> limit Then
leftVal= ileft : rightVal = iright
top = top-3 : bottom = bottom-3
acroRect.Top = top : acroRect.Bottom = bottom
acroRect.Left = leftVal : acroRect.Right = rightVal
end if
'reporter.ReportEvent micDone, "clicking on total:", rightVal & "--"& bottom
flag = f_select_text(leftVal, rightVal)
If bottom < bottomlimit - 10 Then
reporter.ReportEvent micFail, "script failure", "failed to find total $ text. hence could not click. exiting function @ bottom= " & bottom
Exit function
End If
wend
if PDTextSelect Is Nothing then
msgbox "pd text select is empty at r= " & rightVal
'Exit for
end if
Call avDoc.SetTextSelection(PDTextSelect)
Call avDoc.ShowTextSelect()
'wait(.5)
ReDim preserve strText(PDTextSelect.GetNumText())
For nElem = 0 To PDTextSelect.GetNumText() - 1
strText(nElem)=PDTextSelect.GetText(nElem)
If not isempty(trim(strText(nElem))) then
reporter.ReportEvent micDone, "click on total", "row contents--->" & nElem&":"&strText(nElem)
pdfText = strText(nElem)
position = f_matchpattern(pdfText)
If position > 0 Then
pdAnnot.Perform(avDoc)
wait(30)
Set avDoc = nothing
Set avDoc = AcroApp.GetAVDoc(AcroApp.GetNumAVDocs - 1)
avDoc.bringtofront()
If browser("TotCalyrClaimDetail -").Exist Then
browser("TotCalyrClaimDetail -").Sync
For iCnt = 0 to ubound(arrFindText)-1
textflag = f_getBodyTextPDF (arrFindText(iCnt))
If textflag = true Then
reporter.ReportEvent micPass, "total $$ click", arrFindText(iCnt) & " found in pdf on page " & pageCount
else
reporter.ReportEvent micFail, "total $$ click", arrFindText(iCnt) & " NOT found."
End If
next
position = "success"
Call f_getBodyTextPDF (strFindText)
If colname = "wPremiumtotal" Then
Call f_grandTotal()
end if
browser("TotCalyrClaimDetail -").Close
End If
End If
end if
Next
Call PDTextSelect.Destroy()
Erase strText
nElem = empty
If position = "success" Then ' don't call the function once i click the link.
else
get_link_name leftVal, rightVal ' calling to check if i can get the link name, to click
end if
else
position = empty
msgbox "total text not found"
Exittest
End If
position = empty
Set avDoc = nothing : set AcroApp = nothing
wait(2)
End Function
i'm using acroexch.rect to find my annot. what i'm trying to do is, getting text within acroexch.rect object, then checking if it's of type link annot. if yes, then click it, which doesn't happen.

Similar Messages

  • How can I retain hyperlinks while saving a webpage as PDF via Print?

    How can I retain hyperlinks while saving a webpage as PDF via Print?
    This is the title of an apple forum question, and it is a bug in both Safari 5.1.3 and under, and I find it to also occur in Firefox browser (at least 9.* 10.*, 11.0), running on Lion OS (10.7.2, 10.7.3). See:
    https://discussions.apple.com/thread/3212301?start=0&tstart=0
    Under the newer Mac OS mentioned, and Firefox 10.2, 11.0, 9.*, if I select:
    File -> Print -> PDF -> Open PDF in Preview"
    (and view / save the PDF in Preview, you will see none of the links in the original web page are active
    or using
    File -> Print -> PDF -> Save as PDF...
    same problem. Try this using any Wikipedia page, for example.
    When this problem was posed in Apple forums, by a user of the Safari browser, it was found to be a bug (since Aug 2011) fixed in a Safari browser build 5.1.4 circa Jan 2012. I tried the newer Safari browser and sure enough the problem went away (except that links embedded in the PDF no longer appeared as blue text - ARGH - but "hover over" with the cursor showed the link and clicking the link in Preview viewer activated the link in a browser window).
    So I post this to the Mozilla community, please fix this 'cause I don't want to have to switch over to Safari browser every time I want to archive a PDF with active links!!!!
    P.S. I did a spot-check and with the newer add-on Enjoy Reading 1.0.1 and FF11.0. When the Enjoy reading formatted version appears in the browser window, all URLs/links are preserved and highlighted in blue, but when I print that browser window as PDF, the links are dead (don't work) even though they appear in blue in the PDF.
    So, what's going on, can the Safari fix be researched and applied to FF?
    Also, on some forums, people are responding, Well, try installing Acrobat reader. Well, I don't want to, Preview reader has worked fine for me for years.

    Thanks jscher2000.
    RE: -- '''Generally speaking, PDF converters that work by intercepting a print job do not have access to the URLs behind links in the page.''' --
    I cannot say I agree. I could email you a PDF clipping or two (generated from Safari on Mac OS, in its native capability with no add-ons) that shows you otherwise. When I used PC platforms I did have to install PDF converters (tried both free and expensive ones) that did what I describe.
    I cannot try the add-on you mention, '''Print Pages to Pdf.''' in Firefox. It shows in my browser and Mac OS platform "Not available for your platform." So I am guessing it was written for the PC version of Firefox.
    The Mac OS has had a native PDF-creation functionality for as many years as I have been using it; I used PC prior to that, Win3.1 through XP and NT. And on my PC, I bought (and at work, my employer bought $$$, I had to justify three levels up to management the ability to create PDFs on my work PC) some Adobe functionality to CREATE pdf's (readin's free and easy, makin' em's costly on the PC).
    I've gone and dug through some of my (Mac) doc and clipping archives, and I find that stuff I created after about Dec 2008 or so seems to eliminate all link functionality. When viewed in the Apple native "Preview" application (sort of Apple's equivalent to Adobe Acrobat reader, ships with the OS): link tags are highlighted/tinted, clicking a link opens a (default) browser and takes you there; hover-over the tag text shows the actual link. (Of course, not all old links are still VALID or point to the desired source.)
    I could, in Safari or FF browser window and with no add-ons or Adobe paid products whatsoever, use the native OS method to create PDF's from any application (word processor, spreadsheet, browser, etc) via the menu File -> Print -> Save as PDF menu and create a PDF that had active hyperlinks. In Apple OS Lion 10.7.3, I still can't when it uses this broken WebKit interface, links are "dead" as a doornail until a fix is distributed in WebKit for a future Lion release. It seems this functionality died at least as far back as Leopard OS 10.6.8, but don't quote me on that. Also, my version of Pages 2009 version 4.1(923) (sorta like Word) STILL creates a PDF document that preserves (1) text hyper-links within the document, and (2) web links (in the PDF) that open the browser. I just made a test document.
    When all you can see in the PDF is the tag text, there is nothing to copy-paste to follow any link. Also, hypertext links are often used by authors to create links to other points in a document: now even *that* is broken in the PDF version of the documents I retrieve from the web and print from FireFox (Broken in Safari 5.1.3 and earlier but fixed in 5.1.4).
    Try this on the PC, in your browser and print a news clipping as PDF, do the links in the PDF work? What products do this, and what don't? I would bet the machine with a full Adobe suite this will work flawlessly. (Why should a PC user have to pay hundreds of $ to create this functionality in what I thought was an open standard (PDF)? But that's talkin' religion, let's not start that.)
    Some folks might say,
    go online and find the original source doc in your browser. Or,
    go and add those links manually using the Preview edit add-link capability (hunh? no thanks) , or
    save each item worth saving as an HTML archive instead of a PDF (argh, creating a whole directory in the process, I might add, including ads). Or,
    who needs PDFs, everything is online.
    Or, buy some Adobe product.
    I think they miss my point. This is a real strange dumbing-down of archival PDF documents, or at least a destruction of the ability to use PDF as an archive that retains its links and references.
    C.F. the guy who has archives of scientific papers, and the old material all cross-references nicely but after date X there are no working links.

  • I can no longer send a Pages document.  When I click Share my Send Via Email is grayed out.  When I click on pdf or any format the pull down screen disappears and nothing happens.  Why?  I am using an iMac with Mountain Lion.

    I can no longer email a Pages document.  When I click Share my Share Via Email is grayed out.  If I click pdf the window disappears and nothing happens.  Any ideas?

    Do you have the application Mail as the default mail application?

  • A hyperlink click to a pdf document in a website does not open a pdf document instead presents a blank page "searching for bookmarks"

    a hyperlink click to a pdf document in a website does not open a pdf document instead presents a blank page "searching for bookmarks"

    Check the settings as shown in the [[opening PDF files within Firefox]] article.

  • Filling up a pdf form which I received as email. I opened it on my adobe reader 11 and filled up the highlighted fields. Yet when I click on the send via mail it says changes will not be included. How do I send the form with changes?

    Filling up a pdf form which I received as email. I opened it on my adobe reader 11 and filled up the highlighted fields. Yet when I click on the send via mail it says changes will not be included. How do I send the form with changes?
    The add annotations field shows as not allowed in the security options. So how do I send this form back with the changes??

    I think you you need to click 'save' first, then it is saved to acrobat, where it will prompt to send.

  • When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?

    When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?
    I need to be able to send it to a PC in order to print it.

    Hard to say what is happening without examining the file.
    If you like click on my blue name and email me both the .pages file and the the .pdf you have made from it.
    Peter
    ps It would help to say what version of Pages you are using and on what you are running it. iOS or Mac and what version.

  • I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    Hi mafiose15,
    Thanks for visiting Apple Support Communities.
    Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
    How to restore iPod
    Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
    Download and install the latest version of iTunes if necessary.
    Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
    After a few moments, your iPod will appear in the Source panel in iTunes.
    Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
    Click Restore.
    If you are using a Mac, you will be asked to enter an administrator’s name and password.
    A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
    Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
    Leave iPod connected to computer to complete restore (typically applies newer iPod models).
    During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
    Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
    After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
    You can find the instructions in this article:
    Restoring iPod to factory settings
    http://support.apple.com/kb/ht1339
    All the best,
    Jeremy

  • How to open hyperlink of PDF file uploaded at SharePoint(hosted at Office365) in 'Adobe Acrobat' for annotation and comments.

    Hi,
    I've a hyperlink of PDF file which is uploaded under SharePoint Document library(hosted at Office365 E1) on my custom '../SitePages/Approver.aspx'. Once user click on that hyperlink it should ask me to "Check-Out & Open' pdf file directly from sharePoint document library then it should automatically gets opened into 'Adobe Acrobat' where user will do some annotation/ comments in that pdf file & again 'Check-In' back his changes to SharePoint Document library.
    Following article will explain how I want to Check-In & Check-Out  pdf files from SharePoint document library once i click hyperlink on my '../SitePages/Approver.aspx' page.
    acrobatusers.com/tutorials/how-to-work-with-sharepoint-and-office-365
    Please let me know how to achieve this functionality using office 365.
    Your assistance would be greatly appreciated as this is top-priority requirement for us.
    Yours sincerely,
    Mahesh Sherkar
    [signature deleted by host]

    For instance, the forms.conf file:
    # Virtual path mapping for Forms Java jar and class files (codebase)
    AliasMatch ^/forms/java/(..*) "D:\Oradev/forms/java/$1"
    # Virtual path for JInitiator downloadable executable and download page
    AliasMatch ^/forms/jinitiator/(..*) "D:\Oradev/jinit/$1"
    # Virtual path for runform.htm (used to run a form for testing purposes)
    AliasMatch ^/forms/html/(..*) "d:\oradev/tools/web/html/$1"
    # Virtual Path for icons
    AliasMatch ^/forms/icons/(..*) "d:\icons/$1"
    ...you can move your files in one of the existing physical directories - e.g: d:/icons - and call them with the following:
    Web.show_Document('/forms/icons/document.pdf','_blank');But you can also add your own virtual/physical directory:
    # Virtual Path for documents
    AliasMatch ^/forms/documents/(..*) "d:\documents/$1"
    ...with the following code:
    Web.show_Document('/forms/documents/document.pdf','_blank');Francois

  • How to read Hyperlinks in pdf???

    hi developer's,
    I am in PDF processing... I am having doubt in that Processing.
    How to read Hyperlinks from PDF file?
    I can able to set the hyperlink.. But i cant able to get the hyperlinks..
    The following example program will set the hyperlink to the PDF file using lowagie API..
    import com.lowagie.text.Anchor;
    import com.lowagie.text.Chunk;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.Paragraph;
    import com.lowagie.text.html.HtmlWriter;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class Argu1 {
         public static void main(String[] args) {
              Document document = new Document();
              try {
                   PdfWriter pdf = PdfWriter.getInstance(document,
                             new FileOutputStream("PageLink.pdf"));
    PdfReader pdf_read=new                
                   document.open();
                   document.add(new Paragraph("Hi Everbody....!"));
                   Anchor pdfRef = new Anchor("Click Me");
                   pdfRef.setReference("www.java2s.com");
                   Anchor rtfRef = new Anchor("Touch Me");
                   rtfRef.setReference("www.sun.com");
                   System.out.println(rtfRef.reference());
                   document.add(pdfRef);
                   document.add(Chunk.NEWLINE);
                   document.add(rtfRef);
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              document.close();
    Help me how to read the Hyperlinks from the PDF file using java ...
    Thanks in advance,
    With Regards,
    J.Imran

    Instead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.

  • Hyperlink in PDF to relative file does not work

    I am creating PDFs from Java and the PDF contains a link to a relative file which is distributed along with the PDF. When the link is clicked, the file is opened with the OS default program (written by us). At least that is how it is supposed to work.
    How should links to relative files be formatted?

    Thanks for the reply Daterson! This could be a nice new feature for Adobe Reader, but our reports are cross format, so this solution should work in HTML as much as it does in PDF.
    I think this problem stems from the fact that launching a different application from a hyperlink in PDF is neither secure, nor cross platform. Therefore, I think the support for such an action doesn't exist in PDF, but also in other formats, which we would also like to support.
    If anyone comes across a clever idea or technique for this problem, I would love to hear it!

  • Hyperlinks in PDF doc stop working when emailed out in Mac Mail. Why?

    I have created a Pages document with hyperlinks and then saved it as a PDF.
    The PDF document retains the hyperlinks (they still work).
    When I attach the PDF to Mail and email it out the hyperlinks stop working unless I double click on the PDF document (which "opens it").
    Why? Help please as I want the hyperlinks to work when the email is received - ie. without double clicking on it. Thanks.

    First off, Word should show you the version on a splash screen when you launch it.
    Also, what happens to the links if you just open the document in Word and save it as a PDF?

  • Hyperlinks in pdf's from Word

    Can I create pdfs from Word with active hyperlinks in standard Acrobat?

    Hi Todd,
    PDFMaker is a Windows-only feature and unfortunately, there is no Acrobat Standard for Mac, only Acrobat Professional. 
    However, the attached document was authored in Word 2011 for Mac.  I converted it to PDF via File > Print > PDF > Save as Adobe PDF (steps outlined here.).  The full URL was recognized by Acrobat after the conversion and is live.  The second line was a hyperlink setup in Word, but unfortunately was not recognized since that data was not included in the PDF conversion nor is it an obvious link.  That said, you could use the 'Link' tool in Acrobat after the conversion to re-create that hyperlink.
    Please let us know if you have any questions.
    -David

  • Hyperlinks in PDF files

    We are having problems with hyperlinks in PDF files.
    When clicking on a link in a PDF file the following message appears:
    "The file and its viewer application are set to be launched by this PDF file. The file may contain programs, macros, or viruses that could potentially harm your computer. Only open the file if you are sure it is safe. If this file was placed by a trusted person or program, you can click Open to view the file."
    There is a box that says "Do not show this message again", but selecing this box does not stop this message from appearing next time.
    Is there any way to disable this notification??

    Hi Jakob,
    BlackPlum suggets: "Thankfully, I noticed that in the Export... dialog box, (from the File Menu), you can select "Current Sheet" in the Layout field (this field defaults to "All Sheets", it's easy to miss). So select Current Sheet, and voila, you now have a pdf with multiple pages (and clickable hyperlinks!)."
    Though my Export To ... PDF does not have such an option.
    Hope a solution will come soon.
    Numbers 3.1 with a very long table (will not fit on one page when printing) and two sheets.
    B2 contains  an active hyperlink.
    B32 contains an active hyperlink.
    Menu > File > Print >
    And on the right,
    Now click on Print...
    Now click on PDF (bottom left)
    Save as PDF
    Here is the PDF opened in Preview (zoomed out to make a smaller screen shot)
    Two pages .
    Both of those hyperlinks are active.
    Clicking on this one:
    takes me to
    apple.com/sitemap.
    (Proof coming in my next reply. Having trouble with posting the screen shot.)
    Regards,
    Ian.

  • Hyperlinks to PDF files only work in Preview

    I cannot get any of my hyperlinks to PDF files to work in my
    ouput WebHelp file. The links work fine in Preview, but not in the
    actual output. And the files have been added to the baggage folder,
    and can be seen in the Baggage folder. Any help would be greatly
    appreciated.
    Thanks!

    Hi Retso
    Sorry for not replying earlier. I've been conducting a
    RoboHelp HTML class all day.
    Are you using RoboHelp HTML 6? If so, there is a new option
    labeled "Mark of the web" that could be nailing you. When you
    generate your WebHelp by double-clicking the layout, see if this
    option is enabled. If so, disable it and your PDF links should
    begin working. Note, however, that by DE-selecting this option, you
    could start seeing the Yellow Information bar as Internet Explorer
    ever so helpfully deems this as a security threat and blocks your
    WebHelp until you click it and allow the content to be shown.
    Cheers... Rick

  • How do I get working hyperlinks in PDF files?

    Hyperlinking procedures as laid down by Pages 09 work.  Conversion fromPages format to PDF format work - in principle.  But when one clicks on created hyperlink in PDF file, nothing happens.  So, no one outside of the working Pages community can go further.  Suggestions?  Thanks.

    Pages '09 ≠ Pages 5.01.
    You have the bugs and reduced features of Pages 5, the version you recently installed.
    Pages '09 should be in your Applications/iWork folder.
    Use that instead.
    Peter

Maybe you are looking for

  • Strange File in Modem Scrips

    I was exploring various folder yesterday and came across a strange file in the /Library/Modem Scripts folder. The file is a Unix Executable File. The file name is Zoom Universal. Anyone know what this file is and why it's there. None of the other mod

  • How to hide a portlet in a portal application

    Hi, there, I want to implement a scenario that restrict specific group of users to access specific portlets based on the users' role. For example, suppose that some portlets labelled A1, A2, B1, B2 and B3. Group A users can only access A1 and A2; whe

  • Web server and apex running on same machine - port 8080 possible conflict

    Hi Guys, I have installed Apache Tomcat and currently in the process of installing Oracle 11G in the same machine. The tomcat is using port 8080 and I understand from other installs, that APEX uses 8080 as well. Is there way after installing Oracle 1

  • Oracle HRMS Discoverer Custom Reports Details

    Hello Everyone, I am looking out for the custom Discoverer report listing in Oracle HRMS modules (specifically Core HR, OAB and OTL). Can anyone help me out to get the list of ONLY custom discoverer report in above modules ? Kindly send me the excel

  • Mail is crashing when I open it. Lion 10.7.2

    I am hoping it is not a long message I already deleted one today that no-one had snipped. therefore there were three copies of the message each including a large photo. I thought I had deleted it from the page on the gmail account webpage. But Mail i