Skip to content

Commit

Permalink
Should fix latest Reader issues
Browse files Browse the repository at this point in the history
Breaks nice part and item titles in header. :(
  • Loading branch information
patrickmj committed Aug 16, 2011
1 parent 512f4bb commit da900b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions templates/pdf/class-anthologize-tcpdf.php
Expand Up @@ -202,6 +202,7 @@ public function Header() {
$this->header_xobjid = $this->startTemplate($this->w, $this->tMargin);
$headerfont = $this->getHeaderFont();
$headerdata = $this->getHeaderData();

$this->y = $this->header_margin;
if ($this->rtl) {
$this->x = $this->w - $this->original_rMargin;
Expand Down Expand Up @@ -240,6 +241,7 @@ public function Header() {
$this->SetFont($headerfont[0], 'B', $headerfont[2] + 1);
$this->SetX($header_x);
$this->Cell($cw, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0);

// header string
$this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]);
$this->SetX($header_x);
Expand Down
18 changes: 6 additions & 12 deletions templates/pdf/class-pdf-anthologizer.php
Expand Up @@ -197,9 +197,7 @@ public function appendPart($section, $partNo) {

$this->set_header(array('title'=>$title, 'string'=>$string));

if($partNo == 0) {
$this->output->AddPage();
} elseif($this->api->getProjectOutputParams('break-parts') == 'on' ) {
if( ($partNo == 0) || ($this->api->getProjectOutputParams('break-parts') == 'on' ) ) {
$this->output->AddPage();
}

Expand All @@ -210,19 +208,15 @@ public function appendPart($section, $partNo) {
}

//add the header info
//$this->appendPartHead($section, $partNo);
$this->appendPartHead($section, $partNo);

//loop the items and append
$itemsCount = $this->api->getSectionPartItemCount($section, $partNo);
for($itemNo = 0; $itemNo < $itemsCount; $itemNo++) {
$this->appendItem($section, $partNo, $itemNo);
}

$this->output->endPage();

}


public function appendPartHead($section, $partNo) {
//append the header stuff, avoiding HTML methods for optimization

Expand All @@ -238,12 +232,13 @@ public function appendItem($section, $partNo, $itemNo) {

$titleNode = $this->api->getSectionPartItemTitle($section, $partNo, $itemNo, true);
$title = isset( $titleNode->textContent ) ? $titleNode->textContent : '';
$this->set_header(array('string'=>$title));


if( ($this->api->getProjectOutputParams('break-items') == 'on') && $itemNo != 0 ) {
$this->output->AddPage();
}

$this->set_header(array('string'=>$title));

if($section == 'body') {
$this->output->Bookmark($title, 1);
}
Expand Down Expand Up @@ -302,8 +297,6 @@ private function _boldSetting() {
return 'B';
break;
}


}

public function output() {
Expand All @@ -321,6 +314,7 @@ protected function set_header($array) {
}
//. . . and set it back in the TCPDF
$this->output->setHeaderData($newArray['logo'], $newArray['logo_width'], $newArray['title'], $newArray['string']);

}


Expand Down

0 comments on commit da900b5

Please sign in to comment.