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

Community Beginner ,
Dec 18, 2018 Dec 18, 2018

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

TOPICS
Acrobat SDK and JavaScript

Views

293

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Dec 20, 2018 Dec 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.

Likes

Translate

Translate
Adobe Employee ,
Dec 19, 2018 Dec 19, 2018

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…

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 19, 2018 Dec 19, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Dec 20, 2018 Dec 20, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 20, 2018 Dec 20, 2018

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.

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

LATEST

thank you everyone.

I understood how to do it.

test.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 19, 2018 Dec 19, 2018

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.

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines