PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Printing Barcodes with PDFSharp
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3474
Page 1 of 1

Author:  jason171 [ Thu Oct 13, 2016 3:03 pm ]
Post subject:  Printing Barcodes with PDFSharp

Hello.
I have been working on a way to print barcodes for my company's software product so I started with PDFSharp's 3 of 9 barcode format and then used the code as a base to create files for code 128 B. This works nicely and can always be read correctly on printer paper whether vertical or horizontal orientation is used in the generated pdf (2.2"x1"). The following is how I print the barcode to the file rotated vertically.
...
XTextFormatter tf = new XTextFormatter(gfx);
Code128BStandard bc = new Code128BStandard("7243");
...
XRect rect = new XRect(18, -10, 63, 10);
gfx.RotateTransform(90);
tf.DrawString("Store at 2C-8C", fStorage, XBrushes.Black, rect, XStringFormats.TopLeft);

XPoint bcPoint = new XPoint(4, -33);
gfx.DrawBarCode(bc, bcPoint);
...

I need to be able to print this vertically on a label for a small vial. When I do, the barcode lines become distorted in vertical orientation when printed on a label printer. When I leave it horizontal, the label is able to be scanned but I need it to be vertical though because if it wraps around the vial too far the scanner won't be able to read it.

I am using a Cognitive Advantage DLX label printer. In previous software development, they used the printer's native CPL language which dictated we have clients use this specific printer instead of printing from a file to any device. Using that method the barcode printed the vertical barcodes without an issue. I am trying to eliminate this label printer dependency.

Does anyone have any ideas or suggestions on how I might try to get the file to print with the necessary clarity from PDF so that the barcode won't distort when printed vertically?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/