|
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!
|
|
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
|
|
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!
|
|
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!
|
|
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!
|
|
Rank: Member Groups: Member
Joined: 8/12/2011 Posts: 16
|
Hi,
We will try it out immediatly! Very pleased with the quick responds!
Thanks!
|
|
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!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are very welcome! Glad that it works for you!
|
|