Printing iframes
Hi I'm new to Drupal community and start playing with Drupal not long ago (please bear with me).
I managed to install and configure Printer, email and PDF versions (7.x-2.0) to print nodes/views/panels without trouble. I pretty sure that I'm missing something obvious because I'm trying to print iframes and they are not printed with the correct height.

To show an iframe in the browser with the correct height I'm using an external javascript library (iframeAutoHeight). I also tried with drupal module insertframe and got the same results.

If I use printer-friendly version link button the iframes are rendered and shown correctly but if I use PDF version link button the iframes are not rendered correctly into pdf (I use wkhtmltopdf 0.12.0 library to do the render). My guess is that in PDF version link button iframeAutoHeight is not being called which leads to render an html to 0px height (this the height that is defined in the page). If I change the iframe height on the page to a value greater than 0 the iframe is printed with that height on the pdf.

I looked at print_pdf.pages.inc to understand what was happening and saw that the function that gets the page html to be rendered is $html = theme('print', array('node' => $node, 'query' => $query, $expand, 'format' => $link['format'])) and this function is used all printing methods so I must be doing something wrong.

I use a Zen subtheme and I call the iframeAutoHeight in a js file with Drupal.behaviors.zen_siag = {
attach: function(context, settings) {....} ...} which I define with scripts[] in zen_siag.info so I thought that I was doing everything correctly but since I can't print pdfs correctly certainly something is missing.

Can you point me in the right direction ? To summary everything I guess my problem is not knowing how to call iframeAutoHeight javascript function and wait it to finish before PDF is built.

Thank you,
mlamy

Comments

pebosi’s picture

Status: Active » Closed (works as designed)
Issue tags: -Novice

You need to manually assign a height befor printing. Iframe auth height will not work here.
As this is not a Drupal or Module specific problem, i would suggest to close here.