• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Display tags of a frame document in an alert box using FDK

Explorer ,
May 13, 2015 May 13, 2015

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]

TOPICS
Scripting

Views

415

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 Expert ,
May 14, 2015 May 14, 2015

Copy link to clipboard

Copied

Have a look over in the Scripting forum.

Votes

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
May 14, 2015 May 14, 2015

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

Votes

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
Explorer ,
May 14, 2015 May 14, 2015

Copy link to clipboard

Copied

Thank you so much Anchal , I'll take a look at this

Votes

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
Mentor ,
May 14, 2015 May 14, 2015

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

Votes

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
Explorer ,
May 14, 2015 May 14, 2015

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 ?

Votes

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
Mentor ,
May 15, 2015 May 15, 2015

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

Votes

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
Explorer ,
May 15, 2015 May 15, 2015

Copy link to clipboard

Copied

LATEST

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");

  }

Votes

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