I need to create a link to the selected text so that when I click on it a certain page opens in the browser.
I created a PDAnnot object
PDAnnot annot = PDPageCreateAnnot (page, ASAtomFromString ("Link"), & fr);
Now, as I understand it, I need to add an action to this object - PDAction. But I don’t know how to do this. There is no such example in the Acrobat DC SDK in Documentation and in projects.
Help me, please.
Are you trying to embedd a URL in the PDF document, that when the user clicks on it, it will redirect to a webpage outside of the document and viewed in a default browser?
I need a 2nd. To embedd a URL in the PDF document
See if PDF Open Parameters reference helps. See here:
Looks like we're talking about different things. I'm talking about creating an addin application based on Visual C ++, you are talking about working with Acrobat Reader as a user.
Ok, got it.
See if these other threads can assist you:
Thanks. Everything worked out. I used the library sample https://github.com/datalogics/adobe-pdf-library-samples/blob/master/CPlusPlus/Sample_Source/ContentM... (Step 3). But, I had to slightly correct the code: replace the operator
PDAnnot URIAnnot = PDPageCreateAnnot (page1, ASAtomFromString ("Text"), & annotLocation);
to the operator
PDAnnot URIAnnot = PDPageCreateAnnot (page1, ASAtomFromString ("Link"), & annotLocation);
and delete the operator
CosDictPutKeyString (URILinkObj, "Subtype", CosNewNameFromString (inputDocCosDoc, false, "Link"));
After that, the code worked.
And you're welcome. Happy to know that it helped Sir.