Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:45:33+00:00 2026-05-26T23:45:33+00:00

Hy guys, how can i display a barcode with Zend_PDF ? this is my

  • 0

Hy guys,

how can i display a barcode with Zend_PDF ?

this is my code:

  $config = new Zend_Config(array(
                'barcode'        => 'code39',
                'barcodeParams'  => array('text' => '11020109'),
                'renderer'       => 'image',
                'rendererParams' => array('imageType' => 'gif'),
             ));
  $renderer = Zend_Barcode::factory($config)->render();

now how can i render it to my pdf?
i try without succes with:

$barcode = Zend_Pdf_Image::imageWithPath($renderer);
$page->drawImage($barcode, 10, 510, 290, 550); 

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:45:33+00:00Added an answer on May 26, 2026 at 11:45 pm

    The following should get you going, there is 3 things you have to change, your renderer, your method to render the barcode to the pdf and for some obscure reason, you have to include a font to your Zend_Barcode or you will get an error

    $pdf = new Zend_Pdf();
    
    // Your font (path might differ)
    Zend_Barcode::setBarcodeFont(APPLICATION_PATH . '\..\data\resources\fonts\arial.ttf'); 
    
    $config = new Zend_Config(
        array(
            'barcode'        => 'code39',
            'barcodeParams'  => array('text' => '11020109'),
            'renderer'       => 'pdf', // here is your new renderer
            'rendererParams' => array(), // you can define position offset here
        )
    );
    
    $pdfWithBarcode = Zend_Barcode::factory($config)->setResource($pdf)->draw(); // your new barcode renderer is defined here, from now on to add things to your pdf you need to use the new variable ($pdfWithBarcode)
    
    // Save your pdf (path might differ)
    $pdfWithBarcode->save(APPLICATION_PATH . '\..\data\testBarcode.pdf'); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm hoping you guys can help me figure out why this is happening. I've
I hope some of you guys can help me with this problem.... I have
I hope you guys can help me with this one. So, I have a
Couldn't find a better place to ask this so I hope you guys can
Hey guys. I'm having this silly issue with inserting text with forwardslash into cart
hi guys can anyone guide me on implementation of Internationalization on Android platform. I
I'm hoping you guys can answer me a question? I've only just started out
Maybe you guys can help: I have a variable called $bio with bio data.
I've run in to a problem I hope you guys can help me with.
I'm really confused so I hope you guys can help me. I know how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.