Copy link to clipboard
Copied
Hi All,
I'am learning to use the fdk , wanted to know if its possible to get all the tags present in the active frame document can someone point me out to a function or a snippet to do this ? Lost in the sea of functions.Trying to generate the conversion table programatically.Any help is much much appreciated.Thanks in advance.
[Moved to Scripting forum by moderator]
Copy link to clipboard
Copied
Have a look over in the Scripting forum.
Copy link to clipboard
Copied
Hi,
You can have a look at a utility shared at ExtendScript of the Week: “Change Styles – (Para/Char/Table)” « TechComm Central by Adobe
You will get the desired code snippet to get a list of all tags from here.
Regards,
Anchal
FM Engineering
Copy link to clipboard
Copied
Thank you so much Anchal , I'll take a look at this
Copy link to clipboard
Copied
Apoorva, this is a reasonable task for an FDK client, but it is not for the beginner. You can get the first paragraph format with the following, where docId is a valid document F_ObjHandleT handle:
F_ObjHandleT pgfFmtId;
StringT pgfFmtName;
pgfFmtId = F_ApiGetId(FV_SessionId, docId, FP_FirstPgfFmtInDoc);
//then you can get the format name with:
pgfFmtName = F_ApiGetString(docId, pgfFmtId, FP_Name);
//then you can get the next format with:
pgfFmtName = F_ApiGetId(docId, pgfFmtId, FP_NextPgfFmtInDoc);
...but as I say, the full implementation of conversion table generation is a significant and complicated task. You really have to know a lot about a lot of FDK things.
I'll mention this... the GUI provides a function to do this already, StructureTools > Generate Conversion Table. Can you just use that? I think you should be able to invoke this programmatically as well, so maybe there is no need to reinvent the wheel here.
Russ
Copy link to clipboard
Copied
Hi Russ,
Thanks a ton for the reply, however I did see another discussion your answer has been very useful here also.
Re: FDK - apply Conversion Table to document
But all i need is a program structure i cant get started with this since i do not know where to begin or which sample to look at , perhaps something like the ones in the samples directory of fdk , can you help me with the structure ?
Copy link to clipboard
Copied
Apoorva,
Do you have Visual C++ installed? This is your first step. You'll need VC++ 2010 for the latest versions of FM and the FDK. You can get VC++ 2010 Express for free that will compile an FDK client. Then, maybe open some of the FDK samples and begin to experiment. There is a big learning curve here if you have never worked in a development environment before.
You might consider ExtendScript instead. It is much easier for the beginner and it can do quite a lot. Consider getting some samples and playing around:
FrameMaker ExtendScript Samples - West Street Consulting
Russ
Copy link to clipboard
Copied
Thanks Russ,
I have VS2010 and i executed a few samples of fdk .With extensscript is it possible to convert from fm to xml? This is a small snippet of code that i tried ,from the fdk programmers guide.But somehow not executing fully dont really know what the error is
inputDocId = F_ApiSimpleOpen((StringT)"D:/FrameTest/abc.fm", False);
ruleTblDocId=F_ApiSimpleOpen((StringT)"D:/FrameTest/new_conv.fm", False);
if (!inputDocId || !ruleTblDocId)
F_ApiAlert((StringT)"Couldn’t open.",FF_ALERT_CONTINUE_NOTE);
else
{
F_ApiCallClient("Structure Generator", "inputDocId");
F_ApiCallClient("Structure Generator", "ruleTblDocId");
F_ApiCallClient("Structure Generator", "D:/FrameTest/new_doc.fm"); // this line not working i suppose
F_ApiCallClient("Structure Generator", "StructureDoc");
}