ABCpdf不会在IIS6下的Web应用程序中呈现图像

Pau*_*aul 8 iis-6 abcpdf

我正在尝试使用ABCpdf将包含图像的网页渲染到pdf文档中.这是通过Web应用程序完成的.

当我在IIS5中的开发机器上运行应用程序时,一切都很好.当我在IIS6上部署应用程序时,图像不会出现在pdf中.

为了重现这个问题,我创建了一个简单的Web应用程序来从一个简单的网页渲染一个pdf文件,我发现非本地的图像是那些没有出现在pdf中的图像.

与ABCpdf交互的相关代码是:

Doc theDoc = new Doc();
theDoc.Rect.Inset(18, 18);
theDoc.HtmlOptions.PageCacheEnabled = false;
theDoc.HtmlOptions.PageCacheClear();
theDoc.HtmlOptions.UseNoCache = true;
theDoc.HtmlOptions.Timeout = 60000;

int theID = theDoc.AddImageUrl(theUrl);

while (true)
{
  if (!theDoc.Chainable(theID)) break;
  theDoc.Page = theDoc.AddPage();
  theID = theDoc.AddImageToChain(theID);
}

for (int i = 1; i <= theDoc.PageCount; i++)
{
  theDoc.PageNumber = i;
  theDoc.Flatten();
}

theDoc.Save(location);
theDoc.Clear();
Run Code Online (Sandbox Code Playgroud)

我用于测试的html页面是这样的:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Test page</title></head>

<body>
<p>This is a local image</p>
<img src="http://myserver/test/images/testimage.gif" />

<p>This is a remote image</p>
<img src="http://l.yimg.com/a/i/ww/beta/y3.gif" />

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

所以我正在尝试将此页面上的页面呈现为:http://myserver/test/testpage.html(上面的代码)为pdf.

在IIS6中,第二个映像(不是服务器的本地映像)不会出现在pdf中.

这似乎是访问权限的问题,但我无法弄明白.

谢谢.

小智 2

我也遇到过类似的问题,发现是图片文件太大造成的。