Google Docs inline pdf documents displayed as black and white

I embed pdf files (hosted on S3) in modules using google docs iframe in my rails application. Here is the code:

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

The problem is that sometimes (apparently random) pdf files are displayed in black and white, even if the original download was in color. The only hint I have is that pdf files that appear as black and white usually have a very small color in them (for example, the one below). Any idea what is going on?

Aws

link AWS pdf

screenshot of pdf

Google Docs

Google Docs link (you can get this by connecting the AWS link to Google Docs Viewer )

google docs screenshot

+8
ruby-on-rails pdf amazon-s3 amazon-web-services
source share
1 answer

I believe this is a compressed type of RGB image in PDF. I tried converting RGB to CMYK, which sorts the work (I only have an old utility for this). I also tried to edit the original to add another image: http://tonywilk.no-ip.org/testpdf/index.html the pdf file is located at: http://tonywilk.no-ip.org/testpdf/test_out. pdf

This shows the color for the added image with the original monochrome - therefore, the Google viewer cannot handle the original compression type.

In addition to re-encoding pdf files, I am afraid that this will not help you - sorry!

+1
source share

All Articles