custom generate pdf with the header displaying only in the first page I'm using print module to generate pdf files from the drupal content. Here I use tcpdf library. The pdf files are working fine. But I want to customize the pdf files, here I want to display header in only the first page of the pdf file and the rest of the pages should display no header, but the footer should be common. 

How can I customize the pdf generation? Is there a way that I need to change some thing in template files or library files. I tried to look into the tcpdf's lib-handler files - print_pdf_tcpdf.pages.inc. But I could find nothing related to restricting header. 

Help is appreciated.
This might only be possible if you are printing multiple individual nodes to one PDF by overriding the provided print themes.

A solution that will work no matter what is to add your own class that extends the PrintTCPDF class. You should ideally do this in your own module, but I will show you here how to hack the print_pdf_tcpdf module.

Add a new file to the folder print_pdf->lib_handlers->print_pdf_tcpdf and name it

print_pdf_tcpdf_no_headers.class.inc


Add the following contents to that file:

&lt;?php

class PrintTCPDF_No_Headers extends PrintTCPDF {
  public function Header() {
    if ($this-&gt;page &gt; 1){
      return;
    }
    parent::Header();
  }
}


Open the print_pdf_tcpdf.pages.inc file and change line 65 - 66 from this:

// create new PDF document
  $pdf = new PrintTCPDF($orientation , 'mm', $paper_size, TRUE);


to this:

// create new PDF document
  $pdf = new PrintTCPDF_No_Headers($orientation , 'mm', $paper_size, TRUE);


Open file print_pdf_tcpdf.info and add the following:

files[] = print_pdf_tcpdf_no_headers.class.inc


Clear your cache and your pdf's will print with a header on page 1 only. 

If you want to also print other nodes with headers on all pages you will have to implement some conditional logic in print_pdf_tcpdf.pages.inc file which creates the class needed ( PrintTCPDF or PrintTCPDF_No_Headers)