Index: lib/ezpdf/classes/class.ezpdf.php =================================================================== --- lib/ezpdf/classes/class.ezpdf.php (revision 17821) +++ lib/ezpdf/classes/class.ezpdf.php (working copy) @@ -1080,8 +1080,8 @@ $this->ez['links']=array(); } $i = $info['nCallback']; - - $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height'],'url'=>rawurldecode($info['p'])); + $params = explode( ":", $info['p'] ); + $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height'],'url'=>rawurldecode($params[0])); if ($internal==0){ $this->saveState(); $this->setColorRGB(0,0,1); @@ -1089,6 +1089,19 @@ $thick = $info['height']*$lineFactor; $this->setLineStyle($thick); } + else + { + $this->saveState(); + $color = explode( ",", $params[1] ); + if( is_array($color) && count($color) > 1 ) + { + $this->setColorRGB( $color[0], $color[1], $color[2] ); + $this->setStrokeColorRGB( $color[0], $color[1], $color[2] ); + } + $thick = $info['height']*$lineFactor; + $this->setLineStyle($thick); + + } break; case 'end': case 'eol': @@ -1099,6 +1112,7 @@ // add underlining if ($internal){ $this->addInternalLink($start['url'],$start['x'],$start['y']+$start['decender'],$info['x'],$start['y']+$start['decender']+$start['height']); + $this->restoreState(); } else { $a = deg2rad((float)$start['angle']-90.0); $drop = $start['height']*$lineFactor*1.5; Index: lib/ezpdf/classes/class.ezpdftable.php =================================================================== --- lib/ezpdf/classes/class.ezpdftable.php (revision 17821) +++ lib/ezpdf/classes/class.ezpdftable.php (working copy) @@ -1146,8 +1146,9 @@ $label = $params['label']; $level = $params['level']; + $text = $params['text']; - return ''; + return ''; } /** @@ -1366,13 +1367,14 @@ $label = $params[0]; $level = $params[1]; + $text = $params[2]; $tocCount = count( $this->TOC ); - $this->TOC[] = array( 'label' => $this->fixWhitespace( rawurldecode( $label ) ), + $this->TOC[$label] = array( 'label' => $this->fixWhitespace( rawurldecode( $text ) ), 'localPageNumber' => $this->ezWhatPageNumber( $this->ezGetCurrentPageNumber() ), 'level' => $level, 'pageNumber' => $this->ezGetCurrentPageNumber() ); - $this->addDestination( 'toc'. $tocCount, + $this->addDestination( 'toc'. $label, 'FitH', $this->yOffset() + $this->getFontHeight( $this->fontSize() ) ); } @@ -1456,7 +1458,8 @@ $this->ezNewPage(); Cezpdf::ezText( $contentText ."\n", 26, array('justification'=>'centre')); - foreach($this->TOC as $k=>$v){ + foreach($this->TOC as $k=>$v) + { if ( $v['level'] <= $level ) { if ( $dots ) @@ -1481,6 +1484,8 @@ } } + + $this->setFontSize( $fontSize ); $this->ezInsertMode(0); } Index: lib/ezpdf/classes/ezpdf.php =================================================================== --- lib/ezpdf/classes/ezpdf.php (revision 17821) +++ lib/ezpdf/classes/ezpdf.php (working copy) @@ -191,11 +191,12 @@ $operatorValue .= ':fontName:'. $header['font']; } - $operatorValue .= ':label:'. rawurlencode( $header['text'] ); + $label = isset( $header['label'] ) ? $header['label'] : rawurlencode( $header['text'] ); + $operatorValue .= ':label:'. $label . ':text:' . rawurlencode( $header['text'] ); $operatorValue .= '>'. $header['text'] .''; - eZDebug::writeNotice( 'PDF: Added header: '. $header['text'] .', size: '. $header['size'] . + eZDebug::writeNotice( 'PDF: Added header: '. $header['text'] .', label: '. $label . ', align: '. $header['align'] .', level: '. $header['level'], 'eZPDF::modify' ); } break; @@ -278,6 +279,31 @@ eZDebug::writeNotice( 'PDF: Added link: '. $link['text'] .', url: '.$link['url'], 'eZPDF::modify' ); } break; + case 'ilink': // internal link + { + $link = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace ); + if( isset( $link['rgb'] ) ) + { + eZMath::normalizeColorArray( $link['rgb'] ); + $color = eZMath::rgbToCMYK2( $link['rgb'][0]/255, + $link['rgb'][1]/255, + $link['rgb'][2]/255 ); + } + else + { + $color = array(); + } + + + $link['text'] = str_replace( '"', + '"', + $link['text'] ); + + $operatorValue = ''. $link['text'] .''; + eZDebug::writeNotice( 'PDF: Added link: '. $link['text'] .', url: '.$link['url'], 'eZPDF::modify' ); + } break; + + case 'stream': { $this->PDF->ezStream(); @@ -323,7 +349,6 @@ { $this->createPDF( $config->variable( 'PDFGeneral', 'Format' ), $config->variable( 'PDFGeneral', 'Orientation' ) ); } - $text = str_replace( array( ' ', "\n", "\t" ), '', $text ); $this->PDF->ezText( $text ); Index: design/standard/templates/content/datatype/pdf/ezxmltags/link.tpl =================================================================== --- design/standard/templates/content/datatype/pdf/ezxmltags/link.tpl (revision 17821) +++ design/standard/templates/content/datatype/pdf/ezxmltags/link.tpl (working copy) @@ -1,2 +1,6 @@ -{* DO NOT EDIT THIS FILE! Use an override template instead. *}{pdf(link, hash(url, $href|ezurl, - text, $content|wash(pdf)))} \ No newline at end of file +{* DO NOT EDIT THIS FILE! Use an override template instead. *} +{if $object_id} +{pdf(ilink, hash(url, $object_id, text, $content|wash(pdf), rgb, array( 153, 51, 51 ) ))} +{else} +{pdf(link, hash(url, $href|ezurl, text, $content|wash(pdf)))} +{/if} \ No newline at end of file