0

I am getting this exception thrown by the ABCpdf component: When deployed to POC server (Windows 2008, 32 bit, IIS7 32 bit, Windows Authentication), the component throws an exception when performing this operation: pdfDoc.AddImageUrl(uri);

Unable to render HTML. Unable to access URL.
COM error 80070005. Access is denied.
URL 'http://localhost:878/SimplePage.aspx'.

Same error, when replacing localhost with the actual IP:
Unable to render HTML. Unable to access URL.
COM error 80070005. Access is denied.
URL 'http://192.168.26.230:878/SimplePage.aspx'.

However, there is no problem generating PDF from any external uri, like http://www.google.com.

Access is denied to WHAT ???

IIS pool is running under Network Service account. But when I set it to run using Local System account, it works.

monstro
  • 6,254
  • 10
  • 65
  • 111

1 Answers1

0

You wrote "IIS7 32 bit, Windows Authentication". This means that your IIS site expects the user-agent to use NTLM authentication. You therefore need to tell ABCpdf what account to use.

See the LogonName Property of ABCpdf.

You will need to provide a real username and password that actually has access to the IIS site. Network Service is not a real account (it has no password).

You may be better off adding the Anonymous authentication method to your localhost IIS site, so that ABCpdf does not need credentials to access it.

Ross Presser
  • 6,027
  • 1
  • 34
  • 66
  • I can't make Anonymous Authentication, app was designed only for Windows Authentication. Providing Logon to ABCpdf object... not doable here. It makes total sense to grant required permissions for Network Service to "WHAT"? "Access Denied" ABCpdf COM exception message doesnt say - access denied to what :)) – monstro May 22 '14 at 12:27
  • If you're serious about "not doable here" then you're going to fail utterly. The fact that "Networkservice" has credentials means NOTHING to abcpdf. Abcpdf is trying to access your website. It's opening up its own fresh connection. Imagine it with a browser of its own. It needs to provide credentials to the website. You'll have to select an existing user, or create one for it, and code both the username and the password directly into your app (or in web.config, or whatever). – Ross Presser May 22 '14 at 20:21
  • Thanks a lot for clarifying this. Then why is it working under Local System account? – monstro May 22 '14 at 20:42
  • To be honest, I'm not sure why it would work when the app is running under LocalSystem. – Ross Presser May 22 '14 at 21:39