Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fawno/qpdf

PHP class for access QPDF C Interface
https://github.com/fawno/qpdf

ffi ffi-bindings pdf qpdf

Last synced: about 5 hours ago
JSON representation

PHP class for access QPDF C Interface

Awesome Lists containing this project

README

        

[![GitHub license](https://img.shields.io/github/license/fawno/QPDF)](https://github.com/fawno/QPDF/blob/master/LICENSE)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/fawno/QPDF)](https://github.com/fawno/QPDF/tags)
[![Packagist](https://img.shields.io/packagist/v/fawno/qpdf)](https://packagist.org/packages/fawno/qpdf)
[![Packagist Downloads](https://img.shields.io/packagist/dt/fawno/qpdf)](https://packagist.org/packages/fawno/qpdf/stats)
[![GitHub issues](https://img.shields.io/github/issues/fawno/QPDF)](https://github.com/fawno/QPDF/issues)
[![GitHub forks](https://img.shields.io/github/forks/fawno/QPDF)](https://github.com/fawno/QPDF/network)
[![GitHub stars](https://img.shields.io/github/stars/fawno/QPDF)](https://github.com/fawno/QPDF/stargazers)

# QPDF

PHP class for access QPDF C Interface

## Requirements
The [QPDF](https://github.com/qpdf/qpdf) libary (dll or so).

## Instalation

```sh
php composer.phar require "fawno/qpdf"
```

```php
readFile($filename, $password);
if ($qpdf->hasError()) {
$error = $qpdf->getError();
print_r($error);
die();
}

if ($qpdf->hasWarning()) {
$warning = $qpdf->getWarning();
print_r($warning);
}

$filename = __DIR__ . '/document_without_encrypt.pdf';
$qpdf->initWrite($filename);
if ($qpdf->hasError()) {
$error = $qpdf->getError();
print_r($error);
die();
}

$qpdf->preserveEncryption(false);

$qpdf->write();
if ($qpdf->hasError()) {
$error = $qpdf->getError();
print_r($error);
die();
}
```