in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

How do you print a barcode in a pdf from a database?

Last post 02-12-2008 10:56 AM by C1_GaryB. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-29-2007 2:23 PM

    How do you print a barcode in a pdf from a database?

    I want to print a barcode in a pdf using C1.pdf. Is there an example?

  • 09-12-2007 6:18 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 500

    Re: How do you print a barcode in a pdf from a database?

    If the barcode is an image you use the DrawImage method, passing the image and coordinates.  If you are using C1Barcode control then the image is easily attainable.

    _c1pdf.DrawImage(c1BarCode1.Image, new RectangleF(100, 100, 30, 20));

    If the barcode is a value using a barcode font, you have to set the FontType to Embeded and use DrawString with the embedded barcode font.  Note that the font must be installed on your machine.

    _c1pdf.DrawString("123456", new Font("Name of font", 28), Brushes.Black, new PointF(200, 200));

    Regards,
    Greg L

    Filed under: ,
  • 02-12-2008 10:56 AM In reply to

    Re: How do you print a barcode in a pdf from a database?

    Hi,
     
    Yes you can created PDF but not directly using C1Barcode. You can use either of the below given options -
     
        a. Create an image using C1Barcode -> Load that Image in C1PDF and create a pdf file.
     
    or
     
        b. Render and preview using C1Preview (using RenderBarcode) -  Export into PDF using Export method.
     
    I have created and attached a sample for the first example. Let me know if you need an example for the second one two.
     
    Thanks,
    Gary.
    <mattphung> wrote in message news:198041@10.0.1.98...

    I want to print a barcode in a pdf using C1.pdf. Is there an example?



    http://helpcentral.componentone.com/cs/forums/p/72951/198041.aspx#198041

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.