Remove book navigation from PDF
vgarcia1586 - June 27, 2007 - 09:01
| Project: | Pdfview |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Jump to:
Description
I looked online to figure out a way to remove the book navigation from the generated PDF and couldn't find anything, so I thought I'd share how I did this... might not be the best way to do it, but it works quite well for me.
in pdfview.module, function theme_pdfview_node , I added the following after the line that says $content = drupal_render($node->content);
if($node->type == 'book'){ // Remove the book-navigation links from the PDF
$begin_remove = stripos($content,'<div class="book-navigation">');
$end_remove = stripos($content,'</div></div>',$begin_remove);
$content = substr_replace($content,"",$begin_remove,$end_remove-$begin_remove+strlen('</div></div>'));
}This was just a quick workaround which worked for me... hope it's useful for someone.

#1
Thanks!!!
#2
Works well.