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

  • SEARCH
  • Home
  • 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 8857325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:33:43+00:00 2026-06-14T14:33:43+00:00

I want to generate a barcode image. So, I used elaphe package. It works

  • 0

I want to generate a barcode image. So, I used elaphe package. It works correctly but it returns PIL.EPSImageFile instance. I don’t know how I can convert it to image format like SVG, PNG or JPG.

The code I have written is:

barcode('code128', 'barcodetest')

And it returns:

<PIL.EpsImagePlugin.EpsImageFile image mode=RGB size=145x72 at 0x9AA47AC>

How can I convert this instance to image?
Actually I think my question is wrong but I don’t know how to explain it well!

  • 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-06-14T14:33:45+00:00Added an answer on June 14, 2026 at 2:33 pm

    Simply save that file object to something with a .png or .jpg filename:

    bc = barcode('qrcode',
        'Hello Barcode Writer In Pure PostScript.',
        options=dict(version=9, eclevel='M'), 
        margin=10, data_mode='8bits')
    bc.save('yourfile.jpg')
    

    or state the format explicitly:

    bc.save('yourfile.jpg', 'JPEG')
    

    PIL will then convert the image to the correct format.

    Note that the PIL EPS module uses the gs command from the Ghostscript project to do it’s conversions, you’ll need to have it installed for this to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate random integers between 0-9 (inclusive on both ends), but I
I want to create an application to generate a barcode USing Zxing as library.
I want to generate ajax requests on the fly, but I want to make
I want to generate a barcode and underneath a button so that the user
I want to take a numerical string and generate a simple barcode that can
I want generate PDF File with an image. The image name from database and
I want to generate 40 pages of some report from the database but first
i want to generate a notification bar showing the progress via builder method but
Let's say I have a class of 30 students and want generate every possible
I want to generate a list of files where the name consists of ${filename}.${date}

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.