1

Bonjour,
D'abord je vous remercie pour votre bibliothèque,elle nous aide beaucoup mais cependant j'ai un problème!
J'ai essayé de modifier l'exemple9 afin de pouvoir générer plusieurs codes barres en fonction du type!
Mais je ne peux pas générer plus de 18 codes barres!
Je détaille mon problème: Quand je lance ma page il y a un formulaire qui apparait dans lequel on choisit le type (ordinateur,scanner,...) et le nombre de code barres qu'on veut générer!et au niveau du nombre,si je choisis un nombre compris entre 1 et 18 alors tout marche nickel mais si je prends un nombre supérieur à 20 ca me donne des erreurs! je vous copie le script et j'espère recevoir de l'aide très bientot!
<?php
/**
* HTML2PDF Librairy - example
*
* HTML => PDF convertor
* distributed under the LGPL License
*
* @author Laurent MINGUET <webmaster@html2pdf.fr>
*
* isset($_GET['vuehtml']) is not mandatory
* it allow to display the result in the HTML format
*/

//
if(isset($_POST["envoyer"]) && ($_POST["envoyer"] == "envoyer"))
{
if(isset($_REQUEST['nombre']) || isset($_REQUEST['choix']))
{
$type;
$i=1;
$nombre = $_POST['nombre'];
$choix = $_POST['choix'];

if ($choix == "Ordinateur" )
{$type = "UC00";}
else if ($choix == "Scanner")
{$type = "SCA00";}
else if ($choix == "Switch")
{$type = "SWI00";}
else if ($choix == "Routeur")
{$type = "ROU00";}
else if ($choix == "Onduleur")
{$type = "OND00";}
else if ($choix == "Moniteur")
{$type = "MON00";}
else if ($choix == "Imprimante")
{$type = "IMP00";}
}
?>
<table border="2">
<?php
while ($i < $nombre)
{
//echo '<tr>';
?>
<tr> <td> <barcode value="<?php echo $type.$i; ?>" > </barcode> </td>
<td> <barcode value="<?php echo $type.$i; ?>"> </barcode> </td> </tr>
</tr>
<?php //echo '</tr>';
$i++;
}

?>
</table>
<?php


}

//else
// {
// echo " Enregistrement non effectue !";
// }
if(isset($_POST["envoyer"]) && ($_POST["envoyer"] == "envoyer"))
{
$content = ob_get_clean();
require_once(dirname(__FILE__).'/../html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('L', 'A4', 'fr' , false, 'ISO-8859-15', array(10, 10, 10, 10));
$html2pdf->writeHTML($content);
$html2pdf->Output('test.pdf');
exit;
}
catch(HTML2PDF_exception $e)
{
echo $e;
exit;
}
}

?>


<fieldset style="width:35%;"> <legend> Generation code-barre </legend> <br />
<form name="generation" action="" method="post" >
<table>
<tr>
<td>Materiel: </td>
<td>
<select name="choix" >
<option> -- Choisir le materiel--</option>
<option > Ordinateur </option>
<option > Scanner </option>
<option > Switch </option>
<option > Routeur </option>
<option > Onduleur </option>
<option > Moniteur </option>
<option > Imprimante </option>
</select>
</td>
</tr>
<tr>
<td>Quantite:</td>
<td> <input type="text" name="nombre" /> </td>
</tr>
<tr>
<td>
<input name="valider" value="Valider" type="submit" />
</td>
<td>
<input name="efface" value="Effacer" type="reset" />
</td>
</tr>
</table>
<input type="hidden" name="envoyer" value="envoyer" />
</form> </fieldset>
<img src="codebarre/IMPR/0001.JPG">