TCPDF 错误:一维条形码字符串错误

发布于 2024-12-17 04:42:01 字数 510 浏览 4 评论 0原文

使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演多会厌 2024-12-24 04:42:01

通常,这意味着您尝试使用不受支持的字符创建条形码。
每种条形码类型仅支持一个字符子集,因此,由您来验证代码。

请记住,通常不接受 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文