Ajout de la protection des pdf en natif, seule l'impression est autorisée, de plus maintenant fpdf inclu fpdi et fpdi_protection

This commit is contained in:
Regis Houssin 2007-04-05 17:05:24 +00:00
parent 35eefd83ab
commit 41fb66b438
33 changed files with 280 additions and 262 deletions

View File

@ -67,7 +67,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**

View File

@ -28,7 +28,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_indexes.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_indexes.php");
require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_html.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_html.php");

View File

@ -21,7 +21,7 @@
* *
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
class ComptaJournalPdf extends FPDF { class ComptaJournalPdf extends FPDF {

View File

@ -27,7 +27,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**
@ -220,7 +220,8 @@ class BordereauChequeBlochet
$year = sprintf("%04d",$year); $year = sprintf("%04d",$year);
$_file = $dir . "bordereau-".$number.".pdf"; $_file = $dir . "bordereau-".$number.".pdf";
$pdf = new FPDF('P','mm','A4'); $pdf = new FPDI_Protection('P','mm','A4');
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();

View File

@ -21,7 +21,7 @@
* *
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
Class methode_expedition Class methode_expedition
{ {
@ -80,7 +80,8 @@ Class methode_expedition
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDI_Protection('P','mm','A4');
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -143,7 +143,8 @@ Class pdf_expedition_merou extends ModelePdfExpedition
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation Bon vierge // Initialisation Bon vierge
$pdf = new FPDF('l','mm',$this->format); $pdf = new FPDI_Protection('l','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();
//Generation de l entete du fichier //Generation de l entete du fichier

View File

@ -32,7 +32,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**

View File

@ -175,7 +175,8 @@ class pdf_muscadet extends ModelePDFCommandesSuppliers
$nblignes = sizeof($com->lignes); $nblignes = sizeof($com->lignes);
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -20,7 +20,7 @@
* *
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
class DolibarrPdfBarCode extends FPDF { class DolibarrPdfBarCode extends FPDF {

View File

@ -1,157 +1,157 @@
<?php <?php
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
class PDF_Code39 extends FPDF { class PDF_Code39 extends FPDF {
function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) { function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) {
//Display code //Display code
$this->SetFont('Arial', '', 10); $this->SetFont('Arial', '', 10);
$this->Text($x, $y+$h+4, $code); $this->Text($x, $y+$h+4, $code);
if($ext) if($ext)
{ {
//Extended encoding //Extended encoding
$code = $this->encode_code39_ext($code); $code = $this->encode_code39_ext($code);
} }
else else
{ {
//Convert to upper case //Convert to upper case
$code = strtoupper($code); $code = strtoupper($code);
//Check validity //Check validity
if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code)) if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code))
$this->Error('Invalid barcode value: '.$code); $this->Error('Invalid barcode value: '.$code);
} }
//Compute checksum //Compute checksum
if ($cks) if ($cks)
$code .= $this->checksum_code39($code); $code .= $this->checksum_code39($code);
//Add start and stop characters //Add start and stop characters
$code = '*'.$code.'*'; $code = '*'.$code.'*';
//Conversion tables //Conversion tables
$narrow_encoding = array ( $narrow_encoding = array (
'0' => '101001101101', '1' => '110100101011', '2' => '101100101011', '0' => '101001101101', '1' => '110100101011', '2' => '101100101011',
'3' => '110110010101', '4' => '101001101011', '5' => '110100110101', '3' => '110110010101', '4' => '101001101011', '5' => '110100110101',
'6' => '101100110101', '7' => '101001011011', '8' => '110100101101', '6' => '101100110101', '7' => '101001011011', '8' => '110100101101',
'9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011', '9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011',
'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101', 'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101',
'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101', 'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101',
'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011', 'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011',
'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011', 'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011',
'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011', 'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011',
'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001', 'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001',
'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101', 'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101',
'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101', 'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101',
'-' => '100101011011', '.' => '110010101101', ' ' => '100110101101', '-' => '100101011011', '.' => '110010101101', ' ' => '100110101101',
'*' => '100101101101', '$' => '100100100101', '/' => '100100101001', '*' => '100101101101', '$' => '100100100101', '/' => '100100101001',
'+' => '100101001001', '%' => '101001001001' ); '+' => '100101001001', '%' => '101001001001' );
$wide_encoding = array ( $wide_encoding = array (
'0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111', '0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111',
'3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101', '3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101',
'6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101', '6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101',
'9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111', '9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111',
'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101', 'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101',
'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101', 'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101',
'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111', 'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111',
'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111', 'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111',
'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111', 'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111',
'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001', 'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001',
'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101', 'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101',
'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101', 'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101',
'-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101', '-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101',
'*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001', '*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001',
'+' => '100010100010001', '%' => '101000100010001'); '+' => '100010100010001', '%' => '101000100010001');
$encoding = $wide ? $wide_encoding : $narrow_encoding; $encoding = $wide ? $wide_encoding : $narrow_encoding;
//Inter-character spacing //Inter-character spacing
$gap = ($w > 0.29) ? '00' : '0'; $gap = ($w > 0.29) ? '00' : '0';
//Convert to bars //Convert to bars
$encode = ''; $encode = '';
for ($i = 0; $i< strlen($code); $i++) for ($i = 0; $i< strlen($code); $i++)
$encode .= $encoding[$code{$i}].$gap; $encode .= $encoding[$code{$i}].$gap;
//Draw bars //Draw bars
$this->draw_code39($encode, $x, $y, $w, $h); $this->draw_code39($encode, $x, $y, $w, $h);
} }
function checksum_code39($code) { function checksum_code39($code) {
//Compute the modulo 43 checksum //Compute the modulo 43 checksum
$chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
$sum = 0; $sum = 0;
for ($i=0 ; $i<strlen($code); $i++) { for ($i=0 ; $i<strlen($code); $i++) {
$a = array_keys($chars, $code{$i}); $a = array_keys($chars, $code{$i});
$sum += $a[0]; $sum += $a[0];
} }
$r = $sum % 43; $r = $sum % 43;
return $chars[$r]; return $chars[$r];
} }
function encode_code39_ext($code) { function encode_code39_ext($code) {
//Encode characters in extended mode //Encode characters in extended mode
$encode = array( $encode = array(
chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',
chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',
chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K', chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K',
chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',
chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',
chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',
chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',
chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',
chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',
chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',
chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',
chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',
chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',
chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',
chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',
chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',
chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C',
chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G',
chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K',
chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O',
chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S',
chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W',
chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P',
chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');
$code_ext = ''; $code_ext = '';
for ($i = 0 ; $i<strlen($code); $i++) { for ($i = 0 ; $i<strlen($code); $i++) {
if (ord($code{$i}) > 127) if (ord($code{$i}) > 127)
$this->Error('Invalid character: '.$code{$i}); $this->Error('Invalid character: '.$code{$i});
$code_ext .= $encode[$code{$i}]; $code_ext .= $encode[$code{$i}];
} }
return $code_ext; return $code_ext;
} }
function draw_code39($code, $x, $y, $w, $h){ function draw_code39($code, $x, $y, $w, $h){
//Draw bars //Draw bars
for($i=0; $i<strlen($code); $i++) for($i=0; $i<strlen($code); $i++)
{ {
if($code{$i} == '1') if($code{$i} == '1')
$this->Rect($x+$i*$w, $y, $w, $h, 'F'); $this->Rect($x+$i*$w, $y, $w, $h, 'F');
} }
} }
} }
?> ?>

View File

@ -1,71 +1,71 @@
<?php <?php
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
// based on the Code 39 script from The-eh // based on the Code 39 script from The-eh
class PDF_i25 extends FPDF class PDF_i25 extends FPDF
{ {
function i25($xpos, $ypos, $code, $basewidth=1, $height=10){ function i25($xpos, $ypos, $code, $basewidth=1, $height=10){
$wide = $basewidth; $wide = $basewidth;
$narrow = $basewidth / 3 ; $narrow = $basewidth / 3 ;
// wide/narrow codes for the digits // wide/narrow codes for the digits
$barChar['0'] = 'nnwwn'; $barChar['0'] = 'nnwwn';
$barChar['1'] = 'wnnnw'; $barChar['1'] = 'wnnnw';
$barChar['2'] = 'nwnnw'; $barChar['2'] = 'nwnnw';
$barChar['3'] = 'wwnnn'; $barChar['3'] = 'wwnnn';
$barChar['4'] = 'nnwnw'; $barChar['4'] = 'nnwnw';
$barChar['5'] = 'wnwnn'; $barChar['5'] = 'wnwnn';
$barChar['6'] = 'nwwnn'; $barChar['6'] = 'nwwnn';
$barChar['7'] = 'nnnww'; $barChar['7'] = 'nnnww';
$barChar['8'] = 'wnnwn'; $barChar['8'] = 'wnnwn';
$barChar['9'] = 'nwnwn'; $barChar['9'] = 'nwnwn';
$barChar['A'] = 'nn'; $barChar['A'] = 'nn';
$barChar['Z'] = 'wn'; $barChar['Z'] = 'wn';
// add leading zero if code-length is odd // add leading zero if code-length is odd
if(strlen($code) % 2 != 0){ if(strlen($code) % 2 != 0){
$code = '0' . $code; $code = '0' . $code;
} }
$this->SetFont('Arial','',10); $this->SetFont('Arial','',10);
$this->Text($xpos, $ypos + $height + 4, $code); $this->Text($xpos, $ypos + $height + 4, $code);
$this->SetFillColor(0); $this->SetFillColor(0);
// add start and stop codes // add start and stop codes
$code = 'AA'.strtolower($code).'ZA'; $code = 'AA'.strtolower($code).'ZA';
for($i=0; $i<strlen($code); $i=$i+2){ for($i=0; $i<strlen($code); $i=$i+2){
// choose next pair of digits // choose next pair of digits
$charBar = $code{$i}; $charBar = $code{$i};
$charSpace = $code{$i+1}; $charSpace = $code{$i+1};
// check whether it is a valid digit // check whether it is a valid digit
if(!isset($barChar[$charBar])){ if(!isset($barChar[$charBar])){
$this->Error('Invalid character in barcode: '.$charBar); $this->Error('Invalid character in barcode: '.$charBar);
} }
if(!isset($barChar[$charSpace])){ if(!isset($barChar[$charSpace])){
$this->Error('Invalid character in barcode: '.$charSpace); $this->Error('Invalid character in barcode: '.$charSpace);
} }
// create a wide/narrow-sequence (first digit=bars, second digit=spaces) // create a wide/narrow-sequence (first digit=bars, second digit=spaces)
$seq = ''; $seq = '';
for($s=0; $s<strlen($barChar[$charBar]); $s++){ for($s=0; $s<strlen($barChar[$charBar]); $s++){
$seq .= $barChar[$charBar]{$s} . $barChar[$charSpace]{$s}; $seq .= $barChar[$charBar]{$s} . $barChar[$charSpace]{$s};
} }
for($bar=0; $bar<strlen($seq); $bar++){ for($bar=0; $bar<strlen($seq); $bar++){
// set lineWidth depending on value // set lineWidth depending on value
if($seq{$bar} == 'n'){ if($seq{$bar} == 'n'){
$lineWidth = $narrow; $lineWidth = $narrow;
}else{ }else{
$lineWidth = $wide; $lineWidth = $wide;
} }
// draw every second value, because the second digit of the pair is represented by the spaces // draw every second value, because the second digit of the pair is represented by the spaces
if($bar % 2 == 0){ if($bar % 2 == 0){
$this->Rect($xpos, $ypos, $lineWidth, $height, 'F'); $this->Rect($xpos, $ypos, $lineWidth, $height, 'F');
} }
$xpos += $lineWidth; $xpos += $lineWidth;
} }
} }
} }
} }
?> ?>

View File

@ -32,7 +32,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // requis car utilise par les classes qui heritent require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // requis car utilise par les classes qui heritent

View File

@ -122,7 +122,7 @@ class pdf_edison extends ModelePDFCommandes
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -152,7 +152,8 @@ class pdf_einstein extends ModelePDFCommandes
$nblignes = sizeof($com->lignes); $nblignes = sizeof($com->lignes);
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -30,7 +30,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/don.class.php"); require_once(DOL_DOCUMENT_ROOT."/don.class.php");

View File

@ -31,7 +31,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilisé dans les classes qui héritent require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilisé dans les classes qui héritent

View File

@ -152,7 +152,8 @@ class pdf_crabe extends ModelePDFFactures
$nblignes = sizeof($fac->lignes); $nblignes = sizeof($fac->lignes);
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -125,7 +125,8 @@ class pdf_huitre extends ModelePDFFactures
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation facture vierge // Initialisation facture vierge
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDI_Protection('P','mm','A4');
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -149,7 +149,8 @@ class pdf_oursin extends ModelePDFFactures
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation facture vierge // Initialisation facture vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -30,7 +30,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**
\class ModelePDFFicheinter \class ModelePDFFicheinter

View File

@ -101,7 +101,8 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -29,7 +29,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilisé dans les classes qui héritent require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilisé dans les classes qui héritent

View File

@ -151,7 +151,8 @@ class pdf_propale_azur extends ModelePDFPropales
$nblignes = sizeof($propale->lignes); $nblignes = sizeof($propale->lignes);
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -116,7 +116,8 @@ class pdf_propale_bleu extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -117,7 +117,8 @@ class pdf_propale_jaune extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->SetTitle($propale->ref); $pdf->SetTitle($propale->ref);

View File

@ -119,7 +119,8 @@ class pdf_propale_rouge extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -118,7 +118,8 @@ class pdf_propale_vert extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -28,7 +28,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**
\class pdf_paiement \class pdf_paiement
@ -180,7 +180,8 @@ class pdf_paiement
$year = sprintf("%04d",$year); $year = sprintf("%04d",$year);
$_file = $dir . "/payments-".$month."-".$year.".pdf"; $_file = $dir . "/payments-".$month."-".$year.".pdf";
$pdf = new FPDF('P','mm','A4'); $pdf = new FPDI_Protection('P','mm','A4');
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$sql = "SELECT ".$this->db->pdate("p.datep")." as dp, f.facnumber"; $sql = "SELECT ".$this->db->pdate("p.datep")." as dp, f.facnumber";

View File

@ -32,7 +32,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdf.php'); require_once(FPDF_PATH.'fpdi_protection.php');
/** /**

View File

@ -107,7 +107,8 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -162,7 +162,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation document vierge // Initialisation document vierge
$pdf=new FPDF('P','mm',$this->format); $pdf=new FPDI_Protection('P','mm',$this->format);
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -185,7 +185,7 @@ if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', $conf->exte
if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
// require_once(FPDF_PATH . "fpdf.php"); // require_once(FPDF_PATH . "fpdf.php");
// dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir supprimer la ligne suivante // dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir supprimer la ligne suivante
if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdf.php"); if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdi_protection.php");
/* /*

View File

@ -92,7 +92,8 @@ if ( $resql )
dolibarr_syslog("$num factures a imprimer"); dolibarr_syslog("$num factures a imprimer");
$pdf = new FPDF('P','mm','A4'); $pdf = new FPDI_Protection('P','mm','A4');
$pdf->SetProtection(array('print')); //ne permet que l'impression du document
$pdf->Open(); $pdf->Open();
$pdf->SetMargins(10, 10, 10); $pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);