Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:42
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  MySQL, PostgreSQL, MS SQL, Access (Moderators: Flash-db, Musicman, Ronald Wernecke, Jorge Solis, Andries Seutens)
| | |-+  Automatic change EPS in SWF
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Automatic change EPS in SWF  (Read 3914 times)
detsygebarn
Server what's that
*
Posts: 2



View Profile Email
« on: 11/05/03, 13:11 »

Hi

Is it possible by using PHP/Mysql to change which EPS file showed in a pre-defined SWF?

I have alot of EPS files on the server all of them have an unique id (uploaded by members).My thought is then that users by browsing through a jpg thumb gallery can click the thumbs and then get to see that exact EPS file showed in the pre-defined SWF file (so that they can zoom - thats the idea)

Is it possible and if yes; how?
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #1 on: 11/05/03, 16:35 »

Hi,

eps => swf is not fully automatic (nor does flash import every eps)
Your options: nake swf from your movies (using flash program)
Use a script that will probably have ghostscript and ming as major ingredients. The sad news: noth may not be available on your server

Musicman
Logged
detsygebarn
Server what's that
*
Posts: 2



View Profile Email
« Reply #2 on: 11/06/03, 11:15 »

allright - do you know where to find examples or toturials to this?
Logged
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #3 on: 11/06/03, 13:48 »

Hi,

here is an out-of-date example: http://wolfgang.remsnet.de/mingdocs/psconv.php (the particular producer is now generating different code)

Musicman
Logged
webzed
Server what's that
*
Posts: 1


View Profile Email
« Reply #4 on: 09/22/09, 22:26 »

I recently had to solve this problem. I tested several products such as verydoc ps-to-image which converted the EPS to EMF. Then verydoc ps-to-image to convert the EMF to SWF. It seemed OK until with the example images they supply with the trial version. But when I used it with a clients EPS the quality was very poor. So I ended up using GhostScript to convert the EPS to PDF then used SWFTools PDF2SWF converter to convert the PDF to SWF and the results were fantastic. The only problem was the final SWF had a white box on layer 1 so I removed that using a SwfDotNet library in c# which just removed the 4th and 5th Tags in the compiled SWF and I have a perfect vector SWF that was eactly like the EPS vector image.

Here is example code I used in C#

[DllImport("gsdll32.dll", EntryPoint = "gsapi_new_instance")]
private static extern int gsapi_new_instance(out IntPtr pinstance,IntPtr caller_handle);
[DllImport("gsdll32.dll", EntryPoint = "gsapi_init_with_args")]
private static extern int gsapi_init_with_args(IntPtr instance, int argc, string[] argv);
[DllImport("gsdll32.dll", EntryPoint = "gsapi_exit")]
private static extern int gsapi_exit(IntPtr instance);
[DllImport("gsdll32.dll", EntryPoint = "gsapi_delete_instance")]
private static extern void gsapi_delete_instance(IntPtr instance);


gsargv[0] = "ps2pdf";   /* actual value doesn't matter */
gsargv[1] = "-dCompatibilityLevel=1.4";
gsargv[2] = "-q";
gsargv[3] = "-dNOPAUSE";
gsargv[4] = "-dBATCH";
gsargv[5] = "-dSAFER";
gsargv[6] = "-dEPSCrop";
gsargv[7] = "-sDEVICE=pdfwrite";
gsargv[8] = "-sOutputFile=myPDF.pdf";
gsargv[9] = "-c";
gsargv[10] = ".setpdfwrite";
gsargv[11] = "-f";
gsargv[12] = "myEPS.eps";
gsargc = gsargv.Count();

code = gsapi_new_instance(out gsInstancePtr, IntPtr.Zero);
if (code < 0)
{
    LogError("Error: Could not get Ghostscript instance.");
}
code = gsapi_init_with_args(gsInstancePtr, gsargc, gsargv);
if (code < 0)
{
   LogError("Error: Could not create PDF file from " + eps + ".");
}
code1 = gsapi_exit(gsInstancePtr);
gsapi_delete_instance(gsInstancePtr);

run a command "pdf2swf myPDF.pdf -o mySWF.swf


SwfReader swfReader = new SwfReader(this.tmpSWFFile);
Swf swf = swfReader.ReadSwf();
BaseTagCollection tags = swf.Tags;
swf.Tags.RemoveAt(4);
swf.Tags.RemoveAt(5);
SwfWriter writer = new SwfWriter(this.outFile);
writer.Write(swf);
writer.Close();
« Last Edit: 09/22/09, 22:42 by webzed » Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!