Google文档内联pdf显示为黑白色

时间:2014-02-12 19:08:57

标签: ruby-on-rails pdf amazon-web-services amazon-s3

我使用rails应用中的google docs iframe在modals中嵌入pdf(托管在S3)。这是代码:

$modalBody.append(
  "<iframe src='https://docs.google.com/viewer?url=<%= @url %>&embedded=true' width='100%' height='800'></iframe>"
);

问题是,有时(看似随机)pdf显示为黑白,即使原始上传是彩色的。我唯一的提示是,呈现为黑色和白色的pdf通常只有很少的颜色(如下图所示)。知道发生了什么事吗?

AWS

AWS pdf link

screenshot of pdf

Google文档

Google Docs link(您可以通过将AWS链接插入Google Docs viewer)来获取此信息

google docs screenshot

1 个答案:

答案 0 :(得分:1)

我相信它是PDF中RGB图像的压缩类型。我尝试将RGB转换为CMYK,这种工作类似(我只有一个非常古老的实用工具)。我还尝试编辑原文以添加其他图片:http://tonywilk.no-ip.org/testpdf/index.html pdf文件位于:http://tonywilk.no-ip.org/testpdf/test_out.pdf

这显示添加的图像的颜色,原始图像仍为单色 - 因此Google查看器无法处理原始的压缩类型。

除了重新编码pdf之外,我担心它对你没什么帮助 - 对不起!