syntaxic/pdf-importer

PDF Document Importer (FPDI alternative) by Syntaxic. Supports PDF versions up to 1.4.

Maintainers

Package info

github.com/Syntaxic-Labs/PDF-Importer

pkg:composer/syntaxic/pdf-importer

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-05-29 07:27 UTC

This package is auto-updated.

Last update: 2026-05-29 07:31:35 UTC


README

License: MIT

Syntaxic PDF Importer is a lightweight, high-performance PHP library designed to import pages from existing PDF documents and use them as templates inside FPDF. It serves as a modern, clean, and fully rebranded alternative to SetaSign's FPDI.

Out of the box, the core package supports standard PDF templates up to version 1.4.

Features

  • Easy PDF Importing: Seamlessly import pages from existing PDF 1.4 templates.
  • FPDF Compatibility: Works directly with syntaxic/fpdf.

Installation

Install the package via Composer:

composer require syntaxic/pdf-importer

Basic Usage

Here is a quick example of how to import a page from a PDF template:

<?php

require_once 'vendor/autoload.php';

use Syntaxic\PdfImporter\Spdi;

$pdf = new Spdi();

// Load the PDF template
$pageCount = $pdf->setSourceFile('document_14.pdf');

// Import the first page
$pdf->AddPage();
$templateId = $pdf->importPage(1);

// Use the template at position (10, 10) with a width of 190mm
$pdf->useTemplate($templateId, 10, 10, 190);

// Add custom text on top of the template page
$pdf->SetFont('Helvetica', 'B', 16);
$pdf->SetXY(15, 15);
$pdf->Write(0, 'Hello from Syntaxic PDF Importer!');

$pdf->Output('I', 'output.pdf');

License

This package is open-source software licensed under the MIT License.