Forum How do I...?

Linking Between HTML Files in a Single PDF

So I have done some poking around in the forum about this topic and I see where others have had similar issues but I haven seen a definitive answer.

I'm creating a single PDF using multiple (x)HTML5 files. So for example lets say I have three files sitting in a folder on my desktop.


And if "file-1.html" as links pointing to file-2, and file-3 and it is written like so:


And I create a single PDF using these three files the links between "file-1" and "file-2" work fine. However of the links look like this:


Then the links are not created properly and cannot be resolved in the PDF even though they are resolvable in a browser.

The link in the PDF indicates a value in the link that contains a full path and looks something like this:


I know that the cleaner/simpler relative paths are better but we do not always control this. Is there a way to deal with this problem without changing all the @href values?

I haven't tested this yet, but sometimes we have a subfolder with files inside and out that point to each other. I am assuming they would break also.
Currently Prince does not automatically resolve all the paths to a single canonical form, so you need to ensure that they are syntactically identical for the links to be resolved as you expect.