Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Pages: 1
Bonjour,
Je suis à la recherche de police pour l'impression des codes barre.
A priori, il nous faut une police full ascii pour imprimer les # & cie.
Hors ligne
t'as pas trouvé sur le net ?
Hors ligne
Ben non.......enfin que des trucs payant......
Hors ligne
salut wazou, j'avais déjà écrit un script PB pour générer des codes barres avec une police gratuite mais il me semble de mémoire qu'il n'y avait que des chiffres...
Hors ligne
Ben c'est bien le problème que nous avons aujourd'hui, nous avons une police spéciale, mais qui ne digère pas un certain nombre de caractères, dont le # et encore d'autres sigles ......
Alors des fois que quelqu'un connaisse la super police qui permette de faire cela (à la limite même si c'est payant).......
Hors ligne
je ne sais pas si ça existe vu que la plupart des standards sont numériques ou alphanumériques...
à part le code 39 qui contient les caractères spéciaux + - . / % $ * espace
Code39 : ce code barre est essentiellement utilisé dans l'industrie automobile et élèctronique. Il ne possède pas de longueur fixe (ni de chiffre clé). Il doit commencer et finir par le caractère *. Il permet l'utilisation des chiffres et de l'alphabet ainsi que les caractères spéciaux suivants :
+ - . / % $ * espace
Hors ligne
Effectivement c'est celui que nous utilisons, mais il ne digère par le #, alors ....????
Hors ligne
Hors ligne
Merci, je vais regarder.
Hors ligne
Il faut utiliser cette foction pour que cela fonctionne ...
par exemple pour l'affichage dans une DW il faut un compute avec cette fonction en param 'mot à afficher'
f_format_code128.srf
$PBExportHeader$f_format_code128.srf global type f_format_code128 from function_object end type forward prototypes global function string f_format_code128 (string as_input) end prototypes global function string f_format_code128 (string as_input);string ls_c128_starta string ls_c128_startb string ls_c128_startc string ls_c128_start string ls_c128_stop Long ll_len,i Integer li_curr_char String ls_curr_char string ls_curr_encoding Long ll_curr_value Long ll_weighted_tot string ls_datatoencode Integer li_check_digit String ls_c128_checkdigit string ls_datatoprint string as_output as_input = trim(as_input) If Isnull(as_input) OR as_input = '' Then Return as_input End IF ls_c128_starta = CharA(203) ls_c128_startb = CharA(204) ls_c128_startc = CharA(205) ls_c128_stop = CharA(206) // Here we select character set A, B or C for the START character ll_len = LenA(as_input) li_curr_char = AscA(MidA(as_input, 1, 1)) If li_curr_char < 32 Then ls_c128_start = ls_c128_starta If li_curr_char > 31 AND li_curr_char < 127 Then ls_c128_start = ls_c128_startb If ((ll_len > 4) AND Isnumber(MidA(as_input,1,4))) Then ls_c128_start = ls_c128_startc // 202 is the FNC1, with this Start C is mandatory If li_curr_char = 202 Then ls_c128_start = ls_c128_startc If ls_c128_start = CharA(203) Then ls_curr_encoding = "A" If ls_c128_start = CharA(204) Then ls_curr_encoding = "B" If ls_c128_start = CharA(205) Then ls_curr_encoding = "C" For i = 1 to ll_len // check for FNC1 in any set If ((MidA(as_input,i,1)) = CharA(202)) Then ls_datatoencode = ls_datatoencode + CharA(202) // check for switching to character set C ElseIf ((i < ll_len - 2) AND (Isnumber(MidA(as_input,i,1))) and (isnumber(MidA(as_input,i + 1,1))) AND (Isnumber(MidA(as_input,i,4)))) OR ((i < ll_len) AND (Isnumber(MidA(as_input,i,1))) AND (Isnumber(MidA(as_input,i + 1,1))) And (ls_curr_encoding = "C")) Then // switch to set C if not already in it If ls_curr_encoding <> "C" Then ls_datatoencode = ls_datatoencode + CharA(199) ls_curr_encoding = "C" ls_curr_char = (MidA(as_input,i,2)) ll_curr_value = Long(ls_curr_char) // set the CurrentValue to the number of String CurrentChar If (ll_curr_value < 95 AND ll_curr_value > 0 ) Then ls_datatoencode = ls_datatoencode + CharA(ll_curr_value + 32) If ll_curr_value > 94 Then ls_datatoencode = ls_datatoencode + CharA(ll_curr_value + 100) If ll_curr_value = 0 Then ls_datatoencode = ls_datatoencode + CharA(194) i = i + 1 // check for switching to character set A ElseIf (i <= ll_len) AND ((AscA(MidA(as_input,i,1)) < 31) OR ((ls_curr_encoding = "A") AND (AscA(MidA(as_input,i,1)) > 32 AND (AscA(MidA(as_input,i,1))) < 96))) Then // switch to set A if not already in it If ls_curr_encoding <> "A" Then ls_datatoencode = ls_datatoencode + CharA(201) ls_curr_encoding = "A" // Get the ASCII value of the next character li_curr_char = (AscA(MidA(as_input,i,1))) If li_curr_char = 32 Then ls_datatoencode = ls_datatoencode + CharA(194) ElseIf li_curr_char < 32 then ls_datatoencode = ls_datatoencode + CharA(li_curr_char + 96) ElseIf li_curr_char > 32 Then ls_datatoencode = ls_datatoencode + CharA(li_curr_char) End IF // check for switching to character set B ElseIf (i <= ll_len) AND ((AscA(MidA(as_input,i,1))) > 31 AND (AscA(MidA(as_input,i,1))) < 127) Then // switch to set B if not already in it If ls_curr_encoding <> "B" Then ls_datatoencode = ls_datatoencode + CharA(200) ls_curr_encoding = "B" // Get the ASCII value of the next character li_curr_char = (AscA(MidA(as_input,i,1))) If li_curr_char = 32 Then ls_datatoencode = ls_datatoencode + CharA(194) Else ls_datatoencode = ls_datatoencode + CharA(li_curr_char) End IF End IF Next // ***** Calculate Modulo 103 Check Digit ******* // Set WeightedTotal to the value of the start character ll_weighted_tot = (AscA(ls_c128_start) - 100) ll_len = LenA(ls_datatoencode) For i = 1 to ll_len // Get the ASCII value of each character li_curr_char = (AscA(MidA(ls_datatoencode,i,1))) // Get the Code 128 value of CurrentChar according to chart If li_curr_char < 135 Then ll_curr_value = li_curr_char - 32 If li_curr_char > 134 Then ll_curr_value = li_curr_char - 100 If li_curr_char = 194 Then ll_curr_value = 0 // multiply by the weighting character ll_curr_value = ll_curr_value * i // add the values together ll_weighted_tot = ll_weighted_tot + ll_curr_value Next // divide the WeightedTotal by 103 and get the remainder, this is the CheckDigitValue li_check_digit = Mod(ll_weighted_tot,103) // Now that we have the CheckDigitValue, find the corresponding ASCII character from the table If li_check_digit < 95 AND li_check_digit > 0 Then ls_c128_checkdigit = CharA(li_check_digit + 32) If li_check_digit > 94 Then ls_c128_checkdigit = CharA(li_check_digit + 100) If li_check_digit = 0 Then ls_c128_checkdigit = CharA(194) // Check for spaces or "00" and print ASCII 194 instead // place changes in data to print ll_len = LenA(ls_datatoencode) For i = 1 to ll_len ls_curr_char = MidA(ls_datatoencode,i,1) If ls_curr_char = " " Then ls_curr_char = CharA(194) ls_datatoprint = ls_datatoprint + ls_curr_char Next // Get Printable String as_output = ls_c128_start + ls_datatoprint + ls_c128_checkdigit + ls_c128_stop + " " return as_output end function
Hors ligne
Bonjour,
Je rviens sur ce sujet que j'avais laissé de coté.
Ta fonction, elle fonctionne avec une police spéciale ou un utilitaire spécial ? ou c'est Pb qui traduit l'ensemble des caractères ?
Et elle traduit bien les caractères # ??
Merci
Hors ligne
pour l'affichage dans une DW le code barre avec une police du IDAutomationCode39.zip, il faut un compute avec cette fonction en param 'mot à afficher'
il me semble bien que cela permet d'afficher aussi les caracteres speciaux dont '#'
Contrairement a certaines polices on n'a pas besoin d'afficher un '*' avant et après le 'mot à afficher' pour que cela soit scanable avec une douchette
Hors ligne
Et donc, il faut acheter le produit (la licence) du fameux IDAutomationCode39.zip ???
Hors ligne
yes ...
Hors ligne
Sinon, j'ai une paire de routines qui permettent de vérifier l'intégrité d'un code EAN13 et de l'imprimer avec une police. Je ne pense pas que ça gère les # et le reste, mais si tu cherches du EAN13 uniquement, ça marche.
Hors ligne
Merci, mais la police que nous utilisons à l'heure actuelle gère de nombreux cas sauf les # ..... donc dès que la période de backup du mois d'aout sera passée, je reprendrais ce sujet.
Mais quand même
Hors ligne
Finalement, nous avons pris cela :ici , en téléchargeant le fichier FRE3OF9X.TTF , en installant la police dans le panneau de config de windows et en utilisant cette police sur les codes barre, cela fonctionne tout seul.
Et en plus, c'est gratuit.
Hors ligne
ah cool merci
00
Hors ligne
Pages: 1