Skip to main content
Arnis Gubins
Inspiring
Feb 4, 2015 4:16 PM UTC
Answered

How to access the Publisher module

Does anybody know if the Publisher module is exposed to FM's Extendscript (or FDK)? I looked through all of the scripting info and the FDK info, .h and config files and couldn't find any references to it other than the TPUBforFMDoc (Book/DITA  esc ph shortcut) command. I need to kick off the Publish module after some manipulation and use a specified STS file depending upon the manipulation.

This topic is closed to new replies. Start a new post to keep the conversation going.
Arnis Gubins
Arnis GubinsCorrect answer
Inspiring
Feb 12, 2015 6:41 AM UTC

Thanks to the Adobe engineering team in India, here's a sample script showing how to call the FMPublisher client using a pre-defined STS file in order to generate one of Responsive HTML5, WebHelp, ePub, Kindle or CHM outputs:

/***************************************************************************************** Function to set STS *************************************************************************

Input1:- Path of sts to be set  (if path contains backward slashes, each slash character should be masked with another backward slash)

e.g. stsPath = C:\\Users\\username\\Desktop\\settings.sts*/

function SetSts(stsPath)

{

    var strCommand="SetMCPSetting "+ stsPath ;

   

  var ret=CallClient ("FMPublisher", strCommand );

    return ret;

}

/***************************************************************************************** Function to set BASE OUTPUT LOCATION of the publish outcome *************************************************************************

Input1:- Base Output Path to be set  (if path contains backward slashes, each slash character should be masked with another backward slash)                       */

function SetBaseOutputLocation(outputPath)

{

    var strCommand="SetOutputLocation "+ outputPath ;

   

  var ret=CallClient ("FMPublisher", strCommand );

    return ret;

}

/*********************************************************************** Function to Publish *******************************************************************************

Input1:- Base Output Path to be set  (Output parameter is one of these values: Responsive HTML5, WebHelp, EPub, Kindle, Microsoft HTML Help)       */

function PublishOutput(output)

{

   

    strCommand="MCPPublish "+output ;

    var ret=CallClient ("FMPublisher", strCommand);

    return ret;

}

function doGenerateOutput()

{

    var stsPath = "C:\\Users\\username\\Desktop\\Settings.sts";

    var outputPath = "C:\\Users\\username\\Desktop\\Output";

    var output = "Responsive HTML5";

    SetSts (stsPath);

    SetBaseOutputLocation (outputPath);

    PublishOutput (output);

}

doGenerateOutput ();

9 replies

hadih26673991
Inspiring
Aug 24, 2020 2:19 PM UTC

Thanks for sharing this. I still wonder how you define the Source Document and the Ditaval. Could you please comment on that as well?

Translate
frameexpert
Community Expert
Community Expert
Mar 8, 2018 8:52 PM UTC

Is there a way to set the input file or book using the CallClient ("FMPublisher") function? Thanks.

Translate
www.frameexpert.com
frameexpert
Community Expert
Community Expert
Feb 12, 2015 1:58 PM UTC

Hi Arnis, Excellent! Thanks for posting this. Have you had a chance to test it? Thanks. -Rick

Translate
www.frameexpert.com
Participating Frequently
Feb 5, 2015 12:04 PM UTC

It might expose an interface to F_ApiCallClient(). But there is nothing documented in the "Calling Clients" chapter of the FDK Reference Guide, And I don't believe there's any easy way even to determine whether it is using this mechanism, let alone to capture or reverse-engineer any commands being used. So I guess this is a non-starter..

Another possibility is a scripted playback of keyboard shortcuts.

Translate
Arnis Gubins
Inspiring
Feb 5, 2015 5:33 PM UTC

Thanks for looking into this Mike. I'm pretty certain that it's a client call to the FMPublisher.dll, but what message is required and what return codes are generated is the mystery. I guess the powers that be are afraid that someone will start cloning the FMServer functionality and impact their (perceived) revenue stream. I also note that the latest FrameScript version also has nothing about accessing the Publish routines.

The keystroke scripting is a good idea, but on further thought wouldn't work that well, as different STS files and output locales would need to be used depending upon prior outcomes, so pre-configuring all of the possible combinations would be a wee bit of a maintenance challenge and would be installation dependent.

Translate
Arnis Gubins
Arnis GubinsAuthorCorrect answer
Inspiring
Feb 12, 2015 6:41 AM UTC

Thanks to the Adobe engineering team in India, here's a sample script showing how to call the FMPublisher client using a pre-defined STS file in order to generate one of Responsive HTML5, WebHelp, ePub, Kindle or CHM outputs:

/***************************************************************************************** Function to set STS *************************************************************************

Input1:- Path of sts to be set  (if path contains backward slashes, each slash character should be masked with another backward slash)

e.g. stsPath = C:\\Users\\username\\Desktop\\settings.sts*/

function SetSts(stsPath)

{

    var strCommand="SetMCPSetting "+ stsPath ;

   

  var ret=CallClient ("FMPublisher", strCommand );

    return ret;

}

/***************************************************************************************** Function to set BASE OUTPUT LOCATION of the publish outcome *************************************************************************

Input1:- Base Output Path to be set  (if path contains backward slashes, each slash character should be masked with another backward slash)                       */

function SetBaseOutputLocation(outputPath)

{

    var strCommand="SetOutputLocation "+ outputPath ;

   

  var ret=CallClient ("FMPublisher", strCommand );

    return ret;

}

/*********************************************************************** Function to Publish *******************************************************************************

Input1:- Base Output Path to be set  (Output parameter is one of these values: Responsive HTML5, WebHelp, EPub, Kindle, Microsoft HTML Help)       */

function PublishOutput(output)

{

   

    strCommand="MCPPublish "+output ;

    var ret=CallClient ("FMPublisher", strCommand);

    return ret;

}

function doGenerateOutput()

{

    var stsPath = "C:\\Users\\username\\Desktop\\Settings.sts";

    var outputPath = "C:\\Users\\username\\Desktop\\Output";

    var output = "Responsive HTML5";

    SetSts (stsPath);

    SetBaseOutputLocation (outputPath);

    PublishOutput (output);

}

doGenerateOutput ();

Translate