Jump to content

Recommended Posts

Posted (edited)

New version:

2012-06-04 - added Print + some inner optimizations

EDIT:

I tested it also with Barcode scanner in my work (only Code 128)

and it seems there is some problem on Windows7 64bit in GUI with font.

There are 3 bars at begin which shouldn't be there.

So when I do Screenshot of GUI with barcode on label and print this screenshot then scanner can't read it.

But when I print it by TextOut API (see Print() in my example) with the same font and the same data value

then output barcode on printer/paper is OK and can be read by scanner.

At home on my WindowsXP this bug doesn't occur.

So it may be some bug in TTF font on 64bit systems

or it can be bug in AutoIt in GUICtrlSetFont() only on 64bit systems

or it can be bug in AutoIt in GUICtrlSetData() only on 64bit systems

or something else ...

I will do more tests of this bug later.

Edited by Zedna
  • 3 months later...
Posted (edited)

i am trying to print with a zebra lp2824 printer, but when i press print button, it just print an empty label. but using a normal printer, it print a complete A4 page with the input entered and the respective barcode.

what could i do to print just the barcode on the zebra lp2824 printer.??

thank you!!!

@zedna

Zedna

Edited by Alexisss
Posted

Just my 2 pence - I dislike barcode fonts and prefer to manually code them. Attached is how I devised Code39 by using Wiki's table "Code Details", which saved me a huge amount of work. AFAIK there is no "limitation" to how long a Code39 can be, I capped it in my script to 16 characters because I use _ScreenCapture_CaptureWnd to grab a JPG which is used on address label sheets, so if anyone re-uses this make sure those dimensions will work for you.

Enjoy

Ian

PS @ Alexisss:

What happens if you try to print anything at all to the Zebra? Will it print plain text from Notepad? I've fixed plenty of Zebras but have never owned one to experiment.

Stripped Down Code39 Demo.au3

My projects:

  Reveal hidden contents
  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Posted

PS @ Alexisss:

What happens if you try to print anything at all to the Zebra? Will it print plain text from Notepad? I've fixed plenty of Zebras but have never owned one to experiment.

i just try to print a text plain from note pad, so it print a blank label!!!!

there is noy way to modify the barcode udr to print on a zebra printer??, i am using a 2 inch per 1 inch label

  • 6 months later...
Posted

Hi Zedna,

I succesfully converted your example to print text and barcodes on a label(printer).

However for every new labelsize, I need to manually change the default papersize (via Printerproberties, General Tab, Preferences)

to print correctly.

I have analyzed your print.au3 and search with Google to find a way to send the papersize automatically before printing the label,

however I am over my head with DLLs and commands like DLLStructdata .

Could you (or other forummembers) help me out with changing the papersize (and printing orientation) ?

TIA, Jemboy

Posted

Hi FireFox thanks for helping me find a solution.

I know "assumption is the mother of all f**kups", but I assume this size is more the size of the $tDOCINFO- "record" used (like a memory reservation.)

If it has something to do with the papersize, I think it's overwritten by the default papersize, input at the properties/preference of the Windows printer.

Also the value "20" isn't documented, is it A4, Letter size?

I have to little knowledge of DLL-archicture (shiver) to find find out.

Posted (edited)

Well then you can't set it with the current UDF functions.

Edit: Have you tried to automate the "change paper size" part ?

Edited by FireFox
  • 5 months later...
  • Moderators
Posted

lishsewewe,

We do not accept adverts for payware apps. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

strange

I have a problem to run

"barcode_test.au3"

  Quote

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "L:TOOLsMacro  TESTbarcode_autoitprint.au3" /UserParams    

+>13:02:49 Starting AutoIt3Wrapper v.2.1.2.28 SciTE v.3.3.2.0 ;  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0415  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.9.19)  from:C:Program Files (x86)AutoIt3Beta
"L:TOOLsMacro  TESTbarcode_autoitprint.au3"(75,75) : warning: $__WINAPCONSTANT_LOGPIXELSY: possibly used before declaration.
$PixelsPerInchY = _WinAPI_GetDeviceCaps($hDC, $__WINAPCONSTANT_LOGPIXELSY)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"L:TOOLsMacro  TESTbarcode_autoitprint.au3"(77,75) : warning: $__WINAPCONSTANT_LOGPIXELSX: possibly used before declaration.
$PixelsPerInchX = _WinAPI_GetDeviceCaps($hDC, $__WINAPCONSTANT_LOGPIXELSX)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"L:TOOLsMacro  TESTbarcode_autoitprint.au3"(75,75) : error: $__WINAPCONSTANT_LOGPIXELSY: undeclared global variable.
$PixelsPerInchY = _WinAPI_GetDeviceCaps($hDC, $__WINAPCONSTANT_LOGPIXELSY)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"L:TOOLsMacro  TESTbarcode_autoitprint.au3"(77,75) : error: $__WINAPCONSTANT_LOGPIXELSX: undeclared global variable.
$PixelsPerInchX = _WinAPI_GetDeviceCaps($hDC, $__WINAPCONSTANT_LOGPIXELSX)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
L:TOOLsMacro  TESTbarcode_autoitprint.au3 - 2 error(s), 2 warning(s)
!>13:02:49 AU3Check ended. Press F4 to jump to next error.rc:2
>Exit code: 2    Time: 1.155

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 9/6/2013 at 11:04 AM, mlipok said:

strange

I have a problem to run

"barcode_test.au3"

 

I use old AutoIt 3.2.12.1 where these constants are declared in standard WinAPI UDF

Global Const $__WINAPCONSTANT_LOGPIXELSX = 88
Global Const $__WINAPCONSTANT_LOGPIXELSY = 90

Just add these two lines of code to the top of print.au3 and it should work for you also with new version of AutoIt.

 

Posted

thanks

now its works ..... nice

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Hello,

looks like the site http://grandzebu.net/informatique/codbar-en/code128.htm updated the code128.ttf font to V2.00 :
 

  Quote

 

Version 2.00 of the font : The code of characters 95 and following was modified compared to the version 1.00. The encoding function was modified consequently.

 

Unfortunately this new font is not compatible with the actual code, the code need to be updated to use it.

Edited by cetipabo
Posted

While this is all nice work, why don't someone port the functions of the free library Zint ?  There is a Delphi Wrapper here. There is both an exe and DLL option. My skills are not enough to port the Delphi code, unfortunately.

But you get almost all barcodes at once, even the most exotic ones. And putting Zint DLL into a zintbarcode.udf  would allow all applications to use barcodes for many projects.

Just my 2c. And it's not advertising for commercialware. Zint is opensourced.

  Reveal hidden contents

I am just a hobby programmer, and nothing great to publish right now.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...