Download & Extend

Remove book navigation from PDF

Project:Pdfview
Version:5.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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.

Comments

#1

Thanks!!!

#2

Status:active» reviewed & tested by the community

Works well.