Skip to main content
Participating Frequently
March 24, 2010
Answered

FDK - apply Conversion Table to document

  • March 24, 2010
  • 2 replies
  • 693 views

Hello,

I want to be able to apply a conversion table to an open document, through FDK.

Is there a way of calling the "Structure Current document..." command from the client and pass it a filepath, so that it opens the Conversion table document and applies that to the current document?

I want to be able to pass the filepath to the command automatically without displaying the dialog box.

I appreciate any help!,

Thanks in advance,

pnk

This topic has been closed for replies.
Correct answer Russ Ward

Hi pnk,

Yes. It is in the chapter of the FDK ref called "Calling Clients Shipped with FrameMaker." The conversion table process is actually handled by another API client called the Structure Generator, and you'll need to make calls to it. However, in the latest FDK ref I have, I believe that the syntax in the documentation is wrong. I'll copy/paste the operative parts below, substituting the syntax that I know works. Note that you need to have all documents open with their IDs captured... you can't simply send a file path.

To execute most operations with FrameMaker clients, you must make a sequence of several
F_ApiCallClient() calls.


To structure a document, use the following sequence of F_ApiCallClient() calls:

F_ApiCallClient("Structure Generator", "INPUTDOCID objectID");
...where objectID is the ID of the input document.


F_ApiCallClient("Structure Generator", "RULEDOCID objectID");
...where objectID is the ID of the rule (conversion) table document.


F_ApiCallClient("Structure Generator", "OUTPUTDOCNAME pathname");
...where pathname is the full pathname of the output document. This command is optional. If you do
not specify a pathname, the structure generator leaves the document unsaved and open.

F_ApiCallClient("Structure Generator", "StructureDoc");
...This call instructs the structure generator to generate structure, using the parameters provided by the
calls listed above.

pnk, this is Russ again. So, for example, to make the call where you send the ID of the document you want to structure, you would do something like:

UCharT msg[1024];

F_ObjHandleT docId;

. . . code to get docId, etc . . .

F_Sprintf(msg, "INPUTDOCID %d", docId);

F_ApiCallClient("Structure Generator", (StringT)msg);

. . . rest of calls, etc . . .

Hope this helps.

Russ

2 replies

Bubbly_Crystal0D4D
Participating Frequently
May 14, 2015

Hi ,

I'm a newbie trying to attempt the same thing.Can you share a sample or a snippet of code that helps me get started with this? I looked at the reference guide but could'nt get a correct structure any example that does this would do .

Thanks in advance!

Russ WardCorrect answer
Legend
March 25, 2010

Hi pnk,

Yes. It is in the chapter of the FDK ref called "Calling Clients Shipped with FrameMaker." The conversion table process is actually handled by another API client called the Structure Generator, and you'll need to make calls to it. However, in the latest FDK ref I have, I believe that the syntax in the documentation is wrong. I'll copy/paste the operative parts below, substituting the syntax that I know works. Note that you need to have all documents open with their IDs captured... you can't simply send a file path.

To execute most operations with FrameMaker clients, you must make a sequence of several
F_ApiCallClient() calls.


To structure a document, use the following sequence of F_ApiCallClient() calls:

F_ApiCallClient("Structure Generator", "INPUTDOCID objectID");
...where objectID is the ID of the input document.


F_ApiCallClient("Structure Generator", "RULEDOCID objectID");
...where objectID is the ID of the rule (conversion) table document.


F_ApiCallClient("Structure Generator", "OUTPUTDOCNAME pathname");
...where pathname is the full pathname of the output document. This command is optional. If you do
not specify a pathname, the structure generator leaves the document unsaved and open.

F_ApiCallClient("Structure Generator", "StructureDoc");
...This call instructs the structure generator to generate structure, using the parameters provided by the
calls listed above.

pnk, this is Russ again. So, for example, to make the call where you send the ID of the document you want to structure, you would do something like:

UCharT msg[1024];

F_ObjHandleT docId;

. . . code to get docId, etc . . .

F_Sprintf(msg, "INPUTDOCID %d", docId);

F_ApiCallClient("Structure Generator", (StringT)msg);

. . . rest of calls, etc . . .

Hope this helps.

Russ

pnk80Author
Participating Frequently
March 26, 2010

Hi Russ,

Thanks much for the prompt response and the info!  It works like a charm!!

Greets,

pnk