TCPDF 错误:一维条形码字符串错误
使用 tcpdf 模块在带有条形码数组的 pdf 文档中生成一维条形码图像时出现以下错误。
“TCPDF 错误:一维条形码字符串错误”
if (file_exists("data1.txt"))
{
echo("<B>File Exists data1.txt</B>");
$arrText = file("data1.txt");
for ($i=0; $i<count($arrText); $i++)
{
echo("<P>$arrText[$i]</P>");
$pdf->write1DBarcode("'".chop($arrText[$i])."'", 'UPCA', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
}
}
else
{
echo("<B>Cannot find file</B>");
exit;
}
Getting the following error while generating 1D barcode images in pdf document with array of barcodes using tcpdf module.
"TCPDF ERROR: Error in 1D barcode string"
if (file_exists("data1.txt"))
{
echo("<B>File Exists data1.txt</B>");
$arrText = file("data1.txt");
for ($i=0; $i<count($arrText); $i++)
{
echo("<P>$arrText[$i]</P>");
$pdf->write1DBarcode("'".chop($arrText[$i])."'", 'UPCA', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
}
}
else
{
echo("<B>Cannot find file</B>");
exit;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,这意味着您尝试使用不受支持的字符创建条形码。
每种条形码类型仅支持一个字符子集,因此,由您来验证代码。
请记住,通常不接受 UTF-8 字符。检查您尝试使用的条形码类型的文档以获取更多信息,祝您好运。
Normally this means that you are try to create a barcode using unsupported characters.
Each barcode type support only a character subset so, it is up to you to verify the code.
Keep in mind UTF-8 characters are normally not accepted. Check the documentation of the barcode type you are trying to use for further information, good-luck.