|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
Hi, I am converting html to a pdf using EO.pdf.dll and it all works correctly on a single machine. The following error is thrown when trying to convert a file on machine A from machine B. There is no permissions issue as I can access the file over the network and other areas of the application can access the file.
EO.Pdf.HtmlToPdfException: Failed to convert Url '\\ComputerA\SomeDirectory\623.htm'.(1037:A network error occurred.) at EO.Pdf.HtmlToPdfException.b(Exception A_0) at EO.Pdf.Internal.j1.h() at EO.Pdf.HtmlToPdf.a(j1 A_0) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc)
I am using version 3.0.53.2. Is this a known issue and has it been fixed in a later version?
Regards, I look forward to hearing your response.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That's normal. "\\ComputerA\623.htm'" is not a valid path. There has to be a share name after the computer name.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
My mistake with the post. The real error message is a valid url of the form \\ComputerA\SomeDirectory\623.htm
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Error code 10037 means "can not open the file". This can be the path is invalid, or your application does not have sufficient permission to open the file.
You may also want to update to the latest build first, I wasn't sure about early builds but the current build definitely handle UNC path fine. As a test, you can try to run our sample app, then go to All Demos -> HTML to PDF -> Convert Url to convert the UNC path to verify whether it works.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
I think it maybe a problem with Html2Pdf.ConvertUrl.
This is the original code that wasn't working
var pdfDocument = new PdfDocument(); HtmlToPdf.ConvertUrl(sourceUrl, pdfDocument);
I changed it to the following and it now works over the network.
var pdfDocument = new PdfDocument(); string html = File.ReadAllText(sourceUrl); HtmlToPdf.ConvertHtml(html, pdfDocument);
There was never a problem with permission.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Glad that you found a workaround. This could still be a permission issue. The converter uses a separate process to perform the conversion (for a number of reasons, for example, if things go wrong we could kill the worker process without crashing your process), that process in theory inherits your process's security context, but you may have some additional settings/restrictions that prevent that process from accessing an UNC path.
If you still believe it's a problem with the converter, please try to reproduce the problem either with our demo application (or create a small test app) or provide detailed steps to reproduce. I cannot think of any difference between a test application and your actual application except that they may be running under different security context. So if it fails in your application and the reason is not about permission, then the problem should also occur with a test app. As long as we can see it happening, we should be able to get to the bottom of the issue.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
I have made a small test application that highlights the issue. Using the ConvertUrl button fails. using the ConvertHtml button runs successfully.
However, I can't find a way to attach the test project.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Thanks for the update. We have sent you a private message as to where to send the test project. We will look into it as soon as we have that.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have looked into the sample app and it appears to be a bug in your build instead of permission issues. Please accept our apology for pointing you to the wrong direction.
However the latest build should fix the issue for you. We have verified that build 3.0.68 works fine with the sample app. The latest build added HtmlToPdfOptions.AllowLocalAccess property which is true by default. This property does not exist in your version. So please try to update your app to this version and see if it works for you.
Thanks!
|
|