2017 © Pedro Peláez
 

library pdfversion

Reads the version of a PDF file.

image

trekksoft/pdfversion

Reads the version of a PDF file.

  • Saturday, September 26, 2015
  • by trekksoft
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3,942 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

pdfversion

Build Status Code Coverage Scrutinizer Code Quality, (*1)

Read the version of PDF files using PHP., (*2)

Installation

composer require "trekksoft/pdfversion":"~2.0"

Examples

Simple example

<?php
use Trekksoft\PdfVersion\File;
use Trekksoft\PdfVersion\VersionDiscovery\HeaderCommentDiscoverer;
use Trekksoft\PdfVersion\VersionDiscovery\UnknownVersionException;

$file = new File('path/to/file.pdf');

$discoverer = new HeaderCommentDiscoverer();

try {
    $version = $discoverer->getVersion($file);
    echo $version->toString();
} catch (UnknownVersionException $e) {
    echo $e->getMessage();
}

Trying multiple discoverers

$file = new File('path/to/file.pdf');

$discovererChain = new DiscovererChain([
    new HeaderCommentDiscoverer(),
    new YourOwnDiscoverer(),
    new SorryIhaventWrittenAnyOtherDiscoverers(),
]);

$version = $discovererChain->getVersion($file);

Using streams

<?php
$stream = new Stream($fileHandle);

$discoverer = new HeaderCommentDiscoverer();
$version = $discoverer->getVersion($stream);

License

MIT. See LICENSE file., (*3)

The Versions

26/09 2015

dev-master

9999999-dev

Reads the version of a PDF file.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

26/09 2015

2.0.0

2.0.0.0

Reads the version of a PDF file.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

01/05 2015

1.0.0

1.0.0.0

Reads the version of a PDF file.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by TrekkSoft Ltd.