本文介绍了在使用tcpdf datamatrix创建的代码中添加FNC1字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用tcpdf生成数据矩阵条形码.真的很好.现在,我被问到是否可以在代码中添加fnc1字符.但是我不知道fnc1字符的表示对于tcpdf生成器是正确的.我在这里遇到过 http://sourceforge.net/p/tcpdf/discussion/435311/thread/161b1b1a

I am using tcpdf to generate datamatrix barcodes. Works really nice. Now I was asked if we could add fnc1 characters to our code.But I have no clue what the representation of the fnc1 character would be correct for the tcpdf generator.I came across this here http://sourceforge.net/p/tcpdf/discussion/435311/thread/161b1b1a

但是我想了解使用chr(241)的答案实际上是从哪里来的.在我看来,它似乎是从天上掉下来的.文档没有对此进行任何说明,在其他任何地方我都没有发现chr(241)将代表fnc1字符.

But I would like to understand where the answer of using chr(241) actually comes from. To me it seems like it fell from the sky. Documentation doesn't say anything about it and I have not found anywhere else that chr(241) would be a representation of the fnc1 character.

除此之外,它对我不起作用,扫描条形码只会在代码中间产生ñ个字符.

Apart from that, it doesn't work for me, scanning the barcode just results in ñ characters in the middle of the code.

有人知道如何将fnc1字符放入tcpdf数据矩阵中吗?我想念什么?预先感谢您的帮助!

Anyone an idea how I could get the fnc1 character into my tcpdf datamatrix? What am I missing? Thanks for help in advance!

$string = chr(241).str_replace(";", chr(241), $string);
$barcodeobj = new TCPDF2DBarcode();
$barcodeobj->setBarcode($string, 'DATAMATRIX');
$barcodeobj->getBarcodeSVGcode(6, 6, 'black');

推荐答案

/tcpdf/include/barcodes/datamatrix.php中查看版本1.0.008(从2014-05-06开始)的代码,我看不到对特殊功能或宏的任何全面处理数据矩阵中的字符,因此您可能不走运.

Looking at the code for version 1.0.008 (from 2014-05-06) in /tcpdf/include/barcodes/datamatrix.php I cannot see any comprehensive treatment of the special function or macro characters in Data Matrix so you are probably out of luck.

也就是说,您所链接的论坛回复由TCPDF(Nicola Asuni)的作者撰写,因此我们值得联系他看看他当时的想法.我的猜测是,其他一些库使用的示例输入使他误认为FNC1可以表示为普通代码点,但是,这是错误的,因为.

That said, the forum reply to which you link was written by the author of the TCPDF (Nicola Asuni) so it might we worth reaching out to him to see what he was thinking at the time. My guess would be that an example input used by some other library had mislead him into believing that FNC1 can be represented as an ordinary code point, however this is wrong since FNC1 is a non-data character that requires special treatment.

这篇关于在使用tcpdf datamatrix创建的代码中添加FNC1字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 21:23