ABCpdf7 不使用 AddImageUrl 渲染图像

发布于 2024-08-25 12:50:54 字数 959 浏览 4 评论 0原文

在我看来相当具有异国情调。我们最近从Windows Server 2003升级/迁移到2008,现在使用Doc.AddImageUrl()时似乎无法渲染图像。 (保存 pdf 时,图像以正确的尺寸显示,但 IE8 丢失图像 x 显示)。

如果我理解正确的话,ABCpdf 在内部使用 IE 渲染来完成此类事情。

我们认为这可能是权限问题,但我们检查了 IE ESC,似乎已按照他们的建议进行配置。还有其他人遇到过类似的问题吗?也许需要代码配置?

不是整个片段,而是 ABCpdf7 的内容:

using (Doc doc = new Doc())
        {
            doc.HtmlOptions.PageCacheEnabled = false;
            doc.HtmlOptions.UseNoCache = true;
            doc.HtmlOptions.PageCacheClear();
            doc.HtmlOptions.PageCachePurge();
            doc.HtmlOptions.UseResync = true;
            doc.HtmlOptions.ImageQuality = 25;

            int pageID = doc.AddImageUrl(url + "&guid=" + url.GetHashCode());

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

  // file saving etc.
    }

Fairly exotic it seems to me. We recently upgraded/migrated from Windows Server 2003 to 2008, and now it seems that images cannot be rendered when using Doc.AddImageUrl(). (when the pdf is saved, the images appear at the correct dimensions, but the IE8 missing image x shows up).

If I understand correctly, ABCpdf uses IE rendering internally for this sort of thing.

We thought it might be a permission issue, but we've check IE ESC and that seems to be configured as they suggest. Has anyone else run into a similar problem? Perhaps a code configuration is needed?

Not the entire snippet, but the ABCpdf7 stuff:

using (Doc doc = new Doc())
        {
            doc.HtmlOptions.PageCacheEnabled = false;
            doc.HtmlOptions.UseNoCache = true;
            doc.HtmlOptions.PageCacheClear();
            doc.HtmlOptions.PageCachePurge();
            doc.HtmlOptions.UseResync = true;
            doc.HtmlOptions.ImageQuality = 25;

            int pageID = doc.AddImageUrl(url + "&guid=" + url.GetHashCode());

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

  // file saving etc.
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很糊涂小朋友 2024-09-01 12:50:54

从代码中提取单元测试以在多个环境上进行测试。事实证明,我们的开发数据库服务器(这是唯一一台运行 2008 年的服务器)能够使用几乎完全相同的配置运行单元测试。

有了这些信息,我们就能够将范围缩小到生产中的 dll。尽管 ABCpdf.dll 是正确的(32 位),但 64 位核心 (ABCpdf7ce.dll) 已投入生产。

我想由于该组件的核心是 COM (iirc),因此我们没有抛出任何错误。此外,我们能够从 html 生成没有图像的 pdf,这对我来说很奇怪。

而且,最重要的是,我们的存储库中没有 64 位 dll 的记录,而 32 位 dll 位于我们的 GAC 中。据我所知,核心 DLL 仅用于构建,因此我们从受影响的环境中删除了这些 DLL,并且似乎状况良好。

Extracted a unit test out of the code to test on several environments. Turned out that our dev db server (which is the only other one running 2008) was able to run the unit test with almost the exact same config fine.

This information in hand, we were able to narrow it to the dll's on production. Even though the ABCpdf.dll was correct (32bit), a 64bit of the core (ABCpdf7ce.dll) was on production.

I guess since the core of the component is COM (iirc), we weren't throwing any errors. Further, the fact that we were able to generate the pdf from the html, sans images, is weird to me.

And, to top it all off, there is no record of a 64bit dll in our repository, and the 32bit dll was in our GAC. As far as I can tell, the core DLL is only used for building, so we removed those dlls from the affected environments and seem to be in good condition.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文