boazsegev / combine_pdf

A Pure ruby library to merge PDF files, number pages and maybe more...
MIT License
734 stars 156 forks source link

Allow user to preserve PDF names #163

Open KWkyle opened 5 years ago

KWkyle commented 5 years ago

Hi

We use wkhtmltopdf to convert PDF, it provides --dump-outline to export a XML that contains document outline and PDF detination names.

wkhtmltopdf allows special link destination that matches PDF destination names to be converted as PDF links. (ie _WKANCHOR*), which allows generating custom ToC page.

We use CombinePDF to merge the toc pdf and content pdf, but we found the linking feature won't work due to CombinePDF automatically rename named destinations.

This is a patch that add a new option preserve_names, to allow user to merge two PDF without renaming destinations.

Thanks

romarioliveira25 commented 4 years ago

Hello @KWkyle, is working this change? I'm also have experiencing some issues with outlines when merging after create with wkhtmltopdf