简体   繁体   English

Microsoft Word-> PDF图像质量

[英]Microsoft Word -> PDF image quality

Our line of business application uses a Word document as a template, fills in the pertinent information and converts it to PDF, which it returns to the user. 我们的业务应用程序使用Word文档作为模板,填写相关信息并将其转换为PDF,然后将其返回给用户。

That all works fine except for one thing. 除了一件事,一切都很好。 We use an image of our company's logo on the lead page and in the footer. 我们在首页和页脚中使用公司徽标的图像。 In one resolution (eg 100%), it looks fine. 在一种分辨率下(例如100%),它看起来不错。 But at higher resolutions (eg 250%), it has several noticeable jaggies; 但是在较高的分辨率下(例如250%),它有几个明显的锯齿。 the diagonals have noticeable ragged edges. 对角线有明显的参差不齐的边缘。 Tweaking the image, we're able to make it look good at the higher zoom value, but then it looks terrible at lower zoom values. 调整图像,我们可以使其在较高的缩放值时看起来不错,但是在较低的缩放值时看起来很糟糕。

Currently, we're using a PNG, but we've tried JPG and it doesn't improve the jaggy problem. 目前,我们正在使用PNG,但是我们尝试了JPG,但它并不能改善锯齿问题。 In fact, it looks worse at higher resolution because of JPG compression. 实际上,由于JPG压缩,因此在高分辨率下看起来更糟。 I think a vector image would solve the problem (and we have the logo in vector format), but I haven't found any vector formats that Word supports. 我认为矢量图像可以解决问题(并且我们拥有矢量格式的徽标),但是我还没有找到Word支持的任何矢量格式。

I don't really have any code to show, since we don't do anything with the image in the code: we just take the document and plug in our values, none of which touch the logo (the template already contains the image). 我实际上没有任何代码可显示,因为我们对代码中的图像不做任何事情:我们只需要获取文档并插入我们的值,而这些值都不会碰到徽标(模板已经包含图像) 。

We are using Word 2013 (32-bit) on Windows 8.1 (though some of our developers use Windows 7). 我们正在Windows 8.1上使用Word 2013(32位)(尽管我们的某些开发人员使用Windows 7)。 We use the .NET PdfDocument class to generate the PDF. 我们使用.NET PdfDocument类来生成PDF。

Any ideas on how to get Word to be better at retaining image quality? 关于如何使Word更好地保留图像质量的任何想法? Or is this a PDF issue? 还是这是PDF问题?

The suggestion by David van Driessche might still work, provided the right EMF is used. 只要使用正确的EMF,David van Driessche的建议可能仍然有效。 EMF files can contain both raster and vector data. EMF文件可以同时包含栅格数据和矢量数据。 With a raster EMF file, the same problem will present itself as it did with PNG or JPEG. 使用栅格EMF文件时,将出现与PNG或JPEG相同的问题。 Vector EMF embedded in Word files can scale very nicely, at least when zoomed in display, so it could also work with printing or converting to PDF. 嵌入到Word文件中的矢量EMF可以很好地缩放,至少在放大显示时是如此,因此它也可以用于打印或转换为PDF。
Word supports both raster and vector objects within EMFs, so the secret is to use EMFs that only contain scalable objects like lines, curves and text when quality & scaling are both concerns. Word在EMF中同时支持栅格和矢量对象,因此秘诀在于,当同时考虑质量和缩放比例时,应使用仅包含可缩放对象(如直线,曲线和文本)的EMF。

I have posted sample files here to illustrate this for anyone wishing to see the difference. 我在此处发布了示例文件以向希望看到差异的任何人说明这一点。

Amin Dodin 阿敏·多丁(Amin Dodin)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM