title: tcpdf create a label pdf size width:57mm and height:32mm
body: <p>guys i use TCPDF library for my php server and i want to create a label with width:57mm and height:32mm</p>
  
  <pre><code>$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  $pdf-&gt;SetPrintHeader(false);
  $pdf-&gt;SetPrintFooter(false);
  $pdf-&gt;AddPage('L', array(57,32));
  $pdf-&gt;SetFont('dejavusans');
  $html ="
      &lt;table class='domi'&gt;
      &lt;tbody &gt;";
      for($i=0; $i&lt;$rows; $i++){
          $style=' style="font-size:'.$fontsize[0][$i].'px"';
          if($bold[0][$i]===0){
              $html2a[$i] = "&lt;tr&gt;&lt;td".$style."&gt;".$content_line[$i]."&lt;/td&gt;&lt;/tr&gt;";
          } else {
              $html2a[$i] = "&lt;tr&gt;&lt;td".$style."&gt;&lt;b&gt;".$content_line[$i]."&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;";
          }
          $html2b .= $html2a[$i];//$pdf-&gt;GetStringWidth($html2a[$i])." ";
      }
      $html3 = "&lt;/tbody&gt;
      &lt;/table&gt;";
  $pdf-&gt;writeHTMLCell($w=55, $h=2, $x='1', $y='1', $html.$html2b.$html3, $border=1, $ln=1, $fill=0, $reseth=false, $align='C', $autopadding=true);
  $pdf-&gt;Output($_SERVER['DOCUMENT_ROOT'] . 'Site/labels/label'.$id.'.pdf', 'FI');
  </code></pre>
  
  <p>1st of all it prints the contents fine from the database in A4 size etc but all i want is to create and save the pdf document in the label size width:57mm and height:32mm!!! <a href="https://i.stack.imgur.com/kQ8Be.png" rel="nofollow noreferrer">https://i.stack.imgur.com/kQ8Be.png</a></p>
  
  <p>as you see, I've marked with 1-5 numbers the actual data and the rest are marked with questionmarks!! I dont understand why of course.</p>
  
  <p>2nd when i change the line $pdf->AddPage('L', array(57,32)); to $pdf->AddPage('L', array(57,57)); the label is created but i have an empty space in the bottom-right corner + it doesnt have the 32x57 size!!! <a href="https://i.stack.imgur.com/XgEWU.png" rel="nofollow noreferrer">https://i.stack.imgur.com/XgEWU.png</a></p>
  
  <p>thanks in advance!!!</p>