PHPackages                             swftools/swftools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. swftools/swftools

ActiveLibrary

swftools/swftools
=================

PHP SwfTools

4.1.0(8y ago)21231.2k↓33.3%51MITPHPPHP ~7.0CI failing

Since Dec 21Pushed 5y ago9 watchersCompare

[ Source](https://github.com/alchemy-fr/PHPSwftools)[ Packagist](https://packagist.org/packages/swftools/swftools)[ RSS](/packages/swftools-swftools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (10)Used By (1)

PHP Swftools
============

[](#php-swftools)

[![Build Status](https://camo.githubusercontent.com/b97495b80632eb45289d7151f549ac7059404fe3b22e46cd7e69ebf6c920aa82/68747470733a2f2f7472617669732d63692e6f72672f616c6368656d792d66722f504850537766746f6f6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alchemy-fr/PHPSwftools)

PHP Swftools is a tiny lib which help you to use SWFTools

SWFTools are GPL licensed and are described as "a collection of utilities for working with Adobe Flash files"

Documentation available at

Installation
------------

[](#installation)

It is recommended to install PHP-Swftools through [Composer](http://getcomposer.org) :

```
{
    "require": {
        "swftools/swftools": "~0.1.0"
    }
}
```

Dependencies
------------

[](#dependencies)

In order to use PHP SwfTools, you need to install SWFTools. Depending of your configuration, please follow the instructions at .

Main API usage
--------------

[](#main-api-usage)

```
$file = new SwfTools\FlashFile(SwfTools\Binary\DriverContainer::create());

// Render the animation to a PNG file
$file->render('Animation.swf', 'renderedAnimation.png');

// List all embedded object found in the animation.
// Available object types are : Shapes, Fonts, PNGs, JPEGs, Frames, MovieClip
foreach($File->listEmbeddedObjects('Animation.swf') as $embeddedObject) {
    echo sprintf("found an object type %s with id %d\n", $embeddedObject->getType(), $embeddedObject->getId());
}

// Extract embedded Object #1
$file->extractEmbedded(1, 'Animation.swf', 'Object1.png');

// Extract the first embedded image found
$file->extractFirstImage('Animation.swf', 'renderedAnimation.jpg');
```

Setting timeout
---------------

[](#setting-timeout)

PHPSwfTools uses underlying processes to execute commands. You can set a timeout to prevent these processes to run more than a defined duration.

To disable timeout, set it to `0` (default value).

```
$file = new SwfTools\FlashFile(SwfTools\Binary\DriverContainer::create(
    'timeout' => 0,
));
```

Using various binaries versions
-------------------------------

[](#using-various-binaries-versions)

PHPSwfTools uses `swfextract` an `swfrender` provided by SWFTools. If you want to specify the path to the binary you wnat to use, you can add configuration :

```
$file = new SwfTools\FlashFile(SwfTools\Binary\DriverContainer::create(
    'pdf2swf.binaries'    => '/opt/local/swftools/bin/pdf2swf',
    'swfrender.binaries'  => '/opt/local/swftools/bin/swfrender',
    'swfextract.binaries' => '/opt/local/swftools/bin/swfextract',
));
```

Silex Service Provider
----------------------

[](#silex-service-provider)

PHP-Swtools provides a [Silex](http://silex.sensiolabs.org) service provider. Every option is optional, use them depending of your configuration. By default, PHP-Swftools will try to find the executable in the environment PATH and timeout is set to 0 (no timeout).

```
$app = new Silex\Application();
$app->register(new SwfTools\SwfToolsServiceProvider(), array(
    'swftools.configuration' => array(
        'pdf2swf.binaries'    => '/opt/local/swftools/bin/pdf2swf',
        'swfrender.binaries'  => '/opt/local/swftools/bin/swfrender',
        'swfextract.binaries' => '/opt/local/swftools/bin/swfextract',
        'timeout'    => 300,
    ),
    'swftools.logger' => $app->share(function (Application $app) {
        return $app['monolog'];
    });
));

$app['swftools.flash-file']->render('file.swf', 'output.jpg');
$app['swftools.pdf-file']->toSwf('output.swf');
```

License
-------

[](#license)

PHPSwftools are released under MIT License

See LICENSE file for more information

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~278 days

Recently: every ~457 days

Total

8

Last Release

2946d ago

Major Versions

0.3.2 → 4.1.02018-04-25

PHP version history (2 changes)0.1.0PHP &gt;=5.3.3

4.1.0PHP ~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c264f69af4c60cb9cc98a522b4663f4b6a2708629cabc14409478ab6fc35348?d=identicon)[romain](/maintainers/romain)

---

Top Contributors

[![romainneutron](https://avatars.githubusercontent.com/u/137574?v=4)](https://github.com/romainneutron "romainneutron (93 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (5 commits)")[![moctardiouf](https://avatars.githubusercontent.com/u/1235702?v=4)](https://github.com/moctardiouf "moctardiouf (4 commits)")[![jygaulier](https://avatars.githubusercontent.com/u/1247618?v=4)](https://github.com/jygaulier "jygaulier (2 commits)")

---

Tags

flashswfadobe flash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/swftools-swftools/health.svg)

```
[![Health](https://phpackages.com/badges/swftools-swftools/health.svg)](https://phpackages.com/packages/swftools-swftools)
```

###  Alternatives

[edvinaskrucas/notification

Package for Laravel for helping to manage flash / instant notifications / messages.

520393.9k10](/packages/edvinaskrucas-notification)[slim/flash

Slim Framework Flash message service provider

1522.2M99](/packages/slim-flash)[aura/session

Provides session management functionality, including lazy session starting, session segments, next-request-only ("flash") values, and CSRF tools.

2041.2M69](/packages/aura-session)[plasticbrain/php-flash-messages

A modern take on PHP session-based flash messages

184229.6k8](/packages/plasticbrain-php-flash-messages)[stefangabos/zebra_session

A drop-in replacement for PHP's default session handler which stores session data in a MySQL database, providing better performance, better security and protection against session fixation and session hijacking

174112.1k2](/packages/stefangabos-zebra-session)[kartik-v/yii2-widget-alert

A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)

284.1M24](/packages/kartik-v-yii2-widget-alert)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
