GithubHelp home page GithubHelp logo

pdfmerger's Introduction

#PDFMerger for PHP (PHP 5 and above up to PHP 7.1 and PHP 8 Compatible)

PDFMerger created by Jarrod Nettles December 2009 [email protected]

Updated by Vasiliy Zaytsev February 2016 [email protected]

  • Uses tcpdf 6.2.12 by Nicola Asuni
  • Uses patched tcpdi_parser 1.0 by Paul Nicholls with own TCPdiParserException
  • Uses TCPDI 1.0 by Paul Nicholls with FPDF_TPL extension 1.2.3 by Setasign

PHP 5,6,7 and 8 Compatible

I have made some changes in original codes to make PHPMerger compatible for PHP 5.

  • Update

I tested with PHP 7.1 on my local machine and it still works.

Support of PDF 1.5 and PDF 1.6

FPDF and FPDI libraries replaced by TCPDF with TCPDI extension and parser.

Using Namespace

require_once ('PDFMerger/PDFMerger.php');

use PDFMerger\PDFMerger;
$pdf = new PDFMerger;

$pdf->addPDF('a.pdf');
$pdf->addPDF('b.pdf');

$pdf->merge('download','merged.pdf');

Example Usage

include 'PDFMerger.php';

$pdf = new PDFMerger; // or use $pdf = new \PDFMerger; for Laravel

$pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4');
$pdf->addPDF('samplepdfs/two.pdf', '1-2');
$pdf->addPDF('samplepdfs/three.pdf', 'all');


$pdf->merge('file', 'samplepdfs/TEST2.pdf'); // generate the file

$pdf->merge('download', 'samplepdfs/test.pdf'); // force download

// REPLACE 'file' WITH 'browser', 'download', 'string', or 'file' for output options

pdfmerger's People

Contributors

bwdutton avatar kadmillos avatar myokyawhtun avatar notriddle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdfmerger's Issues

Loosing hyperlink when merge pdf

Hi,
I'm formatting pdf page with wkhtmltopdf, and after, i'm merging them.
hyperlink are right formatted with https:// ... and are working in each pages formatted with wkhtmltopdf.
But when pages merged with the library, i'm loosing hyperlink.
Is there an option to keep them ?

How to add framework codeigniter 3 HMVC?

i use codeigniter 3 HMVC, and show error in browser =>> This site can’t be reached

my code in controller


defined('BASEPATH') OR exit('No direct script access allowed');
    use PDFMerger\PDFMerger;
    require_once APPPATH . "libraries/PDFMerger.php";
class Cetak_PDF extends MY_Controller {

public function combie_pdf()
    {
$pdf = new PDFMerger();

$pdf->addPDF('D:/htdocs/myproject/assets/doc1.pdf', 'all');
$pdf->addPDF('D:/htdocs/myproject/assets/doc2.pdf', 'all');
$pdf->merge('browser', 'TEST2.pdf');
}

}

Unexpected data in xref table

Hi,

