GetContents() Annotation link

Hello

I have some problem to get the path of the links inside a PDF document, it returns null, while the Annotation is not null and is the subtype 'Link '.

Here is my code, mApp is of type CAcroApp and I have already opened the document.

Thank you for any input, that is:

for each doc

for (int docCounter = 0; docCounter < mApp.GetNumAVDocs (); docCounter ++)
{

avDoc = (CAcroAVDoc) mApp.GetAVDoc (docCounter);

pdDoc = (CAcroPDDoc) avDoc.GetPDDoc ();

MessageBox.Show ("Document" + docCounter + "pages" + pdDoc.GetNumPages ());


For each Page
for (pageCounter int = 0; pageCounter < pdDoc.GetNumPages (); pageCounter ++)
{

My page CAcroPDPage = (CAcroPDPage) pdDoc.AcquirePage (pageCounter);
for (int annotationCounter = 0; annotationCounter < myPage.GetNumAnnots (); annotationCounter ++)
{
CAcroPDAnnot myAnnotation = (CAcroPDAnnot) (myPage.GetAnnot (annotationCounter));
subtype string = myAnnotation.GetSubtype ();

If (subtype is 'Link')
{
totalLinksCounter ++;
Links = myAnnotation.GetContents ();
}

}

}
}

The destination of a link is NOT its content.

There is no API exposed through COM interfaces to retrieve the destination of a link, because a link annot can have different forms of destinations, not to mention also supported stocks.

Tags: Acrobat

