Git Product home page Git Product logo

swf_to_pdf's Introduction

Adobe Flash (SWF) to SVG and PDF

Recently, I found some documents exported as SWF. It would be certainly more convenient for me if I could read these documents in my PDF reader. So I needed a utility to convert content from Adobe Flash to PDF. For this reason, I’ve written a small Python program that utilizes the SWFTools in order to parse the SWF and exports output in SVG and PDF file formats.

The utility is still very experimental and will certainly need some tuning in order to produce perfect output. In order to use it, you need, of course, Python and, also, the SWFTools. You need to add a few lines in lib/Makefile of SWFTools in order to create a dynamic library for Python:

librfxswf.$(SLEXT): $(rfxswf_objects) rfxswf.$(O) drawer.$(O) $(lame_in_source) $(h263_objects) $(as12compiler_in_source) $(as3compiler_objects) libbase$(A)
  $(L) -g -shared -o $@ $^ -lz

The utility is split into two parts. The swf_lib.py uses Python ctypes in order to communicate with the dynamic library and the swf_to_pdf.py is the main engine that performs the transformation. Currently shapes and text are supported. Eventually, more stuff could be implemented. It should be possible to transform a Flash application completely into an equivalent HTML5 application. I’ll leave that as an exercise for the reader!

You can see here an example of the utility:

  • The original PDF.
  • The SWF produced by SWFTools’ pdf2swf tool.
  • The output SVG produced by the SWF to SVG/PDF utility presented here.
  • The output PDF produced by the SWF to SVG/PDF utility presented here.

swf_to_pdf's People

Contributors

prekageo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.