使用 ASP.NET 生成打印质量 PDF
我最近在网站上创建了一个功能,该功能将生成包含图像和文本的 PDF 文档。然后这些将被打印出来并粘贴到咖啡杯上。
我使用 Winnovative HTML 到 PDF 转换来完成此操作。
一切正常,但图像质量太低,无法打印,而且在杯子上看起来很垃圾。
有人告诉我这样做的原因是,当图像需要 300dpi(打印质量)时,图像只能达到 70dpi(屏幕质量)。
有没有办法生成这些 PDF 以使图像具有打印质量?
I've recently created a feature on a website which will generate a PDF document containing images and text. These will then be printed out and stuck onto coffee mugs.
I've done this using Winnovative HTML to PDF conversion.
Everything works fine, however the image quality is far too low for print, and looks rubbish on the mugs.
I've been told the reason for this is because the image will only be 70dpi (screen quality), when it needs to be 300dpi (print quality).
Is there a way I can generate these PDFs so that the images are print quality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 iTextSharp 的使用真的很幸运,我用它构建了许多高质量的 pdf 文件。但我从头开始构建 pdf,然后直接打印。您可以在代码中重新创建页面内容并打印吗?做起来非常简单,并且有很多资源/示例可供构建。
如果没有,有几种产品,例如 pdfcrowd。我不能说我自己用过它。但我听说有人用它来获得高质量的 html 到 pdf,但你必须为此特权付费。
I have really good luck with iTextSharp, I build many good quality pdfs with it. But I build the pdfs from scratch, and print directly. Would it be possible for you to recreate the page content in the code and print? It's pretty simple to do, and there is a lot of resources/examples out there to build from.
If not, there's several products out there like pdfcrowd. I can't say I've used it myself. But I've heard of people using it for high quality html to pdf, but you have to pay for the privilege.
当 PDF 中有光栅图像时,其质量会变得越来越低,并且您会放大 PDF 文档。为了更好地进行比较,您应该在 PDF 查看器中设置 100% 的缩放级别。如果您想要在 PDF 中使用更高分辨率的图片而不是 HTML 中的图片,您可以执行此操作,如 在 PDF 演示中用更高质量的图像替换 HTML 中的图像 。该演示中的相关 C# 代码是:
When you have a raster image in PDF its quality becomes lower and lower and you zoom in PDF document. For a good comparison you should have 100% zoom level in PDF viewer. If you have a higher resolution picture you want to use in PDF instead of the picture from HTML the you can do this as you can see in the Replace Images from HTML with Higher Quality Images in PDF Demo . The relevant C# code from that demo is: