0

I can load a pdf in cloudinary but i can't display it. I tried with :

<%= cl_image_tag worker.cv.path, width: 1000, height: 1000,crop: :fill, format: :jpg %>

Renders in

<img width="1000" height="1000" src="http://res.cloudinary.com/dgl9juzps/image/upload/c_fill,h_1000,w_1000/v1498033370/owpbctm8yi8pbwsxt3wz.pdf.jpg%22"  alt="Owpbctm8yi8pbwsxt3wz.pdf"> 

but it doesn't work.

Thanks for help

Roland Studer
  • 4,315
  • 3
  • 27
  • 43
Tana
  • 31
  • 6

1 Answers1

0

The rendered link has two problems:

<img width="1000" height="1000" src="http://res.cloudinary.com/dgl9juzps/image/upload/c_fill,h_1000,w_1000/v1498033370/owpbctm8yi8pbwsxt3wz.pdf.jpg%22"  alt="Owpbctm8yi8pbwsxt3wz.pdf"> 

// src = "http://res.cloudinary.com/.../owpbctm8yi8pbwsxt3wz.pdf.jpg%22"
  1. The trailing " from the %22
  2. and the file extension is .pdf.jpg instead of just .jpg

The link works if you just call:

http://res.cloudinary.com/dgl9juzps/image/upload/c_fill,h_1000,w_1000/v1498033370/owpbctm8yi8pbwsxt3wz.jpg

So maybe you should only pass the filename without extension to the helper.

Roland Studer
  • 4,315
  • 3
  • 27
  • 43
  • Thanks Roland, the problem is that i should call users downloaded pdf...How could i pass this differents filenames without helpers? – Tana Jun 22 '17 at 07:17