I am embedding pdfs(hosted at S3) in modals using the google docs iframe in my rails app. Here's the code:
$modalBody.append(
"<iframe src='https://docs.google.com/viewer?url=<%= @url %>&embedded=true' width='100%' height='800'></iframe>"
);
The issue is that sometimes(seemingly random) the pdfs show up in black and white even though the original upload was in color. The only hint I have is that the pdfs that render as black and white generally have very little color in them(like the one below). Any idea what's going on?
AWS
AWS pdf link
Google Docs
Google Docs link (You can get this by plugging the AWS link into Google Docs viewer)
I believe it is the compression type of the RGB image in the PDF. I tried converting the RGB to CMYK which sort-of-works (I only have a really old utility for doing this). I also tried editing the original to add another image: http://tonywilk.no-ip.org/testpdf/index.html the pdf file is at: http://tonywilk.no-ip.org/testpdf/test_out.pdf
This shows the colour for the added image with the original still monochrome - so Google viewer cannot handle the original's compression type.
Other than re-encoding the pdf's, I'm afraid it does not help you much - sorry !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With