We are printing labels to printer directly. The printer is Zebra.
We are using templates to define fields. Here is line which i want to change font size a bit more bigger
^FT465,819^A0N,56,55^FH\^FD<Address>^FS
You can see that its Address field. I want to change font to be bit bigger but i have no clue what this code. I read a bit and its ZPL code but dont know how i change font size for that field. Has anyone experience with zebra printing. I am printing programatically through c#
Try using something like this:
^XA
^FO485,945^CF0,60^FD<Address>^FS
^FO485,900^CF0,40^FD<Address>^FS
^XZ
You can see I change font size from 60 pixels to 40 pixels.
Related
I am writing program to generate PDF from pictures. I want to my pictures will be in normal size foreach page.For example i have image 2000px width and 10000px height and I don`t want to scalling this image. I want his natural size in PDF and not constant A3, A4 or A0. How can I solved that?
Thanks for helps.
If you know the dpi it's just a matter of creating a page with the correct size.
For example with 300dpi and 2000px the size would be (2000/300)*72=480.
I have a windows application which is responsible for printing customized barcode labels roll based on user's needs like specifying the texts, dimensions and size.
The user will use Zepra and TSC barcode printers, I just need to know how to let the user choose determine the size of label and the space between labels and also the all margins (top, right, bottom and left).
I need a code-snippet does that in C# and the final result to be like this.
So, any ideas?
For Zebra part:
Here is an example how to send ZPL commands into printer:
https://km.zebra.com/kb/index?page=content&id=SA301&cat=ZISV_PL_ZPL&actp=LIST
Here you can find pdf document from ZPL commands which are send to printer. Build a suitable set of codes which will produce the label and barcode that you need:
https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf
Happy Coding!
Is there any way I can interrogate a printer and find the maximum page width that it can take (as seen in printer preferences).
I have an app that is printing images, and sometimes the image I produce is wider than the printer can handle. So I need to know the selected printers maximum page width.
Using the printable area of a page doesn't help me. I need to know the maximum width of page for a printer.
Cheers
A have created a pdf file from an .aspx page using the wkhtmltopdf converter. It's showing a smaller font size than the actual font shown on the page. So when I take the print out of the pdf file, it looks as if it has been compressed to a smaller size. Do any of you have any idea how can I set/increase the font size by number (14 or 15) or percentage using C# code? I'm using the string switches to fix the margin, page etc. as follows:
string switches = "";
switches += "--print-media-type ";
switches += "--margin-top 5mm --margin-bottom 5mm --margin-right 10mm --margin-left 30mm ";
switches += "--page-size A4 ";
Can you suggest how I can incorporate font size here? My page has different font types and sizes for different controls. I want to increase the font size for ALL elements (if possible, by some percentage).
The problem above can be solved by the following code:--
I added this line of code and the newly created pdf file has exactly the font size what I want.
switches +="--disable-smart-shrinking";
It'll stop font shrinking.
If you can't edit the html/css before sending it to wkhtmltopdf, try the --minimum-font-size option. If that doesn't work, and you don't mind making everything bigger, there is also --zoom.
I did like to print a barcode using C#. I want the barcode to have a given height and width. I did download a free 3 of 9 barcode font and used
Font barcodeFont = new Font("Free 3 of 9", 17, FontStyle.Regular);
e.Graphics.DrawString("*"+label.Lpn+"*", barcodeFont, Brushes.Black,new RectangleF(166,235,115.16f,61));
to print it. I have two issues with this.
) for some font size barcode is
printed in two line.
) even if I
reduce the font and make it print in
one line. The barcode does not scan
well. I have to swipe it in a
perticular way to make it work.
Is there a better way to print barcode which will scan every time??
There are minimum and maximum widths for the lines and spaces of a 3of9 barcode.
Take a look at this website for more info about these measurements: http://www.adams1.com/39code.html
Take a look here at CodeProject for a decent Barcode generator. This is capable of generating different types of Barcodes including 3 of 9.
Hope this helps,
Best regards,
Tom.
Code 3 of 9 does tend to be quite a wide barcode and the only way you'll really solve your problem is by giving it more space on the page.
An alternative to this would be to either encode your data so it takes up less characters/bars or instead do a database lookup, so 1 = Bananas, 2 = Apples, 3=VeryLongWordThatDoesntFit etc.
Another alternative would be to improve the quality of the barcode scanner. It is true with barcode scanners that the more you spend the better results you get.
Does the barcode font provide recommended point sizes? A free font might not have the hinting required to insure that each bar is an integral number of pixels wide. This might be a problem especially if your printer has an odd DPI. I'm aware of one model of label printer that is 203 DPI, good luck matching your font size to pixels on that printer!