Welcome Guest Search | Active Topics | Sign In | Register

EOPdf Relative and absolute paths in hetml document Options
Erisma
Posted: Monday, August 15, 2011 7:13:35 AM
Rank: Member
Groups: Member

Joined: 8/12/2011
Posts: 16
Hi,

In our html documents we have paths to different resources that can be both absolute and relative pahs. For example: <img src='\\network_path\_images/trans1p.gif' />
<img src='c:\_images/trans1p.gif' />

We have tried to set the base url, but we cant get it to work for both alternatives.
Is there a way to make the pdf converter to find our resources from relative and absolute paths?

Thanks!
eo_support
Posted: Monday, August 15, 2011 8:27:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Have you tried using "file://network_path/_images/trans1p.gif" and "file:///c:/_images/trans1p.gif"? Note the "file://" prefix before the path name.

Thanks
Erisma
Posted: Monday, August 15, 2011 9:50:19 AM
Rank: Member
Groups: Member

Joined: 8/12/2011
Posts: 16
Hi,

We tried the two alternatives for the base url: "file:///c:" and "file://network_path", which works with all paths that are not absolute. "file:///c:" as base url even works for network paths, but not with an absolute path like "c:\_images".

In our application we can receive paths from both dynamically generated content, hardcoded paths and paths from a database, so we cant be 100% sure how the paths in the html are gonna be like. It might be "C:\Some\Path\img.gif" (might even have a mix of \ and /), "P:\Some\Path\img.gif", "\\NETWORK\Path\img.gif", "http://www.acme.com/img.gif", "./img.gif". The HTML is often created by our users, and if it works in IE, they expect it to work in the PDF.

If we set the base url to "file:///C:", images pointing to "C:\Some\Path\img.gif" won't load, only images pointing to "\\NETWORK\Path\img.gif" or "\Some\Path\img.gif". If we set the base url to just "file://", no images at all are loaded, which also seems to be the case if no base url is set.

Thanks!
eo_support
Posted: Monday, August 15, 2011 9:57:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see. We will tweak our path parsing code and see if we can make it "smarter". : )

Thanks!
eo_support
Posted: Monday, August 15, 2011 10:55:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have posted a new build that should handle path better. You can download it from our download page. With the new version:

1. You must set BaseUrl to a "file://" based Url if you wish to use file path (for example, "//network/path/img.gif"). If you do not set BaseUrl to a "file://" based Url, then the converter will NOT access any local files for security reasons;

2. It now supports the following file Url formats ('/' or '\' does not matter):

a. //network/path/img.gif. BaseUrl is not used to resolve such Urls (you still need to set it to enable file system access);
b. X:/path/img.gif. "X" is the drive letter. BaseUrl is not used to resolve such Urls (you still need to set it to enable file system access);
c. /path/img.gif. BaseUrl is used, but only the root folder is used. For example, if BaseUrl is set to "file:///c:/test" and the Url is "/path/img.gif", then the final path is "c:/path/img.gif" instead of "c:/test/path/img.gif";
d. path/img.gif. The whole BaseUrl is used. For example, For example, if BaseUrl is set to "file:///c:/test" and the Url is "path/img.gif", then the final path is "c:/test/path/img.gif";

Note the difference between c and d is c starts with "/".

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Erisma
Posted: Tuesday, August 16, 2011 1:40:58 AM
Rank: Member
Groups: Member

Joined: 8/12/2011
Posts: 16
Hi,

We will try it out immediatly! Very pleased with the quick responds!

Thanks!

Erisma
Posted: Tuesday, August 16, 2011 3:03:30 AM
Rank: Member
Groups: Member

Joined: 8/12/2011
Posts: 16
Hi,

This fixed our issues. No problem with network or absolute paths anymore. Nice!

Thanks!
eo_support
Posted: Tuesday, August 16, 2011 7:06:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome! Glad that it works for you!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.