Copy link to clipboard
Copied
Hello
I am creating an application in C ++ using Acrobat SDK.
In Japan, we developed d-LinkMaker (www.d-sols.com). However, there are still incomplete places.
I want to reference / edit embedded go-to action.
Please tell me how to read the file name of embedded document.
if (PDActionGetSubtype(pdAction) == ASAtomFromString( "GoToE" )){
ASInt32 destPage;
ASAtom fitType;
ASFixedRect destRect;
ASFixed zoom;
PDViewDestination pdViewDest = PDActionGetDest(pdAction);
if (PDViewDestIsValid(pdViewDest)) {
PDViewDestGetAttr(pdViewDest, &destPage, &fitType, &destRect, &zoom);
} else {
*
*
*
}
//********************************************************
PDFileSpec filespec = PDActionGetFileSpec(pdAction); // No good
CosObj coAction = PDActionGetCosObj(pdAction);
CosObj coFIL = CosDictGet(coAction, ASAtomFromString( "N" )); // No good
//*******************************************************************************
}
1 0 obj% Link to a child
<< /Type /Action
/S /GoToE
/D (Chapter 1)
/T << /R /C
/N (Embedded document) >>
>>
endobj
2 0 obj% Link to the parent
<< /Type /Action
/S /GoToE
/D (Chapter 1)
/T << /R /P >>
>>
endobj
3 0 obj% Link to a sibling
<< /Type /Action
/S /GoToE
/D (Chapter 1)
/T << /R /P
/T << /R /C
/N (Another embedded document) >>
>>
>>
endobj
The Acrobat SDK does not contain high level API objects and functions for every part of the spec. Instead it provides functions for manipulating the PDF at the low level, i.e. COS. So your code needs to be a mix of the two. Use PDAction and PDNameTree APIs to get the objects of interest, the use COS to get at and modify the details of the specific objects.
Copy link to clipboard
Copied
GoToE actions are one place that you will need to do the heavy lifting yourself…
You can use PDActionGetDestinationName() to get the value of N from the Action dictionary – but then it’s entirely up to you to work with the EmbeddedFiles name tree to find the right one…
Copy link to clipboard
Copied
Thanks for the reply.
But what is PDActionGetDestinationName ()?
It is not found in the PDF Library API Reference.
Maybe, is there an Adobe PDF Library?
I am developing only with Acrobat DC SDK.
Copy link to clipboard
Copied
Maybe it's Adobe internal. Trivial to do anyway. The API which will save you a lot of work is PDNameTree.
Copy link to clipboard
Copied
The Acrobat SDK does not contain high level API objects and functions for every part of the spec. Instead it provides functions for manipulating the PDF at the low level, i.e. COS. So your code needs to be a mix of the two. Use PDAction and PDNameTree APIs to get the objects of interest, the use COS to get at and modify the details of the specific objects.
Copy link to clipboard
Copied
thank you everyone.
I understood how to do it.
Copy link to clipboard
Copied
I think Leonard is saying you need to use the COS level functions to get at and change the details.