Similar Questions

  • Change the "link" / "start" annotation "Link" / "URI" and update of target of the action.

    I have thousands of PDF files that are uploaded to a web server. The files have annotations in them that a subtype is the 'link' and that under action type is "start".
    This is because that previous files are included on a CD, so all paths were based on locations on the CD.

    I was able to successfully retrieve all annotations with the following:

    First, get the annotation with the specified number (i2) of the specified page (page):

    ...

    Annot = PDPageGetAnnot (page, i2);

    ...

    Then check if an annotation is valid with:

    ...

    If (PDAnnotIsValid (annot))

    {
    ...

    Next, I check to see if the annotation is an annotation to link with:

    ...
    If (PDAnnotGetSubtype (annot) is ASAtomFromString ("Link"))

    {

    ...

    I then create the PDLinkAnnot object and retrieve the PDAction object in the annotation like this:

    PDLinkAnnot linkAnnot = CastToPDLinkAnnot (annot);
    PDAction action = PDLinkAnnotGetAction (linkAnnot);

    ...

    Then I create the CosObj for the action and the dictionary entry get for the F key with this:

    ...

    CosObj cosAction, cosActionDictionaryEntry;

    cosAction = PDActionGetCosObj (action);

    cosActionDictionaryEntry = CosDictGet (cosAction, f);

    ...

    Then, I create a tank and a CosObj for the name of the file and get the F key

    ...

    CosObj fileName = CosDictGet (cosActionDictionaryEntry, f)

    Int32 bytes;

    char * filePath = CosStringValue (fileName, & bytes);

    ...

    Then this part everything works and I am able to get the path of the target file, but I need to change the annotation subtype 'URI' instead of 'Launch' link for, and I need to update the dictionary with a new path.

    Assuming that the new path is stored in a char * called newPath, how can I do this?

    Thank you.

    Well have the answer!

    I can't directly set the subtype of a string value.

    Here is the final code that worked.

    CosDoc cosDoc = (currentPDDoc) PDDocGetCosDoc;

    CosDictRemove (cosActionDictionaryEntry, f);

    CosDictPut (cosActionDictionaryEntry, ASAtomFromString ("URI"), CosNewString (cosDoc, false, "http://www.mysite.com/test.pdf", strlen ("http://www.mysite.com/test.pdf")));

    CosDictRemove (cosAction, f);

    ASAtom newActionSubTypeName = ASAtomFromString ("URI");

    CosObj newActionSubTypeCosObj = CosNewName (cosDoc, newActionSubTypeName, false);

    CosDictPut (cosAction, ASAtomFromString ("S"), newActionSubTypeCosObj);

    CosDictPut (cosAction, ASAtomFromString ("URI"), cosActionDictionaryEntry);

    NewAction PDAction = PDActionFromCosObj (cosAction);

    PDLinkAnnotSetAction (linkAnnot, newAction);

    Annot = CastToPDAnnot (linkAnnot);

    Hope this helps someone who had a similar problem.

  • How to create link annotation on a particular word to PDF?

    Hello

    I'm creating a plugin in Acrobat 9. The plugin must find a text to PDF and create a link to this topic annotation.

    I use PDWordFinder to find the text in the pdf file. But I am unable to create the annotation link as create an annotation requires the ASFixedRect object.

    Can anyone help me how can I get object ASFixedRect of a word especially in pdf format to create a link annotaion on it?

    Thank you

    As I've already said:

    When you use the word finder, you can get the quad for each word.

    A quad is now the corners of four shape faces - not necessarily a rectangle. But if you make the smallest rectangle that surrounds the quad, it's the best that you can make a rectangular link.

  • How to remove hidden links (how to remove the links, ONLY the hidden parts of the document)

    in Acrobat XI-> after deletion "text hidden" using the tool 'Remove hidden information'-> links still remain in the hidden passage / cropped -> so the real question is - HOW TO REMOVE THE LINKS HIDDEN in a PDF. An approach may be to remove 'links, Actions and Javascripts' tool 'Remove' hidden information - BUT it removes links TO the WHOLE OF the DOCUMENT - "how to remove the links, ONLY the hidden parts of the document"

    Hidden text is the collection of glyphs in the PDF page using the text rendering mode 3 (no terms, no fill).

    The links set up in connection with this hidden text are not 'hidden' (this isn't how it works with annotations PDF link - see ISO 32000-1: 2008).

    Any link annotation placed in a PDF file are the same as any other annotation link (with the exception, of course, of whatever Action the link happens to).

    Thus, no special sauce for the links that were placed in conjunction with now deleted "no hidden text.

    In the context of what you wrote, maybe it's you select - Ctrl + click the link annotations of interest and press the delete key.

    Be well...

  • Copy links

    The first page of my document to pdf is a "laundry list." Each item in the list of laundry page contains links to another page. Each page (135 pages) links back to the page list of laundry. When I replace my list of landry with a update page page, I lose all my links go both directions. Is it possible to copy the original links to my new page laundry list? I use Acrobat X Pro.

    Thank you

    Randy

    Replace the page via the Page Navigation panel and all your annotations/links/buttons will remain in place.

  • Keep links to images in the pdf conversion

    Hello

    I installed the Acrobat Pro trial using Word 2007 on my computer (Windows xp).


    The Word file, I have a lot of links on the pictures. When I click on one, it pushes me on a title later in the file.

    After you have converted this file to PDF with Acrobat Pro trial plugin in Word 2007, one link is still running. 90% of the others have disappeared and others have changed their destination.

    I have not really any idea of walkthrough because I don't know what the problem is. I also have links on a few words on this file and everything works perfectly.

    Y at - it someone help me, please? I looked on many forums but I found nothing.

    Thank you

    (Please don't bother my mistakes, I'm french and I do not use English language.)

    Link Acrobat tool to place an annotation to link on the desired text string.

    With Acrobat 9, open the toolbar of peak edits.

    With Acrobat X, open the Toolbox, view the content pane and select the link tool.

    Return to the word; play with how place you a hyperlink in Word on/in the image.

    When the hyperlink is tuck place treated against the frame of the image annotation link PDF output can become the place under the x-object image.

    Use one of the "oops" to output PDF to play as well with.

    Go to the content panel. Select text next to an image.

    Now, use the menu of the content panel to 'find content selection '.

    In addition, in the menu options, select "highlight the content.

    Expand tree in the content panel and move the top/bottom of the tree where the point is highest.

    You can scramble the positions of the elements in the tree to assign a happy ending .

    Be well...

  • Why I can't select the text in this pdf file

    Hello

    https://rapidshare.com/files/461732149/cannot_select.PDF

    I can't select text. When I try to select text, the cursor looks like a helping hand. It seems that there is a layer above the text. But when I use the Editor tool, I do not see any layer above the text. Is it possible to change the pdf file so that I can select some text?

    In fact, you should be able to select the text with the Touchup text tool if the annotation link is here or not. What is the tool you use?

    If you want to remove links, you can use the correction before the flight "to dispose of invalid links. At least the link in the sample document is not valid, because there is no action defined for it. You can also use the correction of 'Delete all annotations' to remove all the links that are present, even though you can edit or create a new correction to remove link annotations only.

  • "Tag Annotations - has no" links in footers

    Hi all the expensive accessibility experts.

    I have notes on the master page that contains links to cross reference, I want it to be clickable, but showing not labeled annotations-failed error, is it possible?

    (I did the artifacts of notes, but I want to keep the link in the notes)

    I think maybe I can treat PDF upstream of acrobat, but if I remove all annotations from links it will also affect the index and table of contents that I created, so I can not...

    I have been researching but can't find that everything about my question.

    Any help would be appreciated!

    Thanks in advance!

    Ah ok. Unfortunately, I don't know a good solution to this common problem. The usual advice is to not to put links repeating footers. But most of the time, I do not have the documents that I have correct, and if the owner of the document insists on a link in the footer I have to find a way to deal with it. An awkward fix, kludgey must include the link annotation in the structure of the tag, but hide under a label with a space for the actual text character. Alternatively, live with the error if it is an option. Sorry - it's the best I have.

    a 'C' student

  • strange behavior of link with OC assigned annotations

    I'm generating PDFs using a PDFL application I wrote. Link annotations are Act strangely when they are assigned to an o with the key of the OC. The behavior differs between Reader and Acrobat.

    In Reader, the hand tool slider meets the State of OC as expected. When the o is on the tool shows the link as being active. When you click on the link is highlighted, and the link to the action is executed. When the o is off the cursor indicates the inactive link. However, if the user clicks, highlights the link and the link to the action is executed.

    In Acrobat, the link is still active, regardless of the State of the o.

    I have a PDF file created with a much older version of this application that has links that behave normally. I got a chance to try to understand the difference between PDF files or code. The fact that the State of the cursor is at least correct in Reader and correct behavior of crime generally argues that optional content must be built correctly. I see no significant difference in the dictionaries of the annotation.

    Where should I look? We never seen anything like this? Any ideas would be very appreciated.

    TIA,

    Alan

    Workaround: Add a link annotation that is not asked to avoid the bug.

  • Add annotations when you create a linked clone

    Hi all

    I am currently struggling with a script that should be able to add an annotation to a clone linked after its creation. To create a linked clone, I use the vmlinkedclone.pl script (source here: http://pastie.org/5114877 ), with a bit of modification to my needs feet. On the other hand, I have a script that writes an annotation on a specified, virtual computer writedescription.pl (source here: http://pastie.org/5114881)

    Now the problem is that my script that write annotations on a specified, virtual computer takes the name of the virtual machine as a parameter, I want to avoid. So, what I want to do is to "mix" my vmlinkedclone script and my writedescription script, so I can dynamically add an annotation after creating a clone (the annotation is a parameter in the script).

    However, as you can see on my writedescription script, I'm working on a view of a virtual machine, while on my vmlinkedclone script, I have no opinion on the clone, I have yet nothing about it, read the 250 on the vmlinkedclone pastie line. So my question is fairly simple: how could I get a view of my newly created clone, so I can easily fit my other script to add an annotation to the clone via the vm_id parameter?

    Thank you very much

    It actually returns the new ManagedObjectReference of VM, you must call get_view() on it to get the actual VM and its properties.

    Take a look at the quick example I have attached.  It shows how to retrieve and convert the result of ManagedObjectReference with CloneVM_Task() and CloneVM() in a VirtualMachine entity.

    $ perl CloneVMExample.pl--username=administrator@vlab--server = 172.16.254.50 - password = VMware1! -vmname = SourceVM - dcname = DC01
    New machine virtual 'CloneVM () - Test' cloned successfully at CloneVM().
    CloneVM_Task() completed successfully.
    New machine virtual 'CloneVM_Task () - Test' cloned successfully at CloneVM_Task().
  • Enter the JavaScript Code in JavaScript Action of link Annotation dictionary

    Hello

    It is for the plugin Dev with Acrobat SDK (XI) in C++

    having problem to get Javascript code into my cosdict of javascript action.

    (If you're wondering, yes I read the reference PDF and Acrobat SDK - livedocs, samples, and QAnywhere ^^ but I am new to Acrobat Dev and C++)

    I can't understand how to correctly create the dictionaries of the action (it was necessary for the subtypes "JavaScript" and "GoToE")

    and then re-branded to existing annotations (subtype 'link', old action is "URI").

    PDF reference, I would say I need to "S" and "JavaScript" key in my CosDict.

    If I just wrote: (myPDDoc is my open PDF Document)

    NewAction PDAction is PDActionNew (myPDDoc, ASAtomFromString ("JavaScript"));.

    PDLinkAnnotSetAction (annot, newAction);

    in Acrobat, can I get a link-JavaScript Annotation - but no code (this is why it is not included).

    If I try to build the dictionary I get a broken action or the same result without javascript code.

    NewAction PDAction is PDActionNew (myPDDoc, ASAtomFromString ("JavaScript"));.

    CosDoc myCosDoc = (myPDDoc) PDDocGetCosDoc;

    CosObj cosAction = CosNewDict (myCosDoc, false, 3);

    cosAction = PDActionGetCosObj (newAction);

    String jsText = "here comes my javascript code.   It comes to std::string

    CosDictPut (cosAction, ASAtomFromString ("S"), CosNewName (PDDocGetCosDoc (myPDDoc), false, ASAtomFromString ("JavaScript")));

    CosDictPut (cosAction, ASAtomFromString ("JS"), CosNewString (PDDocGetCosDoc (myPDDoc), false, jsText.c_str (), 0));

    newAction = PDActionFromCosObj (cosAction);

    PDLinkAnnotSetAction (annot, newAction);

    What is the correct way for the construction of the cosDicts action?

    Are there examples for these dicts. or linkAnnotations generally?

    Because the livedocs for textAnnotation example but not enough to linkAnnotation.

    OK Please forgive me, got the answer myself.

    CosDictPut (cosAction, ASAtomFromString ("JS"), CosNewString (PDDocGetCosDoc (myPDDoc), false, jsText.c_str (), 0));

    must be

    CosDictPut (cosAction, ASAtomFromString ("JS"), CosNewString (myCosDoc, false, jsText.c_str (), jsText.length ()));

    Feel a little stupid, had in mind that this number is optional and can be 0.

  • Convert all the annotation GotoPage links javascript - need help

    Hi all

    I have a large document and my requirement is to find a set of words and add gotopage link to a particular page (index page). I recently got a file of Acrobat (http://acrobatusers.com/content/find-highlight-words-and-phrases) user group who has find and highlight a set of words using Acrobat action action.

    This action is to "search for and remove text" action that will search for and delete selected text and a javascript to add the highlight of yellow color.

    I changed the javascript code associated with this action in the following so that the script will find all payments made and convert in the Gotopage links and destroy annotations after you create the links.

    I tried these steps in the following code:

    1. Find annotations
    2. Get the four value
    3. SetLink to page
    4. Destroy to delete annotations

    I'm new to javascript and I read the javascript reference as much I could and tried as much as possible. But this script does not work and I couldn't identify what's not in the present.

    Please, help me run this code.

    for (var p = 0; p < this.numPages; p++)
    {
    //var numWords = this.getPageNumWords(p);
    var numWords = this.getAnnots(p,{sortBy:"Author"});
    for (var i=0; i<numWords.length; i++)
    {
    var ckWord = this.getPageNthWord(p, i, true);
    if ( ckWord.type == "Redact")
    {
    var q = this.getPageNthWordQuads(p, i);
    // Convert quads in default user space to rotated
    // User space used by Links.
    m = (new Matrix2D).fromRotated(this,p);
    mInv = m.invert()
    r = mInv.transform(q)
    r=r.toString()
    r = r.split(",");
    l = addLink(p, [r[4], r[5], r[2], r[3]]);
    l.borderColor = color.red
    l.borderWidth = 0
    l.setAction.("this.pageNum = 243");
    }
    }
    }
    var annots = this.getAnnots();
    for (var i = 0; i < annots.length; i++)
    if (annots[i].type == "Redact") annots[i].destroy();
    

    If you want to use the same code, but just a single page (25) research, change this line of code to:

    for (p = 25 variety; p)< 26;="">

    Otherwise, you can remove the outer loop entirely and set the variable p 25 at the beginning of the script.

  • Export link in XFDF Annotation

    Hello

    I develop a plugin for Adobe Professional who needs to export all annotations in a xfdf format. All annotations are get exported correctly, except the link annotation. When I create a link annotation and other annotations to a pdf file, and then click comments-> menu item to summarize the comments, a new list containing annotations pdf is created. But the list does not link annotation. Can someone please help me explaining this behavior of acrobat.

    Thanks in advance!

    Because the links are considered to be a special annotation type and therefore not included in XFDF - only of markup/comment annots are included.  It is also why you see no video, Audio or 3D annotations there either.

  • Change color of the annotation of link before...

    Dear all,

    Can anyone know how to change a forecolor of the annotation of specific link through SDK.

    normally the links in a PDF are represented in blue with an underline... now I need to change the style of all the links in the PDF file

    Use PDAnnot to extract the link annotation after extraction is trying to use the PDAnnotationSetColor function, but am not able to see the color change that reflected in the document.

    Help, please

    The respect of

    Amith Sai

    fillColor

  • Why is youtube annotations in videos not working do not?

    Boxes of annotations in videos at the links and subscribe are not to stand, but his work on chrome and IE. The only annotation showing is the label of the channel to the top in the right corner then why is that and what is the solution?

    You are welcome

Maybe you are looking for

  • Add drive imac

    I have an imac (27 inch, mid-2011), processor: 3.4 GHz Intel Core i7. I am interested in adding another internal hard drive to the computer.  Is this possible?  I heard some CD players for laptops can be removed and replaced with an internal hard dri

  • When I open a new window, an additional blank tab opens in the new window.

    The problem started when I reset my new page.Because the two legs were open, she defined the second tab in the home page.When I noticed this, I reset (choice between bookmarks) with a single tab.Unfortunately, it continues to open two tabs, whenever

  • Pandora for model sony bdp-s580

    I have connected to netflix, Slacker. Now try to connect to pandora no chance. I thought I had tried everying, but nothing helps, any suggestions.Thank you

  • HP LaserJet CP1215: cp1215

    I have a document hit in Quebec, even if I cancel / remove several times, he is still there and I can not print anything else afterwards. Can someone help me with this? Thanks in advance.

  • jQuery selector - not()

    Hello I'm trying to implement the "shortcut keys." I don't want to fire access keys when I type in an input field. Currently I have an input field: I tried the following methods to capture the keypress. However, the pressure is still captured during