Sign PDF files with valid x509 certificate

Overview

Latest Stable Version Total Downloads Latest Unstable Version License

Sign PDF files with valid x509 certificate

Require this package in your composer.json and update composer. This will download the package and the dependencies libraries also.

composer require lsnepomuceno/laravel-a1-pdf-sign

💥 Is your project not Laravel / Lumen?

If you want to use this package in a project that is not based on Laravel / Lumen, you need to make the adjustments below

1 - Install dependencies to work correctly.

composer require illuminate/container illuminate/filesystem ramsey/uuid

2 - Prepare the code to launch the Container and FileSystem instance.

<?php

require_once 'vendor/autoload.php';

use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Facade;

try {
  $app = new Container();
  $app->singleton('app', Container::class);
  $app->singleton('files', fn () => new Filesystem);
  Facade::setFacadeApplication($app);
  
  // Allow the use of Facades, only if necessary
  // $app->withFacades();
} catch (\Throwable $th) {
  // TODO necessary
}

3 - After this parameterization, your project will work normally.

<?php

require_once 'vendor/autoload.php';

use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Facade;
use LSNepomuceno\LaravelA1PdfSign\ManageCert;

try {
  $app = new Container();
  $app->singleton('app', Container::class);
  $app->singleton('files', fn () => new Filesystem);
  Facade::setFacadeApplication($app);
  
  $cert = new ManageCert;
  $cert->fromPfx(path/to/certificate.pfx', 'password');
  var_dump($cert->getCert());
} catch (\Throwable $th) {
  // TODO necessary
}

Usage

Working with certificate

1 - Reading the certificate from file.

<?php

use LSNepomuceno\LaravelA1PdfSign\ManageCert;

class ExampleController() {
    public function dummyFunction(){
        try {
            $cert = new ManageCert;
            $cert->fromPfx('path/to/certificate.pfx', 'password');
            dd($cert->getCert());
        } catch (\Throwable $th) {
            // TODO necessary
        }
    }
}

2 - Reading the certificate from upload.

<?php

use Illuminate\Http\Request;
use LSNepomuceno\LaravelA1PdfSign\ManageCert;

class ExampleController() {
    public function dummyFunction(Request $request){
        try {
            $cert = new ManageCert;
            $cert->fromUpload($request->pfxUploadedFile, $request->password);
            dd($cert->getCert());
        } catch (\Throwable $th) {
            // TODO necessary
        }
    }
}

3 - The expected result will be as shown below.

Certificate

4 - Store certificate data securely in the database.

IMPORTANT: Store certificate column as binary data type
<?php

use App\Models\Certificate;
use LSNepomuceno\LaravelA1PdfSign\ManageCert;

class ExampleController() {
    public function dummyFunction(){
        try {
            $cert = new ManageCert;
            $cert->fromPfx('path/to/certificate.pfx', 'password');
        } catch (\Throwable $th) {
            // TODO necessary
        }
                
        // Postgres or MS SQL Server
        Certificate::create([
          'certificate' => $cert->getEncrypter()->encryptString($cert->getCert()->original) 
          'password'    => $cert->getEncrypter()->encryptString('password'),
          'hash'        => $cert->getHashKey(), // IMPORTANT
          ...
        ]);
        
        // For MySQL
        Certificate::create([
          'certificate' => $cert->encryptBase64BlobString($cert->getCert()->original) 
          'password'    => $cert->getEncrypter()->encryptString('password'),
          'hash'        => $cert->getHashKey(), // IMPORTANT
          ...
        ]);
    }
}

5 - Reading certificate from database.

<?php

use LSNepomuceno\LaravelA1PdfSign\ManageCert;
use Illuminate\Support\{Str, Facades\File};

class CertificateModel() {
    public function parse() {
        $cert = new ManageCert;
        $cert->setHashKey($this->hash);
        $pfxName = $cert->getTempDir() . Str::orderedUuid() . '.pfx';

        // Postgres or MS SQL Server
        File::put($pfxName, $cert->getEncrypter()->decryptString($this->bb_cert));
        
        // For MySQL
        File::put($pfxName, $cert->decryptBase64BlobString($this->bb_cert));
        
        try {
          return $cert->fromPfx(
              $pfxName,
              $cert->getEncrypter()->decryptString($this->password)
          );
        } catch (\Throwable $th) {
            // TODO necessary
        }
    }
}

Sign PDF File

1 - Sign PDF with certificate from file or upload.

<?php

use Illuminate\Http\Request;
use LSNepomuceno\LaravelA1PdfSign\{ManageCert, SignaturePdf};

class ExampleController() {
    public function dummyFunction(Request $request){
        
        // FROM FILE
        try {
            $cert = new ManageCert;
            $cert->fromPfx('path/to/certificate.pfx', 'password');
        } catch (\Throwable $th) {
            // TODO necessary
        }
        
        // FROM UPLOAD
        try {
            $cert = new ManageCert;
            $cert->fromUpload($request->pfxUploadedFile, $request->password);
            dd($cert->getCert());
        } catch (\Throwable $th) {
            // TODO necessary
        }
        
        // Returning signed resource string
        try {
            $pdf = new SignaturePdf('path/to/pdf/file.pdf', $cert->getCert(), SignaturePdf::MODE_RESOURCE) // Resource mode is default
            $resource = $pdf->signature();
            // TODO necessary
        } catch (\Throwable $th) {
            // TODO necessary
        }
        
        // Downloading signed file
        try {
            $pdf = new SignaturePdf('path/to/pdf/file.pdf', $cert->getCert(), SignaturePdf::MODE_DOWNLOAD)
            return $pdf->signature(); // The file will be downloaded
        } catch (\Throwable $th) {
            // TODO necessary
        }
    }
}

2 - Sign PDF with certificate from database (model based).

<?php

use Illuminate\Http\Request;
use App\Models\Certificate;
use LSNepomuceno\LaravelA1PdfSign\{ManageCert, SignaturePdf};

class ExampleController() {
    public function dummyFunction(Request $request){
        
        // Find certificate
        $cert = Certificate::find(1);
        
        // Returning signed resource string
        try {
            $pdf = new SignaturePdf('path/to/pdf/file.pdf', $cert->parse(), SignaturePdf::MODE_RESOURCE) // Resource mode is default
            $resource = $pdf->signature();
            // TODO necessary
        } catch (\Throwable $th) {
            // TODO necessary
        }
        
        // Downloading signed file
        try {
            $pdf = new SignaturePdf('path/to/pdf/file.pdf', $cert->parse(), SignaturePdf::MODE_DOWNLOAD)
            return $pdf->signature(); // The file will be downloaded
        } catch (\Throwable $th) {
            // TODO necessary
        }
    }
}

3 - The expected result in Adobe Acrobat/Reader will be as shown below.

Signed File

Tests

Run the tests with:

composer run-script test

or

vendor/bin/phpunit
Comments
  • error decrypting certificate from DB

    error decrypting certificate from DB

    Hi

    I have tried to follow the instructions to store and use a certificate from DB

    Her is my code:

    $cert = new ManageCert();
                $cert->fromUpload($request->file('pfxUploadedFile'), $request->input('password'));
                $certificate = Certificate::create([
                    'certificate'   => $cert->encryptBase64BlobString($cert->getCert()->original),
                    'password'      => $cert->getEncrypter()->encryptString('password'),
                    'hash'          => $cert->getHashKey(), // IMPORTANT
                    'name'          => $request->input('name'),
                    'user_id'       => Auth::user()->id,
                ]);
    

    here is how I try to use it:

            $cert = Certificate::find(3);
            if ($cert) {
                $fileName = 'xxxx/storage/app/pdf/test_doc-max_compressed.pdf';
    
                if (File::exists($fileName)) {
                    Certificate::signPDF($fileName, $cert);
                } else {
                    debug('file does not exists: ' . $fileName);
                }
            } else {
                debug('did not get certificate from db');
            }
    
    

    here is the SignPDF method:

     public static function signPDF(string $fileName, Certificate $certRecord)
        {
            try {
                $cert = $certRecord->parse();
                if (is_null($cert)) {
                    debug('Could not parse certificate');
                    return;
                }
    
                $pdf = new SignaturePdf($fileName, $cert->parse(), SignaturePdf::MODE_RESOURCE); // Resource mode is default
                debug($pdf);
                $resource = $pdf->signature();
    
    
                // TODO necessary
            } catch (\Throwable $th) {
                // TODO necessary
            }
        }
    

    and here is the parse method:

        public function parse(): ?ManageCert
        {
            try {
                return decryptCertData($this->hash, $this->certificate, $this->password);
            } catch (\Throwable $th) {
                Log::error($th->getMessage());
            }
    
            return null;
        }
    
    

    error thrown in decryptCertData() openssl_x509_read(): X.509 Certificate cannot be retrieved

    bug help wanted 
    opened by rabol 6
  • Mac verify error: invalid password

    Mac verify error: invalid password

    I can't generate a certificate.

    Error: Process runtime error, reason: "Mac verify error: invalid password?. "

    ManagerCert.php: line 104 $openssl = "openssl pkcs12 -in {$pfxPath} -out {$output} -nodes -password pass:{$this->password}";

    result: openssl pkcs12 -in /var/www/digital/digital/storage/app/certificado/certificado.pfx -out /var/www/digital/digital/app/LSNepomuceno/LaravelA1PdfSign/Temp/96f30689-040a-47e0-a7e3-f43d334e2f3d.crt -nodes -password pass:***

    A file has been created in /temp/ but empty file.

    Any Idea?

    bug help wanted 
    opened by dev-guidolin 5
  • error ValidatePdfSignature

    error ValidatePdfSignature

    an error occurs when validating a signature, apparently the format for other countries is different, it is a certificate from Peru

    try {
               dd(ValidatePdfSignature::from('.../sign.pdf'));
            } catch (\Throwable $th) {
               return $th;
            }
    

    adobe acrobat image

    use ValidatePdfSignature()

    image

    bug documentation help wanted 
    opened by edwinmacalopu 4
  • Defining the pdf name

    Defining the pdf name

    Would be nice to be able to set the PDF name to one that we want instead the UUID. Is is possible to add this feature? Or define it as the name of the readed pdf and concatenate something like "_signed". This would help a lot. Thanks

    documentation enhancement 
    opened by ALGAzevedo 3
  • chore(deps-dev): update orchestra/testbench requirement from ^6.20.1 to ^6.20.1 || ^6.0.0

    chore(deps-dev): update orchestra/testbench requirement from ^6.20.1 to ^6.20.1 || ^6.0.0

    Updates the requirements on orchestra/testbench to permit the latest version.

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • chore(deps): bump symfony/process from 6.0.5 to 6.1.3

    chore(deps): bump symfony/process from 6.0.5 to 6.1.3

    Bumps symfony/process from 6.0.5 to 6.1.3.

    Release notes

    Sourced from symfony/process's releases.

    v6.1.3

    Changelog (https://github.com/symfony/process/compare/v6.1.2...v6.1.3)

    • no significant changes

    v6.1.0

    Changelog (https://github.com/symfony/process/compare/v6.1.0-RC1...v6.1.0)

    • no significant changes

    v6.1.0-RC1

    Changelog (https://github.com/symfony/process/compare/v6.1.0-BETA2...v6.1.0-RC1)

    • no significant changes

    v6.1.0-BETA1

    Changelog (https://github.com/symfony/process/compare/v6.0.7...v6.1.0-BETA1)

    • feature #45377 Bump minimum version of PHP to 8.1 (nicolas-grekas)

    v6.0.11

    Changelog (https://github.com/symfony/process/compare/v6.0.10...v6.0.11)

    • no significant changes

    v6.0.8

    Changelog (https://github.com/symfony/process/compare/v6.0.7...v6.0.8)

    • bug #45931 Fix Process::getEnv() when setEnv() hasn't been called before (asika32764)

    v6.0.7

    Changelog (https://github.com/symfony/process/compare/v6.0.6...v6.0.7)

    • bug #45676 Don't return executable directories in PhpExecutableFinder (fancyweb)
    Commits
    • a6506e9 Merge branch '6.0' into 6.1
    • 44270a0 Merge branch '5.4' into 6.0
    • 6e75fe6 Merge branch '4.4' into 5.4
    • 5cee9cd CS fixes
    • 3187184 Update sponsors of components v6.1
    • 453a55e Merge branch '6.0' into 6.1
    • d074154 Merge branch '5.4' into 6.0
    • 597f3ff Merge branch '4.4' into 5.4
    • 9eedd60 [Process] Fix Process::getEnv() when setEnv() hasn't been called before
    • 10216a1 Merge branch '6.0' into 6.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Support for laravel version 6?

    Support for laravel version 6?

    Is there a way to use this package in laravel 6? I have a project in laravel 6 with some dependencies that keep me from updating the application to a newer version.

    Thanks in advance.

    documentation enhancement help wanted 
    opened by jw7712 1
  • chore(deps): update tecnickcom/tcpdf requirement from 6.4.* to 6.4.* || 6.5.*

    chore(deps): update tecnickcom/tcpdf requirement from 6.4.* to 6.4.* || 6.5.*

    Updates the requirements on tecnickcom/tcpdf to permit the latest version.

    Changelog

    Sourced from tecnickcom/tcpdf's changelog.

    6.5.0 (2022-08-12)

    • encodeUrlQuery takes into account the port (#493)
    • Fixing undefined offset error in writeHTML() when last DOM element ha…
    • correct some type hints (#495)
    • fix: php 8.1 notices (#481)
    • Fixed: null check for PHP 8.1 (#476)
    • Fix Infinite Loop in Multicell with Auto Page Breaks Off (#473)
    • GetCssBorderStyle Has Problem When !important Is Specified (#467)
    • Support Apache 2.4 directives in htaccess file (#530)
    • Remove examples from dist package (#542)

    6.4.4 (2021-12-31)

    • PHP 8.1 fixes

    6.4.3 (2021-12-28)

    • Fix MultiCell PHPDoc typehint (#407)
    • Fix type hint for \TCPDF_STATIC::_freadint (#414)
    • Footer and Header font phpdoc fixes + constructor $pdfa phpdoc fix + setHeaderData lw param fix (#402)
    • Fix text-annotation state options (#412)
    • Fix - Named links have been broken. This fixes. (#415)
    • Fixed type in comment for $lw header image logo width in mm
    • Change Set to set. Fixes #419 (#421)
    • Fix failing tests and failing tests not marking exit code as 1 (#426)
    • Fix phpdoc and prefer null as default value (#444)
    • Run on PHP 8.1 normally and add nightly PHP as allowed to fail (#452)
    • Fix AES128 encryption if the OpenSSL extension is installed (#453)
    • Explicitly cast values to int for imagesetpixel (#460)
    • Fix cell_height_ratio type (#405)
    • Leave &NBSP; lowercase when using text-transform (#403)

    6.4.2 (2021-07-20)

    • Fix PHP 8.1 type error with TCPDF_STATIC::pregSplit on preg_split
    • Fix a PHP array offset error
    • Fixed phpdoc blocks
    • Drop a PHP 4 polyfill and add a .gitattributes file
    • Added a test-suite
    • Removed pointless assignments
    • Fix docblock spelling error
    • Update version info
    • Fix color being filled to type 0 with PHP 8
    • Fix warnings for undefined tags for $lineStyle
    • Normalized composer.json
    • Allowed transparency in PDF/A-2 and PDF/A-3
    • Add a TCPDF composer example
    • Fixed implicit conversion from float to int for PHP 8.1
    • Removed status.txt from font directories, because of filesize
    • Fixed type hints
    • Removed "U" modifier from regexes

    6.4.1 (2021-03-27)

    ... (truncated)

    Commits
    • cc54c15 Bump version
    • 1fb8b6a Bump version
    • 5a04f6e encodeUrlQuery takes into account the port (#493)
    • ff83da8 Fixing undefined offset error in writeHTML() when last DOM element has displa...
    • a089447 correct some typehints (#495)
    • 1ecad88 fix: php 8.1 notices (#481)
    • 633b42a Fixed: null check for PHP 8.1 (#476)
    • 5596537 Fix Infinite Loop in Multicell with Auto Page Breaks Off (#473)
    • 56e5dfd GetCssBorderStyle Has Problem When !important Is Specified (#467)
    • e42b70c Support Apache 2.4 directives in htaccess file (#530)
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • SealImage error

    SealImage error

    Hello,

    I just tried to used your SealImage function (I'm using the 1.0 dev version for laravel 9 compatibility).

    I'm having an error at $image = SealImage::fromCert($cert);

    Intervention \ Image \ Exception \ NotReadableException Image source not readable

    I checked, the seal image is in the Vendor src/Resources/img/... My certificate is ok (works with SignaturePdf() )... Any ideas of what's going on ?

    Thanks, Denis

    bug help wanted 
    opened by dgillier 1
  • Version alpha installation with psr-4 non compliant classes skipped ?

    Version alpha installation with psr-4 non compliant classes skipped ?

    Hello,

    I'm trying to install the last version (1.0.0) as I'm using Laravel 9.11 and PHP 8.1. I got the following msgs after composer require lsnepomuceno/laravel-a1-pdf-sign "^1".

    Class LSNepomuceno\LaravelA1PdfSign\Exceptions\InvalidX509PrivateKeyException located in ./vendor/lsnepomuceno/laravel-a1-pdf-sign/src/Exceptions/Invalidx509PrivateKeyException.php does not comply with psr-4 autoloading standard. Skipping. Class LSNepomuceno\LaravelA1PdfSign\Exceptions\CertificateOutputNotFoundException located in ./vendor/lsnepomuceno/laravel-a1-pdf-sign/src/Exceptions/CertificateOutputNotFounfException.php does not comply with psr-4 autoloading standard. Skipping.

    Thanks, Denis

    bug help wanted 
    opened by dgillier 1
  • Store/Retrieve certificate from Database

    Store/Retrieve certificate from Database

    There is a problem when recovering the saved data of the certificates. The error is the following:

    SNepomuceno\LaravelA1PdfSign\Exception\ProcessRunTimeException with message 'Process runtime error, reason: "17464:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto\asn1\tasn_dec.c:1149:. . 17464:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:crypto\asn1\tasn_dec.c:309:Type=PKCS12. . "'

    Table cretificates:

    CREATE TABLE certificates ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, content TEXT NOT NULL COLLATE 'utf8mb4_unicode_ci', hash VARBINARY(50) NULL DEFAULT NULL, password VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_ci', user_id BIGINT(20) UNSIGNED NULL DEFAULT NULL, created_at TIMESTAMP NULL DEFAULT NULL, updated_at TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (id) USING BTREE, INDEX certificates_user_id_index (user_id) USING BTREE, CONSTRAINT certificates_user_id_foreign FOREIGN KEY (user_id) REFERENCES test.users (id) ON UPDATE RESTRICT ON DELETE CASCADE ) COLLATE='utf8mb4_unicode_ci' ENGINE=InnoDB AUTO_INCREMENT=2 ;

    the problem occurs in both mysql and sql server.

    I have tried several types in the hash column, both string and binary and the problem persists.

    I don't know what data type to use to store the hash field. image

    I have tried saving the hash in string using the bin2hex method and then when retrieving it uses hex2bin. unsuccessfully

    documentation help wanted 
    opened by jltrevizon 1
  • PDF timestamping while signing ?

    PDF timestamping while signing ?

    Thanks a lot for this library !

    I wondering if you plan to add timestamping on it (RFC3161) ?

    (using for example https://www.freetsa.org/, or any secure timestamp server : https://kbpdfstudio.qoppa.com/list-of-timestamp-servers-for-signing-pdf/)

    documentation enhancement 
    opened by dgillier 11
Releases(1.0.4)
Owner
Lucas Nepomuceno
Lucas Nepomuceno
Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2

Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled template and a default template for the store you need your template the system will print the pdf template.

EAdesign 64 Oct 18, 2021
PHP library generating PDF files from UTF-8 encoded HTML

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancement

null 3.8k Jan 2, 2023
Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Piotr Śliwa 335 Nov 26, 2022
A Laravel package for creating PDF files using LaTeX

LaraTeX A laravel package to generate PDFs using LaTeX · Report Bug · Request Feature For better visualization you can find a small Demo and the HTML

Ismael Wismann 67 Dec 28, 2022
Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files

Laravel PDF Protect (fork) Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files. Installation You ca

Raphael Planer 2 Jan 23, 2022
Offers tools for creating pdf files.

baldeweg/pdf-bundle Offers tools for creating pdf files. Getting Started composer req baldeweg/pdf-bundle Activate the bundle in your config/bundles.p

André Baldeweg 0 Oct 13, 2022
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 4, 2023
HTML to PDF converter for PHP

Dompdf Dompdf is an HTML to PDF converter At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is

null 9.3k Jan 1, 2023
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Jan 6, 2023
TCPDF - PHP PDF Library - https://tcpdf.org

tc-lib-pdf PHP PDF Library UNDER DEVELOPMENT (NOT READY) UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES ARE ALMOST COMPLETE BUT THE CORE LIBRARY STILL

Tecnick.com LTD 1.3k Dec 30, 2022
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.

PdfParser Pdf Parser, a standalone PHP library, provides various tools to extract data from a PDF file. Website : https://www.pdfparser.org Test the A

Sebastien MALOT 1.9k Jan 2, 2023
Convert html to an image, pdf or string

Convert a webpage to an image or pdf using headless Chrome The package can convert a webpage to an image or pdf. The conversion is done behind the sce

Spatie 4.1k Jan 1, 2023
A PHP tool that helps you write eBooks in markdown and convert to PDF.

Artwork by Eric L. Barnes and Caneco from Laravel News ❤️ . This PHP tool helps you write eBooks in markdown. Run ibis build and an eBook will be gene

Mohamed Said 1.6k Jan 2, 2023
Laravel Snappy PDF

Snappy PDF/Image Wrapper for Laravel 5 and Lumen 5.1 This package is a ServiceProvider for Snappy: https://github.com/KnpLabs/snappy. Wkhtmltopdf Inst

Barry vd. Heuvel 2.3k Jan 2, 2023
Generate simple PDF invoices with PHP

InvoiScript Generate simple PDF invoices with PHP. Installation Run: composer require mzur/invoiscript Usage Example use Mzur\InvoiScript\Invoice; re

Martin Zurowietz 16 Aug 24, 2022
Convert a pdf to an image

Convert a pdf to an image This package provides an easy to work with class to convert PDF's to images. Spatie is a webdesign agency in Antwerp, Belgiu

Spatie 1.1k Dec 29, 2022
PHP library allowing PDF generation or snapshot from an URL or an HTML page. Wrapper for Kozea/WeasyPrint

PhpWeasyPrint PhpWeasyPrint is a PHP library allowing PDF generation from an URL or an HTML page. It's a wrapper for WeasyPrint, a smart solution help

Pontedilana 23 Oct 28, 2022
Generate pdf file with printable labels

printable_labels_pdf Generate pdf file with printable labels with PHP code. CREATE A PDF FILE WITH LABELS EASELY: You can get a pdf file with labels f

Rafael Martin Soto 5 Sep 22, 2022