Skip to main content
Participating Frequently
December 19, 2018
Answered

I want to reference / edit embedded go-to action.

  • December 19, 2018
  • 2 replies
  • 1137 views

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

This topic has been closed for replies.
Correct answer Thom Parker

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.

2 replies

Thom Parker
Community Expert
December 19, 2018

I think Leonard is saying you need to use the COS level functions to get at and change the details.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
lrosenth
Adobe Employee
Adobe Employee
December 19, 2018

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…

Participating Frequently
December 20, 2018

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.

Thom Parker
Thom ParkerCorrect answer
Community Expert
December 20, 2018

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.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often