Merge >300 PDF files to a single PDF, error: too many open files
Asked Answered
S

0

1

I would like to merge 500 PDF files in R.

Usually qpdf::pdf_combine worked fine for a few PDFs, but now I get the error: Too many open files.

I found that this error is related to the fact that qpdf opens the files during the process: https://qpdf.readthedocs.io/en/stable/cli.html. There is also a solution with --keep-files-open=[y|n]. However, I think this is not implemented in the R package.

Could I modify pdf_combine that it works? Or is there a better way to combine many PDF files in R?

Steatite answered 13/4, 2023 at 8:16 Comment(4)
I'd use other tools, see https://mcmap.net/q/45197/-merge-convert-multiple-pdf-files-into-one-pdf-closed/680068. Or if we really want R, then merge iteratively, for example, merge every 100 5 times, then merge 5 into one.Luttrell
Thank you. Yes I did it iteratively. However, it gets a bit complicated if I merge many fiel via a functions.Steatite
Did you verify it works with the qpdf command line tool?Towny
No I use qpdf actually only within RSteatite

© 2022 - 2024 — McMap. All rights reserved.