Saving a graphic file

Barcode images may be saved to file using the saveGraphicToFile() method, with the first parameter as the target filename (illustrated below for a Windows file system). The graphic image types supported depend on the platform on which the Java VM is running, but generally include EPS, GIF, JPEG and PNG formats.

 

public void savebuttonActionPerformed(java.awt.event.ActionEvent evt) {

        // Save to file

String status;

        doBarcode();

        try {

        if (bcard.saveGraphicToFile(“c:\test.png”,”png”,300,0)<0)

        {

            status="Unable to create graphics file";

        }

        else

            status=”OK”;

        }

        catch (IOException e) {

        }

  }

 

 

More:

Licensing the component