Skip to content

Commit

Permalink
Modified HTML2PDF to incorporate features of FPDI.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Oct 4, 2012
1 parent 082bf42 commit 941f8e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions library/html2pdf/README_OpenEMR.txt
Expand Up @@ -10,3 +10,12 @@ This html2pdf directory was created by:

3. Removing the examples directory from the html2pdf directory.

4. Modifying library/html2pdf/fpdi/fpdf_tpl.php so that
FPDF_TPL extends MyPDF instead of FPDF. Note that FPDI extends
FPDF_TPL.

5. Modifying library/html2pdf/html2pdf.class.php to create its member
pdf object as an instance of FPDI instead of MyPDF.

At this point the HTML2PDF class now includes the FPDI features.

2 changes: 1 addition & 1 deletion library/html2pdf/fpdi/fpdf_tpl.php
Expand Up @@ -17,7 +17,7 @@
// limitations under the License.
//

class FPDF_TPL extends FPDF {
class FPDF_TPL extends MyPDF {
/**
* Array of Tpl-Data
* @var array
Expand Down
6 changes: 5 additions & 1 deletion library/html2pdf/html2pdf.class.php
Expand Up @@ -14,6 +14,7 @@
define('__CLASS_HTML2PDF__', '3.31');

require_once(dirname(__FILE__).'/_mypdf/mypdf.class.php'); // classe mypdf
require_once(dirname(__FILE__).'/fpdi/fpdi.php'); // Added by Rod
require_once(dirname(__FILE__).'/parsingHTML.class.php'); // classe de parsing HTML
require_once(dirname(__FILE__).'/styleHTML.class.php'); // classe de gestion des styles

Expand Down Expand Up @@ -116,7 +117,7 @@ function HTML2PDF($sens = 'P', $format = 'A4', $langue='fr', $marges = array(5,
HTML2PDF::textLOAD($this->langue);

// création de l' objet PDF
$this->pdf = new MyPDF($sens, 'mm', $format);
$this->pdf = new FPDI($sens, 'mm', $format);

// initialisation des styles
$this->style = new styleHTML($this->pdf);
Expand Down Expand Up @@ -215,6 +216,7 @@ function DEBUG_stepline($nom, $val1, $val2, $val3, $val4)

/**
* renseigner l'encoding à utiliser
*
* @param string nouvel encoding
* @return string ancien encoding
Expand Down Expand Up @@ -4699,6 +4701,7 @@ function o_TD($param, $other = 'td')
$HTML2PDF_TABLEAU[$param['num']]['corr']
[$HTML2PDF_TABLEAU[$param['num']]['corr_y']+$j]
[$HTML2PDF_TABLEAU[$param['num']]['corr_x']+$i] = ($i+$j>0) ? '' : array($x,$y,$colspan,$rowspan);

}
}
$HTML2PDF_TABLEAU[$param['num']]['corr_x']+= $colspan;
Expand Down Expand Up @@ -5971,6 +5974,7 @@ function INDEX_NewPage(&$page)
else
{
$this->setNewPage();

return null;
}
}
Expand Down

0 comments on commit 941f8e3

Please sign in to comment.