While converting the barcode to image in Net core 3.1, getting error barcode does not contain definition of ToImage()

Assembly version :
<PackageReference Include="Syncfusion.Pdf.Imaging.Net.Core" Version="18.2.0.59" />
    <PackageReference Include="Syncfusion.Pdf.Net.Core" Version="18.2.0.59" />

using Syncfusion.Pdf.Barcode;

private static Image GenerateBarcodeImage(string barcodeText)
        {
            //Initialize a new PdfCode39Barcode instance
            PdfCode39Barcode barcode = new PdfCode39Barcode();

            //Set the height and text for barcode
            barcode.BarHeight = 45;

            barcode.Text = "CODE39$";

            //Convert the barcode to image
           return barcode.ToImage(new SizeF(300, 200));
        }



3 Replies 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team October 1, 2020 12:44 PM UTC

Hi Hardik,   
 
Thank you for contacting Syncfusion support.   
 
To convert barcode to image in ASP.NET Core platform, kindly use the NuGet package Syncfusion.Pdf.Imaging.Net.Coreand no need to include “Syncfusion.Pdf.Net.Core” NuGet package. Please refer the below KB documentation which illustrates the steps to convert barcode to image in ASP.NET Core platform.   
 
Please try the above solution in your end and let us know the result.   
 
Regards,  
Sowmiya Loganathan  
 



HA hardik October 1, 2020 01:32 PM UTC

I follow the same steps and below is the observation:
Yes it's working for PdfQRBarcode barcode = new PdfQRBarcode() class
but it's not working PdfCode39Barcode barcode = new PdfCode39Barcode();

https://help.syncfusion.com/file-formats/pdf/working-with-barcode#export-barcode-as-image

Could you please provide example for PdfCode39Barcode barcode = new PdfCode39Barcode()
below is my requirement like




AP Anand Panchamoorthi Syncfusion Team October 2, 2020 12:59 PM UTC

Hi Hardik,

We have support to convert PdfCode39Barcode to image with the barcode text. Please find the sample from https://www.syncfusion.com/downloads/support/directtrac/general/ze/NETCoreConsoleApp915066208.

However, currently, we do not have support to convert multiple barcodes into a single image and barcode image with multiple texts. But we can achieve your requirement in PDF creation. If you are comfortable with the barcode in PDF document, we can provide the sample to meet your actual requirement.

With Regards,
Anand P

Marked as answer
Loader.
Up arrow icon