Jump to content

Search the Community

Showing results for tags 'barcode128b printwinapi.au3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I am having an extreme hard time trying to get the barcode font to work and it doesn't seem to want to. I have built this part of my code and when using a barcode reader it doesn't decode. I have tried to use the script by andybiochem and while the barcode prints and decodes fine I can't seem to include it in my script. the space I can use on the page is only 1/2 inch by 4 inches. I grabbed the formula from a site, it must be wrong, please help Func PrintBC ($barcode = "3FAFP31352R159850-D22D0468") ;Build and Print Barcode $bc = StringSplit($barcode, "") $count = 0; For $e = 0 TO UBound($bc) - 1 Local $n = $e + 1 Local $val = Asc($bc[$e]) If $val == 128 Then $val = 0 ElseIf $val >= 33 And $val <= 126 Then $val -= 32 ElseIf $val > 126 And $val <> 128 Then $val -= 50 EndIf $count += ($val * $n) Next Local $rem = Mod($count, 103) If $rem == 0 Then $rem = 128 ElseIf $rem >= 1 And $rem <= 94 Then $rem += 32 ElseIf $rem > 94 And $rem <> 0 Then $rem += 50 EndIf $check = chr($rem) $code = chr(136)&$barcode&$check&chr(138); $DESIREDFONTSIZE = 16 $hFont = _WinAPI_CreateFont((($DESIREDFONTSIZE * -20) / $TwipsPerPixelY), 0, 0, 0, $FW_NORMAL, False, False, False, _ $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, $DEFAULT_PITCH, 'Code128bWin') _WinAPI_SelectObject($hPrintDc, $hFont) $OutSize = _WinAPI_GetTextExtentPoint32($hPrintDc, $code) $yTop = $yTop + 70 $Left = (($PageWidth - DllStructGetData($OutSize,"X")) / 2) $result = _WinAPI_TextOut($hPrintDc, $Left, $yTop, $code) _WinAPI_DeleteObject($hFont) ;Print BarCode Meaning $DESIREDFONTSIZE = 12 $hFont = _WinAPI_CreateFont((($DESIREDFONTSIZE * -20) / $TwipsPerPixelY), 0, 0, 0, $FW_NORMAL, False, False, False, _ $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, $DEFAULT_PITCH, 'Arial') _WinAPI_SelectObject($hPrintDc, $hFont) $OutSize = _WinAPI_GetTextExtentPoint32($hPrintDc, $barcode) $yTop = $yTop + 60 $Left = (($PageWidth - DllStructGetData($OutSize,"X")) / 2) $result = _WinAPI_TextOut($hPrintDc, $Left, $yTop, $barcode) _WinAPI_DeleteObject($hFont) $result = _WinAPI_EndPage($hPrintDc) Next EndFunc
×
×
  • Create New...