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&height=500&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
Comment #1
sadashiv CreditAttribution: sadashiv commentedHi,
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.