We developed a simple webapp (using Laravel 5.1 and the composer wrapper of this repo). Everything was working fine on our local developement environment (vagrant with Laravel's Homestead). But once we deployed it online on a server (with PHP 5.6), PDFMerger always throws the following exception when merging PDFs :

Exception in pdf_parser.php line 191: Unexpected data in xref table

The PDFs we're merging are generated by dompdf, and, as I said, did not have problems locally with the same version of PHP.

I found some forum posts describing similar problems, but none seems to give a working solution. Any ideas ?

Thank you !

Use FPDF with this repo

Hi all! I need to generate a PDF file with FPDF and after merge this generated PDF with other that are uploaded on my server. If I include the fpdf.php when I merge PDF I have the error: "Cannot redeclare class FPDF" so can I declare a fpdf object with include only PDFMerger? Thank you for reply

Adding images after adding pdf files

It looks like, with the help of the tcpdf library, we should be able to merge images also. But there is no indication of the syntax for doing this from within the PDFMerger class object. Please provide an example.
Thank you.

Merger multiple page sizes

Hi!
How to correct merge files with different page sizes?
A4 size is fine but it truncates pages when doing with A3, A2, A1 sizes using orientation mode

FATAL ERROR in tcpdi_parser.php - Includes fix detail.

Was recieving the following error on 'some' merge requests:

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in C:\MyPath\www\PDFMerger\tcpdf\tcpdi_parser.php:503 Stack trace: #0 C:\MyPath\www\PDFMerger\tcpdf\tcpdi_parser.php(373): tcpdi_parser->decodeXrefStream() #1 C:\MyPath\www\PDFMerger\tcpdf\tcpdi_parser.php(212): tcpdi_parser->getXrefData() #2 C:\MyPath\www\PDFMerger\tcpdf\tcpdi.php(121): tcpdi_parser->__construct() #3 C:\MyPath\www\PDFMerger\tcpdf\tcpdi.php(88): TCPDI->_getPdfParser() #4 C:\MyPath\www\PDFMerger\PDFMerger.php(97): TCPDI->setSourceFile() #5 C:\MyPath\www\offline downloads\download-DL100.php(75): PDFMerger\PDFMerger->merge() #6 {main} thrown in C:\MyPath\www\PDFMerger\tcpdf\tcpdi_parser.php on line 503

Line 503 is:
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {

Changed to:
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {

Please verify this change and update the release accordingly if fit for purpose. :)

breaks on large pdfs

Does not appear to work on larger projects (700+ pages). Does not create a file when all pages added.

system: Linux/Generic i368
PHP 5.X

TCPDF_PARSER ERROR: decodeFilterFlateDecode: invalid code

Hello,

I'm encountering an issue while using PDFMerger, and the error message is as follows:

TCPDF_PARSER ERROR: decodeFilterFlateDecode: invalid code

This error doesn't happen with every merge, most files work fine. However, for a few of them, the merging process fails with this error. Could you please provide insights into the cause of this issue?

I have included the PDF files that failed to merge for your reference below.

22998087 inbound.pdf
22998087 outbound.pdf

Thanks a lot in advance!

Merge PDF 1.5 not working.

Hi,
I am using PDF version 1.5. Unable to merge them, and got the below error.

Fatal error: Uncaught Exception: TCPDF_PARSER ERROR: decodeFilterFlateDecode: invalid code in /var/www/html/ /PDFMerger/tcpdf/include/tcpdf_filters.php:475 Stack trace:
#0 /var/www/html/Optimization/PDFMerger/tcpdf/include/tcpdf_filters.php(360): PDFMerger\TCPDF_FILTERS::Error('decodeFilterFla...')
#1 /var/www/html/Optimization/PDFMerger/tcpdf/include/tcpdf_filters.php(95): PDFMerger\TCPDF_FILTERS::decodeFilterFlateDecode('b\x8F\\xBEW)ccQ\x0F\x06E\x83!j...')
#2 /var/www/html/Optimization/PDFMerger/tcpdf/tcpdi_parser.php(1173): PDFMerger\TCPDF_FILTERS::decodeFilter('FlateDecode', 'b\x8F\\xBEW)ccQ\x0F\x06E\x83!j...')
#3 /var/www/html/Optimization/PDFMerger/tcpdf/tcpdi_parser.php(1061): PDFMerger\tcpdi_parser->decodeStream(Array, 'b\x8F\\xBEW)ccQ\x0F\x06E\x83!j...')
#4 /var/www/html/Optimization/PDFMerger/tcpdf/tcpdi_parser.php(1097): PDFMerger\tcpdi_parser->extractObjectStream(Array)
#5 /var/www/html/Optimization/PDFMerger/tcpdf/tcpdi_parser.php(214): PDFMerger\tcpdi_parser->findObjectOffsets()
#6 /var/www/htm in /var/www/html/Optimization/PDFMerger/tcpdf/include/tcpdf_filters.php on line 475

PHP 8.2 not working

I am running back to back PHP8.0 and PHP8.2 and am getting the following in PHP8.2:

PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 1999
PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2021
PHP Deprecated: Optional parameter $setbom declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2037
PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2037
PHP Deprecated: Optional parameter $setbom declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2057
PHP Deprecated: Optional parameter $forcertl declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2057
PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2057
PHP Deprecated: Optional parameter $str declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2074
PHP Deprecated: Optional parameter $setbom declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2074
PHP Deprecated: Optional parameter $forcertl declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2074
PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2074
PHP Deprecated: Optional parameter $str declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2090
PHP Deprecated: Optional parameter $forcertl declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2090
PHP Deprecated: Optional parameter $isunicode declared before required parameter $currentfont is implicitly treated as a required parameter in PDFMerger\tcpdf\include\tcpdf_fonts.php on line 2090
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::AddPage"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 323
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::AddPage"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 323
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::AddPage"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 323
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::Link"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 338
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278
PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in PDFMerger\tcpdf\fpdf_tpl.php on line 278

Fatal error: Uncaught Error: Class 'PDFMerger\TCPDI' not found in

I have

include 'PDFMerger.php';
use PDFMerger\PDFMerger;
require_once 'PDFMerger.php';

$pdf = new PDFMerger;

$pdf->addPDF('t1.pdf', '1, 3, 4')
->addPDF('t2.pdf', '1-2')
->merge('file', 'out.pdf');

and I receive the following error/warning

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /Users/epanagio/Sites/play2/PDFMerger-master/tcpdf/tcpdf.php on line 17778

Fatal error: Uncaught Error: Class 'PDFMerger\TCPDI' not found in /Users/epanagio/Sites/play2/PDFMerger-master/PDFMerger.php:87 Stack trace: #0 /Users/epanagio/Sites/play2/PDFMerger-master/sample.php(10): PDFMerger\PDFMerger->merge('file', 'out.pdf') #1 {main} thrown in /Users/epanagio/Sites/play2/PDFMerger-master/PDFMerger.php on line 87

Based on another user's entry I modified and added

$fpdi = new TCPDI;

and now I receive:

Fatal error: Uncaught Error: Class 'TCPDI' not found in /Users/epanagio/Sites/play2/PDFMerger-master/sample.php:3 Stack trace: #0 {main} thrown in /Users/epanagio/Sites/play2/PDFMerger-master/sample.php on line 3

The files are stored in:

-rwxrwxrwx@ 1 epanagio staff 5248 Nov 16 2017 PDFMerger.php
-rwxrwxrwx@ 1 epanagio staff 1168 Nov 16 2017 README.md
-rwxrwxrwx@ 1 epanagio staff 558 Nov 16 2017 composer.json
-rwxrwxrwx@ 1 epanagio staff 221 Mar 9 11:49 sample.php
-rwxrwxrwx@ 1 epanagio staff 2213007 Mar 3 21:33 t1.pdf
-rwxrwxrwx@ 1 epanagio staff 2225123 Mar 4 08:23 t2.pdf
drwxrwxrwx@ 19 epanagio staff 608 Nov 16 2017 tcpdf

I changed the permissions to be 777 as a test.

How do I get rid of that fatal error?

Allowed memory size exhausted

Hi there,
I'm trying to implement PDFMerger and I'm getting the error below:

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /web/Classes/PDFMerger/tcpdf/tcpdi_parser.php on line 898

This doesn't occur for every merge, mostly 1-3 files work fine, but as soon as I run it on 5-20 files, I'm getting this error. I couldn't figure out what causes this error, because mostly I'm merging files below 1MB. Is this issue known in any way?

Thanks a lot in advance!

Best wishes,
Frederik

Fatal error with some pdf files

with some pdf files, I get this error :
Fatal error: Allowed memory size of 1342177280 bytes exhausted (tried to allocate 322203 bytes) in /home/clients/0649bfce840f69e4556eeb22/web/application/libraries/PDFMerger-master/tcpdf/tcpdi_parser.php on line 865

I checked and it's not a problem of pdf size. 99% of my files work but with some I get this error

Problem installing with composer

Hi!

When I install using the following command:

   composer require myokyawhtun/pdfmerger

Returns the following error:

[InvalidArgumentException]
Could not find package myokyawhtun/pdfmerger at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

Class Syntax Incompatibility

Hello friends. Based on my research, it seems I have the error listed below due to a PHP version incompatibility.

Current PHP version : 5.4.452.0

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /path_to_file/PDFMerger.php on line 12

I can't change the PHP version so is there a way to change the the code to make this work?

Please advise and thanks in advance.

Steven

Addition>> Please ignore this issue. It was posted for the wrong version of PDFMerger. Sorry.

PDF Metadata

Is it somehow possible to set some meta data on the generated PDF like author, description, ... ?

cant load file from server

I am new to use this plugin. My problem is I tried to load pdf file from server url. But it cant load them from server. Need help please.

Fatal error: Uncaught TCPdiParserException

I got the following error:

Uncaught TCPdiParserException: Empty PDF data. in D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\tcpdf\tcpdi_parser.php:1425 Stack trace: #0 D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\tcpdf\tcpdi_parser.php(203): tcpdi_parser->Error('Empty PDF data.') #1 D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\tcpdf\tcpdi.php(121): tcpdi_parser->__construct(false, 'lib/temp/', 'exception') #2 D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\tcpdf\tcpdi.php(88): TCPDI->_getPdfParser('lib/temp/') #3 D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\PDFMerger.php(97): TCPDI->setSourceFile('lib/temp/') #4 D:\Programme\laragon\www\projects\Name Of Project\tools\public\pages\pdfmerge.php(21): PDFMerger\PDFMerger->merge('browser', 'lib/temp/Test.p...') #5 D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\system.php(53): include('D:\Programme\la...') #6 D:\Programme\laragon\www\projects\Name Of Project\tools\index.php(18): sys::view('pdfmerge') #7 {main} thrown in D:\Programme\laragon\www\projects\Name Of Project\tools\lib\classes\tcpdf\tcpdi_parser.php on line 1425

My Code:

if (!empty($_FILES['file_name']['name'][0])){
        $file_ary   = tool::reArrayFiles($_FILES['file_name']);
        $pdf        = new \PDFMerger\PDFMerger;
        $uploadTo   = "lib/temp/"; 
        $filename   = $uploadTo.basename($_POST['doc_name'].'.pdf');

        foreach ($file_ary  as $file) {
            $basename       = basename($file["name"]);
            $originalPath   = $uploadTo.$basename; 
            $tempPath       = $file["tmp_name"];
            if(move_uploaded_file($tempPath,$originalPath)){
                $pdf->addPDF($uploadTo.$filex, 'ALL');
            }
        }

        $pdf->merge('browser', $filename);
}

Warning in tcpdi_parser.php

While I was merging some files I get this error:
Warning: count(): Parameter must be an array or an object that implements Countable in ./vendor/myokyawhtun/pdfmerger/tcpdf/tcpdi_parser.php on line 503

Solution: replace line 503 on tcpdf/tcpdi_parser.php:
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
with
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {

thanks

Fatal error: Uncaught exception 'Exception' with message 'Could not locate PDF

hi guys,
i meet an fatal error: Could not locate PDF
Fatal error: Uncaught exception 'Exception' with message 'Could not locate PDF on '\home\site\m1.pdf'' in /home/site/public_html/PDFMerger.php:253 Stack trace: #0 /home/site/public_html/sample.php(20): PDFMerger\PDFMerger->addPDF('\\home\\site\\m..', 'all') #1 {main} thrown in /home/site/public_html/PDFMerger.php on line 253
the PDF file do exits, status 777.
could someone tell me how to fix it ?

thank you!

PDF Merge error

FPDF error: This document ('filePath') probably uses a compression technique which is not supported by the free parser shipped with FPDI.

composer

Can you add this as a composer package?

is it support new pdf version.

This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI

here is some infomation about meger.
looks not support pdf version 1.5 1.6

Fatal error: Uncaught Error: Class "PDFMerger" not found

I have tried many times but getting an error message:

Fatal error: Uncaught Error: Class "PDFMerger" not found in D:\xampp\htdocs\projects\test\pdfmerge\sample.php:4 Stack trace: #0 {main} thrown in D:\xampp\htdocs\projects\test\pdfmerge\sample.php on line 4

Testing on localhost

So please help me to fix this.

Class 'PDFMerger\exception' not found in

Hello All,
I am trying to use your class, however I got this error :
PHP Fatal error: Uncaught Error: Class 'PDFMerger\exception' not found in ..

I have followed the steps and examples found.
Any ideea for this error ?
Thank you,
DAniel

PDF 1.5 merge problems, php 8.1

Hello, I'm having issues wit pdf files that are working with 1.5 of pdf. Theese files worked with the original pdf merger by Jarrod Nettles, but I need it in newer PHP version.

require_once 'lib/PDFMergerPHP8/PDFMerger.php';
use PDFMerger\PDFMerger;

mezclarPDF();

function mezclarPDF(){
    $pdf = new PDFMerger;
    $pdf->addPDF(_ROOT_DIR_ . '\\pdf_inputs\\Personajes_TXT.pdf');
    //$pdf->addPDF(_ROOT_DIR_ . '\\pdf_inputs\\PedidoPDF.pdf');
    //$pdf->addPDF(_ROOT_DIR_ . '\\pdf_inputs\\PedidoPDFOld.pdf');
    $pdf->merge('browser', _ROOT_DIR_ . '\\pdf_outputs\\Personajes_TXT.pdf');
}

Personajes_TXT.pdf is the only file that works fine. The other ones, fails in lib\PDFMerger\tcpdf\tcpdi.php 503line:
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {

that I changed to:
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {

because php crashed by passing bool to count() function (seems like parenthesis typo mistake in the lib). But after this change, the lib only blocks itself, by consuming all memory available.

Cannot redeclare class FPDF in fpdi/fpdi2tcpdf_bridge.php on line 171

Hi

The redeclare issue is fixed if I comment the following lines:
(fpdi.php line 22)

// Check for TCPDF and remap TCPDF to FPDF
// if (class_exists('TCPDF')) {
//            require_once('fpdi2tcpdf_bridge.php');
//}

After commenting these lines, it seems everything works perfect. Am I doing something that will generate an issue later? or am I ok with these lines commented.

Timeout

I want to merge several PDF documents, all of them contain one page. It takes 1-2 seconds for ~20 files which is great. There is one exception: when I want to merge invoices which are issued by an online billing software. Even if I want to merge two files only, I get timeout error
Fatal error: Maximum execution time of 120 seconds exceeded in .../PDFMerger/tcpdf/tcpdi_parser.php on line 725
The line number is different at every running.
The size of the PDF file is around 100kb but PDFMerger can easily merge much bigger files when I need it.
When I modify the PDF files (e.g. compress) PDFMerger can merge them.
Merging the original files by different online services is also working.

Any suggestion?

Class 'PDFMerger' not found

Throwing error as :
Fatal error: Uncaught Error: Class 'PDFMerger' not found in XXXX\PDFMerger-master\sample.php:4 Stack trace: #0 {main} thrown in XXXX\PDFMerger-master\sample.php on line 4

Numbers and signs instead of letters

Hi there.
I'm trying to use PDFMerger in XAMPP (7.2.4) in MacOS Mojave.
But the output file contains numbers and signs instead of letters.
I don't know how to fix this issue.
Can you help Us?

Here's an example:

)"$+'/01#+'()2)"'1/-'&+$-3'),1$-$-#"'&(/0/1*/,4'$2/-5'6-'&-'1&0/$,'4"&7/(&3'0#27/,&"'&,-$'
#-3'8&#/%#1'$,/+5'!9&1$22#1'&#4#$'#",&3'7$9/#2&',),'09&"$-"&',$3'%2&,(/-'&-'2&#15'
:#22&+'1/-'&+$-'2/4#2&'2#-#13'$2$+$,-#+'2/4#2&'7$23'0)1#$"$'"/1#15';#/1<#$'7/-&$'+)22/1'
2&
#15'=),$'&'#2-"/$1'+&#"/15'>$1-/%#2#+'7$2'/01#+'$#'$2/-'"#-"#+'),(/+$,-#+'
-/,/(#,-'$-'+&11&5'?,-$4$"'+&@/+#1'&,-$'$#'+&#"/1'%/%$,(#+3'7/-&$'2&/,/&',/1/'4"&7/(&5'
:&+'<#/1'),1$<#&-',#,5'!")/,'&'$@'7/-&$'1$+'8$#4/&-'),7&22/15' :#22&+'&'1&0/$,'
(&0/%#13'8/,/%#1',/12'$#3'"#-"#+'1&0/$,5'A#"&%/-#"'2$
-#1'+&#"/13'1)22//-#(/,'1$('$") 1'#-3'
2#
-#1'7$,$,&-/1'B#1-)5'=),$'-$+0#1'&2/<#&+'(/&+'7/-&$'-$+0)"5':&+'<#/1'2/%$")'7/-&$'
+$-#1'+&@/+#1'4"&7/(&'/,',),'&"
#5

We need help!!
Thanks in advance.

include_path error

when using this library in laravel.Following error occurs : PDFMerger::__construct(): Failed opening required 'tcpdf/tcpdf.php' (include_path='.:/usr/share/pear:/usr/share/php');
Is it require pear library to be installed.But when changing require_once('tcpdf/tcpdf.php'); to require_once(DIR.'/tcpdf/tcpdf.php'); in PDFMerger.php it works.Is there any solution to make it work without updating the library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.