1. Yasushi Masuda
  2. elaphe
Issue #18 resolved

Make codestring/optionstring hexilified

Yasushi Masuda
repo owner created an issue

At https://bitbucket.org/whosaysni/elaphe/issue/5/cant-create-a-pdf417-code#comment-7143415 , Terry said:

Might I suggest modifying the invocation of BWIPP so that the PostScript uses hex strings <> for the data and options fields rather than normal strings ().

0 0 moveto ... <{hexdata}> <{hexoptions}> /{encoder} /uk.co.terryburton.bwipp findresource exec

Comments (4)

  1. Terry Burton

    I suggest the following:

    import binascii, textwrap
    string = 'test testtesttesttest test test testtesttest test \n sdfojsodfj oij 3240987u098rusipdjf948325u test'
    wrapper=textwrap.TextWrapper(subsequent_indent=' ', width=72)
    print wrapper.fill('<' + binascii.hexlify(string) + '>')
    

    This generates neatly indented output as follows:

    <74657374207465737474657374746573747465737420746573742074657374207465737
     474657374746573742074657374200a207364666f6a736f64666a206f696a2033323430
     393837753039387275736970646a66393438333235752074657374>
    
  2. Log in to comment