来者有分。有人有“jpgraph_barcode.php"这个文件吗? 本帖最后由 liucunping 于 2010-01-22 10:25:41 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你要用7-zip去解压.如果下载下来的包你用winrar解压,有可能会丢文件. TO:#4楼 你说的这个方法不行啊,我的总是和楼主的一样,刚才用7-zip解压的,还是没有"jpgraph_barcode.php"这个文件..顶! 不知道这个文件在哪里。一直找不到。jpgraph_barcode.php我是想用pdflib,在PDF里显示一个条形码。 为什么网上都说有“jpgraph_barcode.php"这个文件, 解:这只是个文件名字而已,jpgraph_bar.php替换就是了。关键是实现功能。。 不要乱说哦http://hem.bredband.net/aditus/chunkhtml/apg.htmljpgraph_barcode.php 只在专业版中有 条码字库http://www.google.cn/search?q=%E6%9D%A1%E7%A0%81%E5%AD%97%E5%BA%93&rls=com.microsoft:zh-cn:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7BJYT_zh-CN 那能下到jpgraph_barcode.php,这个文件吗。怎么得到专业版的?另外条码字库的我也用过,用的是CODE39,不过只能显示在IE里,我现在想让条形码显示在PDF中。 既然你用pdflib,就应该知道如何向pdf输出文字,把条码当文字输出就是了 <?php$pdf = PDF_new();PDF_open_file($pdf, "D:\PDFTest2.pdf");PDF_begin_page($pdf, 595, 842);$arial = PDF_findfont($pdf, "Courier", "iso8859-1", 0);PDF_setfont($pdf, $arial, 10);PDF_show_xy($pdf, "This is an exam of PDF Documents, It is a good Lib,",50, 750);PDF_show_xy($pdf, "If you like,please try yourself!", 50, 730);$tmpimgfile="D:\\pvf1\image1\aaa.jpg";$imgdata = implode('', file('D:\\code39.php'));PDF_create_pvf($pdf,$tmpimgfile, $imgdata, "");$img_id = pdf_load_image($pdf, "jpg", $tmpimgfile, "");PDF_place_image($pdf, $img_id, 50, 250, 0.25);PDF_delete_pvf($pdf,$tmpimgfile);//$image= PDF_open_image_file($pdf, "jpeg", "D:\\1.jpg","",0);//PDF_place_image($pdf, $image, 50, 50, 0.25);PDF_end_page($pdf);PDF_close($pdf);?> <?php$pdf = PDF_new();PDF_open_file($pdf, "D:\PDFTest2.pdf");PDF_begin_page($pdf, 595, 842);$arial = PDF_findfont($pdf, "Courier", "iso8859-1", 0);PDF_setfont($pdf, $arial, 10);PDF_show_xy($pdf, "This is an exam of PDF Documents, It is a good Lib,",50, 750);PDF_show_xy($pdf, "If you like,please try yourself!", 50, 730);$tmpimgfile="D:\\pvf1\image1\aaa.jpg";$imgdata = implode('', file('D:\\code39.php'));PDF_create_pvf($pdf,$tmpimgfile, $imgdata, "");$img_id = pdf_load_image($pdf, "jpg", $tmpimgfile, "");PDF_place_image($pdf, $img_id, 50, 250, 0.25);PDF_delete_pvf($pdf,$tmpimgfile);//$image= PDF_open_image_file($pdf, "jpeg", "D:\\1.jpg","",0);//PDF_place_image($pdf, $image, 50, 50, 0.25);PDF_end_page($pdf);PDF_close($pdf);?>'D:\\code39.php'就是我要显示在PDF上的条形码。 'D:\\code39.php'这个文件就是条形码字库。从网上下的。 <?session_cache_limiter('none');/*code39.php ver 1.10 (c)1999-2000 Y.SwetakeThis is a php3/4 script to create PNG image of barcode(code39).This program requires GD and PHP3/4. Useage in HTML <IMG SRC=code39.php?d=[hoge]&c=[0|1]>*/Header("Content-type: image/png");$d=$_GET["d"];$c=$_GET["c"];$qs=rawurldecode(strtr($d,"+"," "));$lx=strlen($qs);if ($lx<1){ exit;}$cc=array("0"=>52, "1"=>289,"2"=>97, "3"=>352,"4"=>49, "5"=>304,"6"=>112,"7"=>37,"8"=>292,"9"=>100,"A"=>265,"B"=>73, "C"=>328,"D"=>25, "E"=>280,"F"=>88,"G"=>13, "H"=>268,"I"=>76, "J"=>28, "K"=>259,"L"=>67, "M"=>322,"N"=>19,"O"=>274,"P"=>82, "Q"=>7, "R"=>262,"S"=>70, "T"=>22, "U"=>385,"V"=>193,"W"=>448,"X"=>145,"Y"=>400,"Z"=>208,"-"=>133,"."=>388," "=>196,"$"=>168,"/"=>162,"+"=>138, "%"=>42, "*"=>148);if ($c==1){ $ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; $l=0; $cd=0; while($l<$lx){ $cd+=strpos($ch,substr($qs,$l,1)); $l++; } $cd=($cd % 43); $s="*".$qs.substr($ch,$cd,1)."*"; $lx+=3;} else { $s="*".$qs."*"; $lx+=2;}$ww=2;$nw=0;$w=(($ww+1)*4+($nw+1)*6)*$lx+$ww;$ht=50;$im = imagecreate($w,$ht);$col[2]=ImageColorAllocate($im,0,0,0);$col[0]=ImageColorAllocate($im,255,255,255);$x=0;$l=0;while($l<$lx){ $cs=$cc[substr($s,$l,1)]; if ($cs==""){ imagedestroy($im); exit; } ImageFilledRectangle($im,$x,0,$x+$ww,$ht,$col[0]); $x=$x+$ww+1; $sn=1; $j=8; while($j>=0){ $p=(1 << $j); if ($cs>=$p){ $cs=$cs-$p; $bl=$ww; } else { $bl=$nw; } ImageFilledRectangle($im,$x,0,$x+$bl,$ht,$col[$sn+1]); $x=$x+$bl+1; $sn=-$sn; $j--; }$l++;}ImageFilledRectangle($im,$x,0,$w,$ht,$col[0]);ImagePng($im);Imagedestroy($im);?> To xuzuning:你好。你用MSN么?留个联系方式? To xuzuning: 你好。你用MSN么?留个联系方式 To xuzuning: 你好。你用MSN么?留个联系方式 求一正则表达式 无法存取$GLOBALS全局变量!在线等! 一个select下拉框,我想让他自动选中某值对应的,js怎么弄? 在线等,帮帮忙吧,高手们!!php与Mysql的问题 GD库画图的速度问题 想用php怎么编写超文本编辑器 如何获取客户端IP地址?(抱歉,我已经没有分给你们了) 求职:我是广州大学生,急求PHP工作增加经验,薪水多低也愿意 php插入数据到MySQL,中文乱码 thinkphp I方法读取不到值~~~ 请教在windows7下IIS7.5+PHP5.2+MSSQL的配置方法 请各位兄弟姐妹给点学php意见
你说的这个方法不行啊,我的总是和楼主的一样,刚才用7-zip解压的,还是没有"jpgraph_barcode.php"这个文件..顶!
解:这只是个文件名字而已,jpgraph_bar.php替换就是了。关键是实现功能。。
http://hem.bredband.net/aditus/chunkhtml/apg.htmljpgraph_barcode.php 只在专业版中有
http://www.google.cn/search?q=%E6%9D%A1%E7%A0%81%E5%AD%97%E5%BA%93&rls=com.microsoft:zh-cn:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7BJYT_zh-CN
那能下到jpgraph_barcode.php,这个文件吗。怎么得到专业版的?
另外条码字库的我也用过,用的是CODE39,不过只能显示在IE里,我现在想让条形码
显示在PDF中。
<?php
$pdf = PDF_new();
PDF_open_file($pdf, "D:\PDFTest2.pdf");
PDF_begin_page($pdf, 595, 842);
$arial = PDF_findfont($pdf, "Courier", "iso8859-1", 0);
PDF_setfont($pdf, $arial, 10);
PDF_show_xy($pdf, "This is an exam of PDF Documents, It is a good Lib,",50, 750);
PDF_show_xy($pdf, "If you like,please try yourself!", 50, 730);$tmpimgfile="D:\\pvf1\image1\aaa.jpg";
$imgdata = implode('', file('D:\\code39.php'));
PDF_create_pvf($pdf,$tmpimgfile, $imgdata, "");
$img_id = pdf_load_image($pdf, "jpg", $tmpimgfile, "");
PDF_place_image($pdf, $img_id, 50, 250, 0.25);
PDF_delete_pvf($pdf,$tmpimgfile);//$image= PDF_open_image_file($pdf, "jpeg", "D:\\1.jpg","",0);
//PDF_place_image($pdf, $image, 50, 50, 0.25);PDF_end_page($pdf);
PDF_close($pdf);
?>
<?php
$pdf = PDF_new();
PDF_open_file($pdf, "D:\PDFTest2.pdf");
PDF_begin_page($pdf, 595, 842);
$arial = PDF_findfont($pdf, "Courier", "iso8859-1", 0);
PDF_setfont($pdf, $arial, 10);
PDF_show_xy($pdf, "This is an exam of PDF Documents, It is a good Lib,",50, 750);
PDF_show_xy($pdf, "If you like,please try yourself!", 50, 730);$tmpimgfile="D:\\pvf1\image1\aaa.jpg";
$imgdata = implode('', file('D:\\code39.php'));
PDF_create_pvf($pdf,$tmpimgfile, $imgdata, "");
$img_id = pdf_load_image($pdf, "jpg", $tmpimgfile, "");
PDF_place_image($pdf, $img_id, 50, 250, 0.25);
PDF_delete_pvf($pdf,$tmpimgfile);//$image= PDF_open_image_file($pdf, "jpeg", "D:\\1.jpg","",0);
//PDF_place_image($pdf, $image, 50, 50, 0.25);PDF_end_page($pdf);
PDF_close($pdf);
?>
'D:\\code39.php'就是我要显示在PDF上的条形码。
这个文件就是条形码字库。从网上下的。
<?
session_cache_limiter('none');
/*
code39.php ver 1.10 (c)1999-2000 Y.SwetakeThis is a php3/4 script to create PNG image of barcode(code39).
This program requires GD and PHP3/4. Useage
in HTML <IMG SRC=code39.php?d=[hoge]&c=[0|1]>*/Header("Content-type: image/png");
$d=$_GET["d"];
$c=$_GET["c"];
$qs=rawurldecode(strtr($d,"+"," "));
$lx=strlen($qs);
if ($lx<1){
exit;
}$cc=array(
"0"=>52, "1"=>289,"2"=>97, "3"=>352,"4"=>49, "5"=>304,"6"=>112,"7"=>37,
"8"=>292,"9"=>100,"A"=>265,"B"=>73, "C"=>328,"D"=>25, "E"=>280,"F"=>88,
"G"=>13, "H"=>268,"I"=>76, "J"=>28, "K"=>259,"L"=>67, "M"=>322,"N"=>19,
"O"=>274,"P"=>82, "Q"=>7, "R"=>262,"S"=>70, "T"=>22, "U"=>385,"V"=>193,
"W"=>448,"X"=>145,"Y"=>400,"Z"=>208,"-"=>133,"."=>388," "=>196,"$"=>168,
"/"=>162,"+"=>138, "%"=>42, "*"=>148);if ($c==1){
$ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
$l=0;
$cd=0;
while($l<$lx){
$cd+=strpos($ch,substr($qs,$l,1));
$l++;
}
$cd=($cd % 43);
$s="*".$qs.substr($ch,$cd,1)."*";
$lx+=3;
} else {
$s="*".$qs."*";
$lx+=2;
}$ww=2;
$nw=0;
$w=(($ww+1)*4+($nw+1)*6)*$lx+$ww;
$ht=50;
$im = imagecreate($w,$ht);$col[2]=ImageColorAllocate($im,0,0,0);
$col[0]=ImageColorAllocate($im,255,255,255);$x=0;
$l=0;while($l<$lx){
$cs=$cc[substr($s,$l,1)]; if ($cs==""){
imagedestroy($im);
exit;
}
ImageFilledRectangle($im,$x,0,$x+$ww,$ht,$col[0]);
$x=$x+$ww+1;
$sn=1;
$j=8;
while($j>=0){
$p=(1 << $j);
if ($cs>=$p){
$cs=$cs-$p;
$bl=$ww;
} else {
$bl=$nw;
}
ImageFilledRectangle($im,$x,0,$x+$bl,$ht,$col[$sn+1]);
$x=$x+$bl+1;
$sn=-$sn;
$j--;
}
$l++;
}
ImageFilledRectangle($im,$x,0,$w,$ht,$col[0]);
ImagePng($im);
Imagedestroy($im);
?>
To xuzuning:
你好。你用MSN么?留个联系方式?
To xuzuning:
你好。你用MSN么?留个联系方式
你好。你用MSN么?留个联系方式