33

I guess the title pretty much describes the problem.

I'm using Inkscape to write a SVG document, and convert it to PDF to share on the web (keeping SVG as original file is safer)
I have many URLs in this document. I know internal links (clickable and not necessarily showing the whole URL on screen) don't mean a lot in SVG and Bitmap images (which are usually supposed as final output document), but they are good in PDF.

Editing output PDF file and adding links is very hard, because is PDF format is complicated and nasty (unless there is a easy to use editor program).
How can add such links the easy way (preferably in Inkscape/SVG)

2
  • I finally had to move all my links to a separate page that I made with LibreOffice Draw, and exported to pdf, and merged those multiple pdf files with pdftk.
    – saeedgnu
    Mar 12, 2014 at 18:05
  • 2
    Could you consider accepting superuser.com/a/1575112/344983 ? I have tried the solution and it is indeed working in the latest version of Inkscape. ^^
    – Peque
    Nov 5, 2020 at 21:11

7 Answers 7

26

This functionality has been implemented in Inkscape 1.0:

  • right-click on object
  • select "Create link"
  • enter target address under "Href"
  • store as PDF using "Save a copy..."
  • (I also restricted the output to PDF 1.4)

My system: Linux Mint 19.3, Inkscape 1.0+r73+1.

5
  • 2
    works for PDF 1.5 as well
    – Sparkler
    Nov 1, 2020 at 2:24
  • 1
    Tested also on Windows 10, Inkscape 1.0.1. Good thing to note that even if the older versions have the option to create the link(s), they do not work when the file is saved as .pdf.
    – Niko Fohr
    Dec 27, 2020 at 12:07
  • Is it possible to ensure the links open in a new window/tab ? Just tested with Chromium's built in PDF viewer and the method here works (after finding the option in the Object Attributes tab; not shown in right click menu on my version) however links change the current window location. I tried adding '_blank' and 'blank' in the 'Target' field in Object Attrbitues for the object ie- same panel the the link is also entered but does not seem to have an affect.
    – Derrick
    Dec 17, 2022 at 22:36
  • 1
    As of writing (v1.2.2), I think they renamed this menu item to "Create Anchor". May 9, 2023 at 15:36
  • I had problems doing this with Inkscape version 0.9. I just updated Inkscape and it worked as described.
    – Stockfisch
    Mar 12 at 15:29
8

Building on Király's "theory", I wrote a massively hackish python script to add hyperlinks to the generated PDF.

All the instructions on what you need and how to use it is provided in the header comment of the script. I've tested this with my cutting edge software. If you run into problem because of different inkscape/qpdf version, shoot me an email with your files and I'll see if I can help.

EDIT: I have re-written this script in Go with much better usability. Now you simply add hyperlinks to objects using "Create Link" option when right clicking, and run the svglinkify program.

1
  • Works nicely! To compile svglinkify I had to update my version of Go. The current version provided by conda-forge works fine (go-1.13.14).
    – m00am
    Jul 23, 2020 at 9:23
6

The best solution I found to have your links working in PDFs created from Inkscape would be:

  1. save from Inkscape as "Plain SVG".
  2. open in Chrome the plain SVG file.
  3. from Chrome: Print/Save as PDF.
2
  • That didn't work for my complicated svg. The plain svg is shown properly with Chrome, but Chrome's pdf output is a complete mess! And URL's are not clickable either. Let alone internal links are not possible this way (you need a tagging format like bbcode or html)
    – saeedgnu
    Mar 12, 2014 at 17:52
  • That happens if I "Print to PDF". But if I save as pdf, the output file is shown properly with my pdf reader, but URLs are still not clickable. And text zooming does not work (it's like a bitmap image)
    – saeedgnu
    Mar 12, 2014 at 18:00
1

One (indirect) way if your links are based on text would be to go through Latex.

When exporting the PDF, tick the box "Dont include text but generate latex file". Then the coordinates of text objects will be available in the .pdf_tex file, where you will need to add manually the links. Then compile with pdflatex.

1
  • In Inkscape 0.48, this option is titled "PDF+Latex: Omit text in PDF, and create LaTeX file". I don't know very much TeX, but thanks anyway :)
    – saeedgnu
    Apr 2, 2014 at 8:46
1

If you are facing problem in Inkscape, you can edit your PDF file with an attached link from here: http://www.pdfescape.com/open/

2
  • 2
    Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, merged into another one or the main site just disappears... :-( Therefore, please edit your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! ;-) You can always leave the link in at the bottom of your answer as a source for your material... Apr 4, 2017 at 13:05
  • @DonaldDuck: The link points to an online tool (there are no relevant steps)
    – Clément
    Nov 30, 2018 at 17:56
0

Theoretically, right click on any object, and click "Create Link". Then right click again on the same object, for "Link properties" ...

Theoretically. .)

2
  • I brought your theory to life. =]
    – Mansour
    Mar 6, 2015 at 11:17
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
    – Ramhound
    Nov 20, 2015 at 15:42
-1
  • Right-Click on the desired object
  • Click "Create Link"
  • A Window will open .. in "href" field add your URL.
  • Save your document as SVG.
  • Open your document with Google Chrome and press Ctrl+P.
  • Right-Click on the preview of your document and click "Inspect element"
  • Copy the link in "src" field and open it with Google Chrome, the document will start download as a PDF document.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .