gettalong / hexapdf

Versatile PDF creation and manipulation for Ruby
https://hexapdf.gettalong.org
Other
1.21k stars 69 forks source link

PDF Merging Issues #271

Open bharat619 opened 10 months ago

bharat619 commented 10 months ago

I am trying to merge 2 PDF's. The first PDF does not have link. But the second PDF has links. By links, I mean that when I click on them it navigates to other part of the PDF. The links works fine if I don't merge the PDF's. But when I merge the PDF, I loose the ability to link to other part of the PDF.

I am using the CLI, hexapdf merge a.pdf b.pdf output.pdf

Here b.pdf file has the links.

A thing to note: If I do something like hexapdf merge b.pdf a.pdf output.pdf, the link works fine. But now I loose the order.

Am I missing something or doing something in a wrong way?

BTW, this is an awesome gem.

gettalong commented 10 months ago

Thanks for the report!

You are not doing anything wrong. The way the hexapdf merge command currently works doesn't preserve that information. I will see how to change that.

gettalong commented 7 months ago

By links, I mean that when I click on them it navigates to other part of the PDF.

@bharat619 Are those links on the pages themselves or do you mean the outline feature of a PDF that shows in an extra part of the PDF viewer?

anishnath commented 6 months ago

Used https://8gwifi.org/merge-pdf.jsp for PDF merge with ordering it works

gettalong commented 6 months ago

@anishnath That is okay but you will need to do that manually and can't do it automatically like with HexaPDF. It might also be a problem with sensitive documents that one doesn't want to share with a website.