-
1. Re: Display tags of a frame document in an alert box using FDK
Jeff_Coatsworth May 14, 2015 5:47 AM (in response to Apoorva Sridharan)Have a look over in the Scripting forum.
-
2. Re: Display tags of a frame document in an alert box using FDK
anaroraMay 14, 2015 6:02 AM (in response to Apoorva Sridharan)
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
-
3. Re: Display tags of a frame document in an alert box using FDK
Russ Ward May 14, 2015 6:03 AM (in response to Apoorva Sridharan)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
-
4. Re: Display tags of a frame document in an alert box using FDK
Apoorva Sridharan May 14, 2015 7:27 AM (in response to anarora)Thank you so much Anchal , I'll take a look at this
-
5. Re: Display tags of a frame document in an alert box using FDK
Apoorva Sridharan May 14, 2015 7:31 AM (in response to Russ Ward)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 ?
-
6. Re: Display tags of a frame document in an alert box using FDK
Russ Ward May 15, 2015 5:16 AM (in response to Apoorva Sridharan)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
-
7. Re: Display tags of a frame document in an alert box using FDK
Apoorva Sridharan May 15, 2015 9:14 AM (in response to Russ Ward)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");
}