GithubHelp home page GithubHelp logo

plozmun / pdf-version-converter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xthiago/pdf-version-converter

1.0 0.0 0.0 81 KB

PHP library for converting the version of PDF files (for compatibility purposes).

License: MIT License

PHP 100.00%

pdf-version-converter's Introduction

PDF version converter

PHP library for converting the version of PDF files (for compatibility purposes).

Build Status SensioLabsInsight Codacy Badge

Requirements

  • PHP 5.3+
  • Ghostscript (gs command on Linux)

Installation

Run php composer.phar require xthiago/pdf-version-converter dev-master or add the follow lines to composer and run composer install:

{
    "require": {
        "xthiago/pdf-version-converter": "dev-master"
    }
}

Usage

Guessing a version of PDF File:

<?php
// import the namespaces
use Xthiago\PDFVersionConverter\Guesser\RegexGuesser;
// [..]

$guesser = new RegexGuesser();
echo $guesser->guess('/path/to/my/file.pdf'); // will print something like '1.4'

Converting file to a new PDF version:

<?php
// import the namespaces
use Symfony\Component\Filesystem\Filesystem,
    Xthiago\PDFVersionConverter\Converter\GhostscriptConverterCommand,
    Xthiago\PDFVersionConverter\Converter\GhostscriptConverter
;

// [..]

$command = new GhostscriptConverterCommand();
$filesystem = new Filesystem();

$converter = new GhostscriptConverter($command, $filesystem);
$converter->convert('/path/to/my/file.pdf', '1.4');

Contributing

Is really simple add new implementation of guesser or converter , just implement GuessInterface or ConverterInterface.

Running unit tests

Run phpunit -c tests.

pdf-version-converter's People

Contributors

xthiago avatar edegaudenzi avatar plozmun avatar

Stargazers

树人巷 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.