Skip to content

Exporting a PNG cropped to the barcode #113

Closed Answered by mogwai
mogwai asked this question in Questions and Answers
Discussion options

You must be logged in to vote

Thank you for your fast reply Terry. I managed to get it working but to make it clear for other people:

  1. Append to the base script the command your interested in using:
...
%!PS

0 0 moveto (asda) (includetext  rotation=45) /datamatrix /uk.co.terryburton.bwipp findresource exec 
showpage
  1. Run the new file you created with the output device being set to bbox -sDEVICE=bbox giving you the bbox of the item:
./gs -dBATCH -dNOPAUSE -sDEVICE=bbox genBarcode.ps

%%BoundingBox: -1 0 25 25
%%HiResBoundingBox: -0.008930 0.000000 24.011999 24.011999
  1. Modify the script from step 1 to now include the translate you require
0 0 moveto (asda) (includetext  rotation=45) /datamatrix /uk.co.terryburton.bwipp

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by terryburton
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #113 on December 24, 2020 13:32.