Forum How do I...?

Show image in UNC path

mark_anderson_us
Hi All

Have an internal (intranet app) and there are images that I want to include that are on a unc path. The UNC path built dynamically based on the source XML and is like this:

\\SERVER\File Share\ERP\Training Materials\Job #56446/36732_001.jpg

How would I create this is the HTML?

Not sure whether I need to do any or all of the following

- Escape slashes,
- Switch to forward slashes
- Use a file:// prefix
- Replace spaces with %20, etc.

I'm figuring my final HTML will be something like this:

<img style="page-break-before: always; height: 100px; width: 100px;" src="{$full_layout_path}"/>

TIA

MArk
wangp
These work and are equivalent:
file:////SERVER/path/to/file.jpg
file://localhost//SERVER/path/to/file.jpg


The first example has four leading slashes. It should more properly require five slashes; we will investigate.

You may wish to use the --remap option to avoid using UNC paths in your document:
prince test.html --remap http://server=//server
mark_anderson_us
thanks
Nevor
Hello,

I would like to bring back this issue as I was bitten by this recently. There seems to be essentially two non-surprising way to handle UNC in paths:

- expect it to be treated as a local file path, so we might want to apply the same naive algorithm used for windows paths:
file://localhost/ + path => file://localhost/C:/some/folder => compressed to file:///C:/some/folder
which might give with UNC:
file://localhost/ + //server/share/path => file://localhost///server/share/path => file://///server/share/path

- expect it to be treated as a remote file:
file://server/ + path => file://server/share/path

The last option is what is given after normalization of the first one by the System.Uri .Net API and Chrome which are the most authoritative behavior I could find.

Unfortunately, neither option is accepted by prince, I would like to know if it could be considered as a bug since it's a little surprising at first sight.

Edited by Nevor

mikeday
We will take another look at this issue.