简体   繁体   English

用elaphe生成code128条码

[英]Generate code128 barcode with elaphe

I use the elaphe package to generate a code128 barcode. 我使用elaphe软件包生成code128条形码。 However, the generated barcode is empty. 但是,生成的条形码为空。 At first I thought the problem was with ghostscript (used by the PIL library to read EPS files), but other barcode types work fine. 起初,我认为问题出在鬼脚本上(PIL库用于读取EPS文件),但是其他条形码类型也可以。

The code that I wrote is: 我写的代码是:

barcode('code128', 'barcodetest').save('/home/vj/barcodetest.jpg')

But it gives me IOError: gs failed (status 256) error. 但这给了我IOError: gs failed (status 256)错误。

What is the problem? 问题是什么?

The supplied PostScript file in the google.com thread is badly broken. google.com线程中提供的PostScript文件严重损坏。 I'm not certain if this is the actual original problem. 我不确定这是否是实际的原始问题。 Looking inside the PostScript file I see a number of technical problems, including the use of routines which are never defined (in fact many of these look like incorrect line breaks). 在PostScript文件内部,我看到了许多技术问题,包括使用从未定义的例程(实际上,许多例程看起来像是不正确的换行符)。 However the most obvious problem is: 但是,最明显的问题是:

/rationalizedCodabar {
.....
.....
    /textsGS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>GS>ize 10 def

Clearly the repeated 'GS>' inserts should not be present, and the line should read: 显然,不应出现重复的“ GS>”插入,并且该行应显示为:

    /textsize 10 def

I'm inclined to think the other problems I see are symptoms of the same fault. 我倾向于认为我看到的其他问题是同一故障的症状。 If this is the actual PostScript file being sent to Ghostscript, I'm not at all surprised it doesn't work. 如果这是发送给Ghostscript的实际PostScript文件,我一点也不惊讶它不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM