Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Printing only half barcode shows up #2

Open
ihussain1024 opened this issue May 31, 2017 · 0 comments
Open

When Printing only half barcode shows up #2

ihussain1024 opened this issue May 31, 2017 · 0 comments

Comments

@ihussain1024
Copy link

I've tried your example named 'PrintingExample.java'. It prints , but prints half of the barcode.
Codes

public class PrintingExample {

public static void main(String[] args) {
    try {
        String barcodedata="123456789";
        Barcode b = BarcodeFactory.createCode128(barcodedata);
        b.setResolution(300);
        b.setBarHeight(30);
        b.setBarWidth(1);
        
        Point p = new Point(10, 10); 
        b.setLocation(p);
        
        b.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 9));
        b.setDrawingText(true);
        b.setDrawingQuietSection(true);
        
        
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable(b);
        if (job.printDialog()) {
            job.print();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

}

Any help will be appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant