*** tcpdf.php.orig	2009-04-29 20:59:22.000000000 +0200
--- tcpdf.php	2009-04-29 21:02:41.000000000 +0200
***************
*** 12146,12152 ****
  					} else {
  						$this->lMargin += $this->listindent;
  					}
! 					$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'br': {
--- 12146,12153 ----
  					} else {
  						$this->lMargin += $this->listindent;
  					}
! 					//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], false);
! 					$this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'br': {
***************
*** 12158,12164 ****
  					break;
  				}
  				case 'p': {
! 					$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'pre': {
--- 12159,12166 ----
  					break;
  				}
  				case 'p': {
! 					//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], false);
! 					$this->addHTMLVertSpace(1, $cell, ($tag['fontsize'] * 1.0) / $this->k, $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'pre': {
***************
*** 12180,12186 ****
  				case 'h4': 
  				case 'h5': 
  				case 'h6': {
! 					$this->addHTMLVertSpace(1, $cell, ($tag['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'tcpdf': {
--- 12182,12198 ----
  				case 'h4': 
  				case 'h5': 
  				case 'h6': {
! 					//$this->addHTMLVertSpace(1, $cell, ($tag['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], false);
! 					$sz = 1.4;
! 					switch( $tag['value'] ) {
! 					case 'h6' : $sz -= 0.1;
! 					case 'h5' : $sz -= 0.1;
! 					case 'h4' : $sz -= 0.1;
! 					case 'h3' : $sz -= 0.1;
! 					case 'h2' : $sz -= 0.1;
! 					case 'h1' :
! 					}
! 					$this->addHTMLVertSpace(1, $cell, ($tag['fontsize'] * $sz) / $this->k, $firstorlast, $tag['value'], false);
  					break;
  				}
  				case 'tcpdf': {
***************
*** 12444,12450 ****
  					break;
  				}
  				case 'div': {
! 					$this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'blockquote': {
--- 12456,12463 ----
  					break;
  				}
  				case 'div': {
! 					//$this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], true);
! 					$this->addHTMLVertSpace(1, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'blockquote': {
***************
*** 12453,12467 ****
  					} else {
  						$this->lMargin -= $this->listindent;
  					}
! 					$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'p': {
! 					$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'pre': {
! 					$this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], true);
  					$this->premode = false;
  					break;
  				}
--- 12466,12483 ----
  					} else {
  						$this->lMargin -= $this->listindent;
  					}
! 					//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
! 					$this->addHTMLVertSpace(1, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'p': {
! 					//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
! 					$this->addHTMLVertSpace(1, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
  					break;
  				}
  				case 'pre': {
! 					//$this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], true);
! 					$this->addHTMLVertSpace(1, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
  					$this->premode = false;
  					break;
  				}
***************
*** 12469,12475 ****
  					--$this->listnum;
  					if ($this->listnum <= 0) {
  						$this->listnum = 0;
! 						$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
  					}
  					break;
  				}
--- 12485,12493 ----
  					--$this->listnum;
  					if ($this->listnum <= 0) {
  						$this->listnum = 0;
! 						//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
! 						//$this->addHTMLVertSpace(0, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
! 						$this->Ln('', $cell);
  					}
  					break;
  				}
***************
*** 12499,12505 ****
  					}
  					if ($this->listnum <= 0) {
  						$this->listnum = 0;
! 						$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
  					}
  					$this->lasth = $this->FontSize * $this->cell_height_ratio;
  					break;
--- 12517,12525 ----
  					}
  					if ($this->listnum <= 0) {
  						$this->listnum = 0;
! 						//$this->addHTMLVertSpace(2, $cell, '', $firstorlast, $tag['value'], true);
! 						//$this->addHTMLVertSpace(0, $cell,  $parent['fontsize'] * 1.0 / $this->k, $firstorlast, $tag['value'], true);
! 						$this->Ln('', $cell);
  					}
  					$this->lasth = $this->FontSize * $this->cell_height_ratio;
  					break;
***************
*** 12515,12530 ****
  				case 'h4': 
  				case 'h5': 
  				case 'h6': {
!                                       if( $this->NAME == NULL )
!                                           $this->NAME = $this->HnTitle($dom,$key);
!                                       if ($this->NAME ) {
!                                               // HTML ancher or title found
!                                               $this->Bookmark($this->NAME[0],$this->NAME[1]);
!                                               $this->NAME = NULL;
!                                       }
! 					$this->addHTMLVertSpace(1, $cell, ($parent['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], true);
! 					break;
! 				}
  				default : {
  					break;
  				}
--- 12535,12560 ----
  				case 'h4': 
  				case 'h5': 
  				case 'h6': {
! 					//$this->addHTMLVertSpace(1, $cell, ($parent['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], true);
! 					$sz = 1.0;
! 					switch( $tag['value'] ) {
! 					case 'h6': $sz -= 0.1;
! 					case 'h5': $sz -= 0.1;
! 					case 'h4': $sz -= 0.1;
! 					case 'h3': $sz -= 0.1;
! 					case 'h2': $sz -= 0.1;
! 					case 'h1':
! 					    if( $this->NAME == NULL )
! 						$this->NAME = $this->HnTitle($dom,$key);
! 					    if ($this->NAME ) {
! 						// HTML ancher or title found
! 						$this->Bookmark($this->NAME[0],$this->NAME[1]);
! 						$this->NAME = NULL;
! 					    }
! 					    $this->addHTMLVertSpace(1, $cell, ($parent['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], true);
! 					    break;
! 					}
! 					}
  				default : {
  					break;
  				}
