如何使用 ASP(.NET) 将输出的 PDF 中的 HTML 转换为带有热链接的 PDF?最好使用 ActivePDF WebGrabber

发布于 2024-09-14 11:04:23 字数 652 浏览 2 评论 0原文

我的公司几年前购买了 ActivePDF WebGrabber,将经典 ASP 创建的 HTML 页面转换为 PDF 表单。我们经常遇到的该工具的唯一缺点是输出的 HTML 链接不热。是否有任何工具在 HTML 到 PDF 输出中包含热链接?

根据 ActivePDF 常见问题解答 Does WebGrabber 将超链接转换为可用输出 PDF 中是否有链接?,答案是否定的。答案最后有一句话让我很困惑:

“要在最终的 PDF 中实现链接, 应用程序将搜索链接 在 Postscript 生成之前, 并在 PDF 生成后附加它们 使用 Toolkit 生成。”

这是否意味着这就是实现它的方法,或者这是他们的理论但未经测试的解决方案?如果这是解决方案,是否有人这样做可以发布一些示例(伪)代码?

<强>编辑:我应该提到,我们对不同的工具持开放态度,并且我们需要可以通过经典 ASP 和 ASP.NET 访问它,我更喜欢自动热链接链接的解决方案。在 PDF 生成过程中。

My company purchased ActivePDF WebGrabber a couple of years ago to convert a classic ASP created HTML page into a PDF form. The only drawback with the tool that we continually run into is that the outputted HTML links are not hot. Are there any tools that do include hot-links within the HTML to PDF output?

According to the ActivePDF FAQ for Does WebGrabber convert hyperlinks into usable links in the output PDF?, the answer is no. There is a phrase confusing me at the end of the answer:

"To implement links in the final PDF,
the application would search for links
prior to the Postscript generation,
and append them once the PDF has been
generated using Toolkit."

Does that mean this is how to achieve it, or is this their theoretical but not tested solution? If this is the solution, has anyone done this that might be able to post some sample (pseudo-)code?

Edit: I should mention that we're open to a different tool, and we need it to be accessible via classic ASP and ASP.NET. I would prefer a solution in which the links are automatically hot-linked during PDF generation.

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

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

发布评论

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

评论(4

萌梦深 2024-09-21 11:04:23

看起来您可以在生成 pdf 后使用 activepdf 工具包来完成此操作。我认为这就是他们所指的。

对生成的 pdf 使用 AddHyperlink 函数

AddHyperlink 指示 Toolkit 添加
当前输出文件中的超链接
连接到指定的 URL。
单击后,该 URL 将在新窗口中打开
浏览器窗口。

编辑
获得实际执行此操作的工具会更容易,这里有一些链接

开源 HTML 到 PDF 渲染器,具有完整的 CSS 支持

https: //stackoverflow.com/questions/3178448/list-of-html-to-pdf-converters

Looks like you can do it with the activepdf toolkit after the pdf is generated. I think this is what they are referring to.

Use the AddHyperlink function on the resultant pdf

AddHyperlink instructs Toolkit to add
a hyperlink in the current output file
that connects to a specified URL.
When clicked, the URL opens in a new
browser window.

edit
It would be easier to get a tool that actually does this here are some links

Open Source HTML to PDF Renderer with Full CSS Support

https://stackoverflow.com/questions/3178448/list-of-html-to-pdf-converters

浅笑依然 2024-09-21 11:04:23

过去,activePDF Server 是 activePDF WebGrabber 背后的引擎。 activePDF Server 是一个打印到 PDF 程序(因此引用了 Postscript),因此链接不是实时的。

从 WebGrabber 2009 版本开始,对服务器的依赖被删除,WebGrabber 现在(2009 和 2010 版)输出智能 PDF,其中包括 HTML 到 PDF 输出中的热链接。

In the old days, activePDF Server was the engine behind activePDF WebGrabber. activePDF Server is a Print-to-PDF program (hence the reference to Postscript) so the links were not live.

Beginning with the WebGrabber 2009 release, the dependancy on Server was removed and WebGrabber will now (versions 2009 & 2010) output intelligent PDFs that include hot-links within the HTML to PDF output.

木緿 2024-09-21 11:04:23

如果您可以调用网络服务,请尝试 PDF 转换服务。我们目前正在寻找 html 到 pdf 位的 beta 测试人员,只需通过联系页面。

If you can call into a web service then try the PDF Conversion Services. We are currently looking for beta testers for the html to pdf bit, just drop a line via the contact page.

攒眉千度 2024-09-21 11:04:23

我知道这是一个老问题,但现在使用

converter.PreserveLinks = true;

Where converter is a WebGrabber 实例就足够了。

I know it is an old question, but nowadays it should be sufficient to use

converter.PreserveLinks = true;

Where converter is a WebGrabber instance.

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