I have a rails app that generates a pdf for a given html partial. In the partial I have a number of links that have a target of _blank, however in the generated PDF the target looks like it is being ignored.
I just want the pdf to open links in a new tab/window.
A collaborators from PDFKIT said
"This sounds like a problem with wkhtmltopdf (which is what renders the pdf from the html). (Pdfkit just wires up everything between ruby/rails and that binary.)"
Any help would be appreciated.
Regards,
Sean Hubers Answer:
PDFs are not marked up with HTML. How a link click is handled in a PDF depends on the PDF viewer you are using. Modern browsers with built-in PDF viewers may navigate to the page within the same frame as the PDF view and that is not something that can be controlled with an HTML element attribute. What happens if your link is clicked when the PDF is being viewed in Adobe Acrobat or Mac Preview? You're at the whim of the software and operating system. Sorry to bear the bad news but this is the reality of the PDF format.