0

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="http://example.com/sites/default/files/menus/menu.pdf?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://example.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.

1
  • Where are you making the link at? Jun 19, 2015 at 18:45

1 Answer 1

1

I suggest you, use this module https://www.drupal.org/project/pdf_to_imagefield since colorbox is designed to display images.

If you still want to show the complete pdf. You could embed it in a basic page:

Download file

You can then reference the page by node id.

Link name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.