All Projects → hanneskod → Libmergepdf

hanneskod / Libmergepdf

Licence: wtfpl
PHP library for merging multiple PDFs

Labels

Projects that are alternatives of or similar to Libmergepdf

Droid Application Fuzz Framework
Android application fuzzing framework with fuzzers and crash monitor.
Stars: ✭ 248 (-12.06%)
Mutual labels:  pdf
Pdftilecut
pdftilecut lets you sub-divide a PDF page(s) into smaller pages so you can print them on small form printers.
Stars: ✭ 258 (-8.51%)
Mutual labels:  pdf
Pdf
Rust library to read, manipulate and write PDF files.
Stars: ✭ 265 (-6.03%)
Mutual labels:  pdf
Markdown Pdf
Convert markdown to pdf, png or jpeg on the fly in Atom
Stars: ✭ 250 (-11.35%)
Mutual labels:  pdf
Boxable
Boxable is a library that can be used to easily create tables in pdf documents.
Stars: ✭ 253 (-10.28%)
Mutual labels:  pdf
Shaark
Self-hosted platform to keep and share your content: web links, posts, passwords and pictures.
Stars: ✭ 258 (-8.51%)
Mutual labels:  pdf
Geektime2pdf
极客时间专栏文章 转为 PDF 包含评论 音频
Stars: ✭ 245 (-13.12%)
Mutual labels:  pdf
Starter Book
A book starter to kickstart your writing journey 🎉
Stars: ✭ 277 (-1.77%)
Mutual labels:  pdf
Cloud Reports
Scans your AWS cloud resources and generates reports. Check out free hosted version:
Stars: ✭ 255 (-9.57%)
Mutual labels:  pdf
Deck
Slide Decks
Stars: ✭ 261 (-7.45%)
Mutual labels:  pdf
Precomp Cpp
Precomp, C++ version - further compress already compressed files
Stars: ✭ 250 (-11.35%)
Mutual labels:  pdf
Free Programming Books Zh cn
📚 免费的计算机编程类中文书籍,欢迎投稿
Stars: ✭ 85,491 (+30215.96%)
Mutual labels:  pdf
Uxmpdfkit
An iOS PDF viewer and annotator written in Swift that can be embedded into any application.
Stars: ✭ 260 (-7.8%)
Mutual labels:  pdf
Pdfminer.six
Community maintained fork of pdfminer - we fathom PDF
Stars: ✭ 3,250 (+1052.48%)
Mutual labels:  pdf
Thinreports Generator
Report Generator for Ruby
Stars: ✭ 268 (-4.96%)
Mutual labels:  pdf
Pdf Unstamper
Remove textual watermark of any font, any encoding and any language with pdf-unstamper now!
Stars: ✭ 245 (-13.12%)
Mutual labels:  pdf
Receipts
Easy receipts and invoices for your Rails applications
Stars: ✭ 259 (-8.16%)
Mutual labels:  pdf
Quickbill
Create unlimited invoices for free.
Stars: ✭ 278 (-1.42%)
Mutual labels:  pdf
Hummusrecipe
A powerful PDF tool for NodeJS based on HummusJS.
Stars: ✭ 274 (-2.84%)
Mutual labels:  pdf
Tableexport
tableExport(table导出文件,支持json、csv、txt、xml、word、excel、image、pdf)
Stars: ✭ 261 (-7.45%)
Mutual labels:  pdf

libmergepdf

Packagist Version Build Status Quality Score

PHP library for merging multiple PDFs.

Installation

composer require iio/libmergepdf

Usage

Append the first ten pages of bar.pdf to foo.pdf:

use iio\libmergepdf\Merger;
use iio\libmergepdf\Pages;

$merger = new Merger;
$merger->addFile('foo.pdf');
$merger->addFile('bar.pdf', new Pages('1-10'));
$createdPdf = $merger->merge();

Bulk add files from an iterator:

use iio\libmergepdf\Merger;

$merger = new Merger;
$merger->addIterator(['A.pdf', 'B.pdf']);
$createdPdf = $merger->merge();

Merging pdfs of version 1.5 and later

The default FPDI driver is not able handle compressed pdfs of version 1.5 or later. Circumvent this limitation by using the slightly more experimental TCPDI driver.

use iio\libmergepdf\Merger;
use iio\libmergepdf\Driver\TcpdiDriver;

$merger = new Merger(new TcpdiDriver);

Using an immutable merger

Immutability may be achieved by using a driver directly.

use iio\libmergepdf\Driver\Fpdi2Driver;
use iio\libmergepdf\Source\FileSource;
use iio\libmergepdf\Pages;

$merger = new Fpdi2Driver;

$createdPdf = $merger->merge(
    new FileSource('foo.pdf'),
    new FileSource('bar.pdf', new Pages('1-10'))
);

Known issues

  • Links and other content outside a page content stream is removed at merge. This is due to limitations in FPDI and not possible to resolve with the current strategy. For more information see FPDI.
  • TCPDI (as used in the TcpdiDriver for merging pdfs with newer features) does not seem to be maintained. This makes mergeing fragile for certain kinds of files, and error messages are often all but helpful. This package will not be able to fix issues in TCPDI. The long term solution is to switch to a different backend. Suggestions are very welcomed!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].