I have a Rails app that needs to be able to combine/merge PDFs where one or more of them have optional content. I'm able to merge PDFs without any issues with the CombinePDF gem when none of them have optional content, but when one does I get the following error:
Couldn't merge PDF: Optional Content PDF files aren't supported and their pages cannot be safely extracted.
I can't find other gems that combine PDFs that have optional content. Could I maybe tell these PDFs to convert their optional content into a certain format that makes them mergeable, or something of the sort? Any help will be appreciated. Thanks.
With the CombinePDF gem you can add option allow_optional_content although the result can be weird as the one layer pdf format may not know how to show all optional contents. More info can be found here