PDFView misses off node image in its output...
wsherliker - October 17, 2007 - 16:55
| Project: | Pdfview |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I patched the code so that if node_images are enabled for this node then the content includes this at the top of the page when outputing to the PDF converter.
The change was a relatively minor one in the pdfview.module where lines: 190-194 became:
$content = "";
if ($node->node_images) {
$content = $node->node_images;
}
$content .= drupal_render($node->content);
instead of
$content = drupal_render($node->content);
This now supported the node images in the output.
Please can you make this amend to future releases as it seems quite useful!
Cheers
W.

#1
A further amend which now checks whether the content type has node images enabled in the body beofer adding them to the PDF.
// 19/10/2007 Warren Sherliker: Patch to show node_images (if this content type has them enabled)
$content = "";
if ($node->node_images) {
// Check whether the node body shows any node_images images or not...
$body = variable_get('node_images_body_images_' . $node->type, 100);
// A blank body entry implies show all images - to make sure this works we default it to 1.
if ($body == "") $body = 1;
// Show the images
if ($body > 0) $content .= $node->node_images;
}
$content .= drupal_render($node->content);
// 19/10/2007 Warren Sherliker: End Patch
instead of:
$content .= drupal_render($node->content);
#2
That didn't work for me, but this did:
if ($node->type == "image") {
$content .= '<img src="'.$node->images['_original'].'"/>';
}
$content .= drupal_render($node->content);