Jump to content
You must now use your email address to sign in [click for more info] ×

Hyperlink feature for files mostly unusable


p10n

Recommended Posts

Goal: I wanted to create a PDF file to serve as a starting page for all user manuals of a software product. This one-page PDF should contain links to all the user manuals (which are PDF files residing in the same folder as the starting page PDF).

While no problem with LaTeX (hyperref package), this seems undoable in Affinity Publisher; moreover, the interactive --> File link function in AP appears like a bad joke, looking at the following problems (I do NOT want to embed a file, just link it, thus have unchecked the respective box):

1.a) If I choose type "file", and type a file name like "filename.pdf" the link will not work even though the target file is there.

1.b) If I select a file, AP (seriously!) inserts the absolute path in the document, and thus also into the PDF. So the PDF will only work on my MacBook/PC. Who on earth would do such a thing?

1.c) If I manually delete the folders from the file path I get from 1.a, so that just the file name remains, then on export AP claims that the link is invalid, even though the target file is present. Huh!?

2) If I choose "URL" and type a valid file URL, e.g. "file://MyFile.pdf", the target seems to get modified to be all-lowercase (which kills the link on all case-sensitive operating systems (non-Windows) if the target has uppercase letters).

None of these links in a created PDF work on OSX, none works on Linux (did not try Windows):

  • On OSX just nothing happens.
  • On Linux, at least there is an error message - according to that, links from 2) seem to be interpreted as SMB URLs (e.g. smb://myfile.pdf ) which is even more weird.

Normal http:// website links do work for me on OSX as well as on Linux, so I think I am not doing sth wrong in general.

Link to comment
Share on other sites

On 2/4/2022 at 1:44 PM, p10n said:

(I do NOT want to embed a file, just link it, thus have unchecked the respective box)

This might be a problem or misunderstanding. As far I understand the option "include" does not mean to embed a linked file inside the exported PDF but rather to create a copy of the linked file together with & aside the exported PDF result, with the goal of being available regardless of their parent folders / paths. In the two attached PDF (A & B) each contains the 5 hyperlink types, the link "file" opens the respectively other PDF.

v183 hyperlinks A.pdf

v183 hyperlinks B.pdf

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

On 2/4/2022 at 4:44 AM, p10n said:

Goal: I wanted to create a PDF file to serve as a starting page for all user manuals of a software product. This one-page PDF should contain links to all the user manuals (which are PDF files residing in the same folder as the starting page PDF).

In this particular case you would be better served by an HTML document.

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

On 2/5/2022 at 6:13 PM, thomaso said:

This might be a problem or misunderstanding. As far I understand the option "include" does not mean to embed a linked file inside the exported PDF but rather to create a copy of the linked file together with & aside the exported PDF result, with the goal of being available regardless of their parent folders / paths. In the two attached PDF (A & B) each contains the 5 hyperlink types, the link "file" opens the respectively other PDF.

v183 hyperlinks A.pdf 34.96 kB · 2 downloads

v183 hyperlinks B.pdf 35.06 kB · 2 downloads

Oh, thank you - I was not aware of this!

However, this does not alter the problem. My user manuals are generated from LaTeX, and will be copied into the target directory at a later stage of the publishing process. So having AP copy anything anywhere does not make sence. I just want to create this one PDF in AP that has links to a few other pdf files that I know will be present (and yes I know their name exactly, and they do not contain any spaces, totally simple). I do not understand why AP behaves so stubborn. In 98% of use cases you want a relative path. 1% being you create the PDF for a company network where everything is fixed on all workstations, and the other 1% is you are trying to make your users go crazy when they try to copy the parent folder somewhere else. (Sorry for sarcasm.)

How did you manage to create the links to relative paths? Does AP convert the links to relative ones, when you let AP copy the files? If this is the workaround, I would have to create 10 dummy files for this, and delete them afterwards...

Link to comment
Share on other sites

On 2/5/2022 at 6:18 PM, Wosven said:

We discussed this problem here:

 

Thank you for the link!

The original poster (Daniel Gilbert) is fully correct. He basically makes the same point: The only thing AP needs to do is to write a URL into the PDF file. As long as the URL conforms to the standard, it is a bug (or at least very unexpected, bad behavior) that AP removes the link from the generated PDF for no forseeable reason.

The other problems mentioned further down in the thread are related, but do not argue logical a root cause. Let me explain:

1) Spaces in the file names: I would try to avoid spaces in file names, but it is possible to have them – you just need to properly encode them in the URL, as it is explained further down in the thread. Ask any knowledgeable web programmer. If anything, this would be a reasonable thing for AP to do here. (Check that the URL conforms to the standard.)

2) Slashes versus back slashes ("/" vs "\"): URLs or file paths should be system-independent, and I am sure all PDF readers, also on Windows, will adhere to the standard here (which is to use forward slashes "/"). Same as 1, if anything, this would be reasonable thing that AP could check (see 1, ensure standard-compliance).

3) The excuse that "AP refuses to export because the URLs are invalid" is imho not a good one: I agree that the job of AP is to verify that the URL is syntactically correct (adheres to the standard), and yes, AP should warn if it is not. BUT, it should not just delete the URL from the PDF, just because the link target is not present. There are users who know what they are doing, and you should not hinder them from using AP. Issue a warning, but go ahead if the user wants to.

Summary of 1-3: Affinity, please do not obstruct users, rather help them create a standard-compliant URL.

4) I did not check, but it looks like AP is storing absolute paths in the AP files? If so, I am worried, and I would never ever use this then. Storing absolute paths in files is BAD in most cases. Suppose I move the whole AP project from one folder to another, or I archive it to an external disk, or I send it over to a colleage to work on it. In all these cases, all the links will be broken!

Thanks for reading my long post - I hope I explained it in a logic way. I want to avoid that other AP users despair because if this stubborn behvaior of AP, and that they need to use different tools, like Gilbert and me.

Link to comment
Share on other sites

On 2/5/2022 at 6:54 PM, Old Bruce said:

In this particular case you would be better served by an HTML document.

Yes, HTML would be very reasonable to use.

However, PDF has some advantages here:

  • We want to design it like a printed matter (such as the linked manuals are), I do not want to deal with line wrapping, window size etc.
  • It should look good when printed
  • We do not want users to need a web browser as well (I think it is nicer to have one tool for all documents)

YMMV, of course.

(I was so happy to find that Serif had thought of file links, but then got frustrated as it turned out not working. If Serif would want me to use HTML, why would they have implemented the "file" link option? 🙂 )

Link to comment
Share on other sites

10 hours ago, p10n said:

We want to design it like a printed matter (such as the linked manuals are), I do not want to deal with line wrapping, window size etc

In my experience producing books in HTML format for Project Gutenberg, you really don't need to worry about those things. The browser will handle it for you.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

On 2/4/2022 at 1:44 PM, p10n said:

This one-page PDF should contain links to all the user manuals (which are PDF files residing in the same folder as the starting page PDF).

12 hours ago, p10n said:

4) I did not check, but it looks like AP is storing absolute paths in the AP files?

If you download this two sample PDFs and experience their "file" link working then it indicates their linked file path is rather relative than absolute, and this method could be your desired way.

 

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.