[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Porting SWFTools (PDF2SWF) to Java

From: Pablo Beltran
Subject: [Swftools-common] Porting SWFTools (PDF2SWF) to Java
Date: Tue, 11 Dec 2012 01:30:19 +0100

Hi everybody!

After some time googling, I would say the fastest and easiest way to port SWFtools to Java is at binary level by using the Nestedvm compiler: http://nestedvm.ibex.org/.
The process is not completed, so I need some help fomr the community members. Please, fell free to collaborate:

Quick start Guide

A) Configure the nestedvm compiler:

On Linux (I run it on Mint 14) follow these simple steps:

1. Download the latest version from the Git repository: http://git.megacz.com/?p=nestedvm.git;a=summary
2. Build it: 
make CC='gcc -D_FORTIFY_SOURCE=0'
Disabling fortify source is recommended on newer Ubuntu based distributions only.
3. Test it:
make test
You should see a "Hello, World!" somewhere among other debug stuff output.
3. To generate the g++ compiler: 
make cxxtest
4. Add the gcc and g++ to the PATH=<path_to_nestedvm>/upstream/install/bin:$PATH

B) Compile SWFTools by using the Nestedvm compiler.
I would say that something like this should work:
./configure CC="mips-unknown-elf-gcc" CXX="mips-unknown-elf-g++"
and in some point build pdf2swf.mips (Mips version of pdf2swf)

but I got stuck with the zlib 3rd party library. I also built zlib by using the Nestedvm, but I'm unable to get it work together with SWFTools
(Well, I've not much idea nor C/C++ neither compilers)

C) (I never tried this). Invoke SWFTools from the Java class. I read how:
1. Build the java version of pdf2swf tools from the mips version. 
java -classpath <path_to_nestedvm>\build\;<path_to_nestedvm>\upstream\build\classgen\build\ org.ibex.nestedvm.Compiler -o 
lessConstants -outfile org/swftools/PDF2SWF.class org.swftools.PDF2SWF <path to pdf2swf.mips>
2. Invoke PDF2SWF.class from Java
import org.sfwtools.PDF2SWF;

public class Test {
    public static void main(String[] args) {
        String[3] params = new String[3];
        params[0] = "-T9";
params[1] = "/home/pablo/foo.pdf";
params[2] = "-o /home/panlo/foo.swf";
PDF2SWF converter = new PDF2SWF(); converter.run(params);
Many thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]