Active
Project:
Pdfview
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jan 2007 at 09:01 UTC
Updated:
11 Oct 2007 at 04:39 UTC
When I try to view the pdf version of a custom node, the only two things that the pdf show are the title of the node and the submission information. The rest of the page (that's supposed to contain custom fields) is blank.
Advise?
| Comment | File | Size | Author |
|---|---|---|---|
| Numbers_Activities_(1-100).pdf | 550.39 KB | dnystwn |
Comments
Comment #1
redmonp commentedSeconded. The module exports standard page nodes to pdf just fine, but does not export any CCK fields, just the cck title, user and timestamp.
Comment #2
Egon Bianchet commentedI committed some really basic CCK support to DRUPAL-5 ... It relies to the TCPDF html conversion, so the results are just bad.
The best way to get pdf output for complex nodes is still to override the themeable functions and fine-tune the output.
Comment #3
danielb commentedI found a way to do it.
go to your theme's template.php and create this function:
function phptemplate_pdfview_node(&$pdf, $node) {}
copy the content of theme_pdfview_node() from the pdfview.module file into there.
Now make a new array $node_content and give it the value of $node->content, and then from then on use $node_content instead of the default $node->content (you'll have to go through and replace these in the rest of the function)
Comment out the following lines if you want to get rid of author/published
$author = strip_tags(theme('username', $node));
$pdf = theme('pdfview_author', $pdf, $author);
$pdf = theme('pdfview_published', $pdf, $node->created);
Now concern yourself with this: $content_array['body']['#value']
You can modify the body#value field as much as you like like this;
$content_array['body']['#value'] = "some new text".$some_variable.$content_array['body']['#value'];
or
$content_array['body']['#value'] .= $some_stuff;
It understands some HTML markup, and will interpret "backslash n" for newline (\n) as well, afaik.
feel free to also do some print_r($content_array) and see what info is available to you. You may want to set some of your sub-arrays to the empty-string like "" to hide certain CCK fields.
Comment #4
danielb commentedbtw half way through that post i started calling $node_content : "$content_array"... woops :/