Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge a merged file #60

Open
josepanta opened this issue Jul 16, 2021 · 2 comments
Open

Merge a merged file #60

josepanta opened this issue Jul 16, 2021 · 2 comments

Comments

@josepanta
Copy link

josepanta commented Jul 16, 2021

$pdfMerger->addFile("archivo1.pdf");
$pdfMerger->addFile("archivo2.pdf");
$archivo = $pdfMerger->merge();

$pdfMerger->addFile($archivo);

@PierreLebedel
Copy link

@josepanta I think you should use the addRaw() method (instead of the addFile() one) to put the contents returned by merge()

@SpicyTacos23
Copy link

I'm having problems merging merged files.

Trying the regular:

 $merger = new Merger();
/...
$merger->addFile($tmp_filename);
.../
 $merged_file = $merger->merge();

And got the following Exception:

'This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)'

Then i tried one of the possible solutions for the TCPDI Merger in here https://packagist.org/packages/iio/libmergepdf

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.

Known issues:
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!

Tried using
$merger = new Merger(new TcpdiDriver());
But did not work.

Any suggestions?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants