Skip navigation
mrbogle
Currently Being Moderated

Using the fireworks XML RPC server

Jan 20, 2011 11:24 PM

Hi, I am trying to use the XML RPC server in fireworks to export pages of a PNG.

 

The relevant help url: http://help.adobe.com/en_US/fireworks/cs/extend/WS5b3ccc516d4fbf351e63 e3d1183c949219-7ffe.html

And the pdf version: http://help.adobe.com/en_US/fireworks/cs/extend/fireworks_cs5_extendin g.pdf (chapter 7)

 

All I want to do is open a file, call exportPages(), and close it. So far this has been a very painful experience. I have CS5 Design Premium on a mac (os 10.5) if it matters. But I have the same problem 1 with my copy of CS3.

 

Problem 1

 

Fireworks never ever returns a document id. It also does not return an error number. The value attribute of the returned obj element and any error attributes are empty. Here are some example calls and responses:

 

request: <func name="createDocument" obj="fw"></func>

response: <return><obj value="" class="DocumentClass"></obj></return>'

 

request: <func name="closeDocument" obj="fw"><string order="0" value="0" /><bool order="1" value="false" /></func>

response: <return error=""></return>

 

Note the value of the response is empty. This is always the case, unless I get something back that is not an integer. For instance. I am able to get the path url of the open doc:

 

request: <func name="getDocumentPath" obj="fw"></func>

response: <return><string value="file:///Macintosh%20HD/Users/me/work/somefile.png"></string></ return>

 

Is anyone else using this with any success? Will a FW dev some here and set me straight? I am opening a socket with python like this:

 

import socket

self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

self._sock.connect(('localhost', 12124))

 

It seems like anything that is an int on FW end doesn't come through the response?

 

Problem 2

 

When I open a file that was created in CS3 with the API, a blocking dialog pops up asking about converting the fonts. FW will not return my request until this dialog is dismissed. Is there any way around this? This pretty much nullifies any automation with fireworks on files create by an older version.

 

Any help or insight into either of these would be extraordinarily helpful. Or if you have a way to export pages from a FW PNG without running fireworks, I would love love love to hear it. Judging by the RPC documentation, the availability of info online (virtually none!) and my experience with it, it seems adobe doesn't care about it all that much.

 
Replies
  • Currently Being Moderated
    Jan 24, 2011 8:37 PM   in reply to mrbogle

    I am sure you would have read the Fireworks EULA.

    Just to clarify, if you are using Fireworks on a server and interacting with the app via this channel, it is against the EULA.

     

    ..Sarthak

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 24, 2011 10:38 PM   in reply to mrbogle

    The Fireworks APIs - dom.close() and fw.closeDocument() seems to be working fine, both on Fw CS3 and CS5.

    You could try using the following code:

     

    var dom=fw.getDocumentDOM();           //Gets the document object of the current document.

    var mydoc=fw.documents[0];    // Get the document object of the first document that is open.

    fw.closeDocument(mydoc,false);            //closes the document.

     

    You can use "fw.closeDocument(dom,false);" to close the current document.

    “dom.close(true);” or “mydoc.close(true);” can also be used to close the document.

     

    fw.documents is an array of Fireworks documents that are currently open in Fireworks.

    You can use fw.documents[i] to perform operations on the ith document.

     

    -Priyanka.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2012 4:46 PM   in reply to mrbogle

    I noticed that this object ID problem occurs when I run this code on a Mac but it works fine on Windows 7.  I'm running the exact same code but for Fireworks CS6.  On Mac I get:

    <return><obj value="" class="DocumentClass"></obj></return>

    but on Windows the value is the proper ID number.

     

    So far on the mac NONE of the return objects have a proper value unless the object is of type string.  FwArray, DocumentClass, et cetera all have "" for value.

    On Windows there is no problem and the code hasn't changed.

     

     

    Is it possible to notify Adobe about this potential bug?  Or has anyone discovered a work-around to get the DocumentClass object ID??

     

    Thanks!!!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points