PDF Created without Body content

cjwysong - January 31, 2007 - 12:46
Project:Pdfview
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

A Blog, for example, has the link appropriately listed below the content of what the creator wrote to download the content as a PDF. When followed, the PDF comes back with ONLY:

TITLE
AUTHOR, DATE TIME STAMP

LINK TO ATTACHMENTS (clickable)

What would one need to access and change in order to include the contents portion of the node? And, what would that change be?

Your help is greatly appreciated.

Thank you for your time,
Chris

#1

drupal-id.com - March 15, 2007 - 09:32

This pdfview module convert all content in the node to pdf including the body content. What may cause your body content not appear is need more detail analyze, mean you must check if every blog shown without body. And how about page and story? Same result as the blog node?

#2

housetier - April 4, 2007 - 22:49

with a book node I can see the content in the generated pdf; same goes for a page node. but a blog node has an empty body.

#3

Carlos Miranda Levy - May 11, 2007 - 04:33

Same thing here...

http://www.americasomostodos.com/node/3
looks fine

http://www.americasomostodos.com/node/3/pdf
does not display the content

(node 3 is a blog entry)

#4

mboudey - January 22, 2008 - 14:50

I have the exact same problem (no body in PDF when created).

I have the teaser module on and a CCK field.
I use only blog content type.
Also, I run Drupal 5.5 with php 4.3.1. I downloaded the TCPDF_PHP4 file.
I made the test and it went fine, i.e. the whole pdf document downloaded properly and its content was setup right.

Any solution so far??

Thanks

Michael

#5

elesku - February 12, 2008 - 17:00

I have the same problem and I tried to make changes in module but no success. Has anybody encounter the solution to this problem? And, exists another module or direct code to convert a node page to a PDF file?

Thanks.

#6

elesku - February 21, 2008 - 10:30

Nobody know why this problem happens?

#7

elesku - February 21, 2008 - 12:38

my solution:

using node_view($node) instead of $body->content in function theme_pdfview_node

function theme_pdfview_node(&$pdf, $node) {
  $pdf->AddPage();
 
  $pdf = theme('pdfview_title', $pdf, $node->title);
  
   $author = strip_tags(theme('username', $node));
  // Only print author and date info when set on theme admin page
  if (theme_get_setting('toggle_node_info_' . $node->type)) {
   $pdf = theme('pdfview_author', $pdf, $author); 

   $pdf = theme('pdfview_published', $pdf, $node->created);
 
  }

   if (node_hook($node, 'view')) {
     node_invoke($node, 'view');
   }
  else {
    $node = node_prepare($node);
  }
  node_invoke_nodeapi($node, 'view');
  $content = drupal_render(node_view($node));

  $content = pdfview_check_images($content);
  $pdf->SetFont(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN);
  $pdf = theme('pdfview_html', $pdf, pdfview_check_images(node_view($node))); // My solution
 
  return $pdf;
}

 
 

Drupal is a registered trademark of Dries Buytaert.