Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Batch Processing word docs to FlashPaper

Recently for work I have had to convert quite a few word docs to the FlashPaper format.

Realising how long this would take I looked into an undocumented feature of the FlashPrinter.exe of calling it from the command line and passing the required arguments.

You can easily take my code and get any language like Java or even Ant to do the following.

The command you need to run is:

view plain print about
1FlashPrinter.exe {PATH TO DOCUMENT} -o {OUTPUT PATH & FILE with SWF extention}

All the CF code below does is filter on the directory query looking for word documents. If you have any changes or suggestions contace me here

view plain print about
1<!--- Path to Flash Paper exe --->
2    <cfset flashPrinter = "C:\Program Files\Macromedia\FlashPaper 2\FlashPrinter.exe">
3    <!--- Path to documents --->
4    <cfset originalPath = expandPath(".") />
5    <!--- Can be either doc|pdf --->
6    <cfset filter = "doc">
7    
8    <!--- Path to the exported swf's' --->
9    <cfset outputPath = expandPath(".") />
10    
11    <!--- get a query list of all the fiels --->
12    <cfdirectory action="list" name="qry" directory="#originalPath#" filter="*.#filter#" />
13    
14    <cfoutput>
15        <cfloop query="qry">
16            <cfset fileLoc = qry.directory&"\"&qry.name />
17            <cfset outputFile = outputPath & "\" & replace(qry.name, ".#filter#", ".swf")>
18            
19            <!--- Set the arguments to be passed to CFEXECUTE --->
20            <cfset args = '"#flashPrinter#" "#fileLoc#" -o "#outputFile#"' />
21            
22            <!--- Output the args to the screen to see what got passed --->    
23            #args#
24            <hr/>
25            <!--- Use the command line to execute the function --->
26            <cfexecute name = "#flashPrinter#"
27             arguments = "#args#">

28            </cfexecute>
29            
30        </cfloop>
31    </cfoutput>

Comments Comments (3) | Print Print | Send Send | 3648 Views

Ahem... beat you to this by over a year ;-)

http://www.darronschall.com/weblog/archives/000250... - That's my ANT version of a batch PDF to FlashPaper cnoverter.
Good information to know. Thanks Andy. And Darron for the ANT script.
alex's Gravatar Posted By alex @ 6/12/08 12:50 AM
The command line doesn't works. I don't know why. Which version do you use? Or maybe I need some configuration in my windows system?
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .