I am trying to load a PDF from a link using colorbox but although the colorbox window opens the pdf is just text characters. This is what the link looks like:

This is what my link looks like:

<a href="' . $url . '?width=500&height=500&iframe=false" class="colorbox colorbox-load">View</a>

and when it's rendered out it looks like this:

<a href="http://mysite.com/sites/default/files/menus/menu.pdf?width=500&amp;height=500&amp;iframe=true" class="colorbox colorbox-load init-colorbox-processed cboxElement">View</a>

which looks right to me but the pdf is just text characters. the pdf loads fine just as a link opened in your browser.

Comments

sadashiv’s picture

Status: Active » Fixed

Hi,

I tried the same and it worked. My url is echo '<a href="' . $url . '?width=800&height=800&iframe=true" class="colorbox-load">Click here</a>';

You may use l() function to generate the html. I am using just as a example

Pdf gets loaded without issues.

Thanks,
Sadashiv.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.