title: Zend Framework Render Barcodes Into PDF Pages
body: <p>I'm trying to create PDF pages with barcodes that have correct margins to be printed on sheets of labels (If you have another idea of how to print barcodes onto labels without PDF generation, I'd love to hear it).  Below is what I have currently for code:</p>
  
  <pre><code>$pdf = new Zend_Pdf();
  for($i = 1; $i &lt;= $numberOfPages; $i++)
  {
    $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
    $page-&gt;setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 20);
    $pdf-&gt;pages[] = $page;
  }
  foreach($pdf-&gt;pages as $id =&gt; $page)
  {
    if($equipmentCount &gt; 10)
    {
      $barcodesOnThisPage = 10;
      $equipmentCount = $equipmentCount - 10;
    }
    else
    {
      $barcodesOnThisPage = $equipmentCount;
    }
    for($i = 1; $i &lt;= $barcodesOnThisPage; $i++)
    {
      //Zend_Barcode::setBarcodeFont();
      $barcodeOptions = array('text' =&gt; 'ZEND-FRAMEWORK-1'); 
      $rendererOptions = array('topOffset' =&gt; 50);
      $pdf = Zend_Barcode::factory('code39', 'pdf', 
      $barcodeOptions, $rendererOptions)-&gt;setResource($pdf)-&gt;render(); 
      die;
      $barcodeOptions = array('text' =&gt; 'ZEND-FRAMEWORK-2'); 
      $rendererOptions = array('topOffset' =&gt; 100); 
      $pdfBarcode = Zend_Barcode::factory('code39', 'pdf', 
      $barcodeOptions, $rendererOptions)-&gt;setResource($pdf)-&gt;draw(); 
      $barcodeOptions = array('text' =&gt; 'ZEND-FRAMEWORK-3'); 
      $rendererOptions = array('topOffset' =&gt; 150); 
      $pdfBarcode = Zend_Barcode::factory('code39', 'pdf', 
      $barcodeOptions, $rendererOptions)-&gt;setResource($pdf)-&gt;draw(); 
      // and the end render your Zend_Pdf 
      /$pdfBarcode-&gt;save('testBarcode.pdf'); 
    }
  }
  </code></pre>
  
  <p>I'm currently getting an error "Invalid file path in: library/Zend/Pdf/FileParserDataSource/File.php on line 79 ()"</p>
  
  <p>Any thoughts on why this is occurring?  This happens when I try to render the barcode.  Before that the code executes with no errors.</p>