Hi James:
There is a script called Labels.php taht allows you to print ANY label size
in mm. (French gave this idea, and we still stick to it ;-) . Also there's a
script to print these labels and (if I'm not wrong) it's quite ready to
print barcodes.
Regards,
Ricard
2011/3/25 Phil Daintree <phil@...>
> Hi James,
>
> Thanks for this. We actually already have a pile of barcode functionality
> bundled with TCPDF. I think it makes sense to use this on pdf barcodes there
> are some nice examples on the TCPDF docs website.
>
> Phil
> Phil Daintree
> Logicworks Ltd
> 0275 567890 <0275567890>
>
>
> -----Original message-----
>
> *From: *wertthey <wertthey@...>*
> To: *web-erp-developers@...*
> Sent: *Thu, 24 Mar 2011, 09:50:48 GMT+00:00*
> Subject: *Re: [WebERP-developers] Part Labels and bar codes.
>
> So I created a file and placed it in the webERP/PartLabel.php
>
>
>
> /* $Revision: 1.29 $ */
>
> $PageSecurity = 2;
>
> include('includes/session.inc');
> // jwp 01012008 for bar code
> // This code is Created for an Ideal DYMO 400 Label that is 2.25 inches x
> 1.25 inches .
> // Sorry to all you non USA people. The British gave us this system it was
> not my idea.
> // The barcode font only works in firefox. But it does work.
>
> include ('includes/bar128notxt.php');
> $title = _('PartLabel');
>
> $msg='';
>
> if (isset($_GET['StockID'])){ //The page is called with a StockID
> $_GET['StockID'] = trim(strtoupper($_GET['StockID']));
> $_POST['Select'] = trim(strtoupper($_GET['StockID']));
> }
>
> if (isset($_GET['NewSearch'])){
> unset($StockID);
> unset($_SESSION['SelectedStockItem']);
> unset($_POST['Select']);
> }
>
> if (!isset($_POST['PageOffset'])) {
> $_POST['PageOffset'] = 1;
> } else {
> if ($_POST['PageOffset']==0) {
> $_POST['PageOffset'] = 1;
> }
> }
>
> if( isset($_POST['StockCode']) ) {
> $_POST['StockCode'] = trim(strtoupper($_POST['StockCode']));
> }
>
> // Always show the search facilities
> // display list if there is more than one record
> // displays item options if there is one and only one selected
> If (!isset($_POST['Search']) AND (isset($_POST['Select']) OR
> isset($_SESSION['SelectedStockItem']))) {
>
> if (isset($_POST['Select'])){
> $_SESSION['SelectedStockItem']= $_POST['Select'];
> $StockID = $_POST['Select'];
> unset($_POST['Select']);
> } else {
> $StockID = $_SESSION['SelectedStockItem'];
> }
>
> $result = DB_query("SELECT stockmaster.description,
> stockmaster.mbflag,
> stockmaster.units,
>
> stockmaster.decimalplaces,
>
> stockmaster.controlled,
>
> stockmaster.serialised,
>
> stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS
> cost,
>
> stockmaster.discontinued,
> stockmaster.eoq,
> stockmaster.volume,
> stockmaster.kgs
> FROM stockmaster
> WHERE stockid='" . $StockID . "'",$db);
> $myrow = DB_fetch_array($result);
> $Its_A_Kitset_Assembly_Or_Dummy=False;
> $Its_A_Dummy=False;
> $Its_A_Kitset=False;
>
>
> echo '
>
>
>
>
>
>
> ' . $StockID . '
>
>
>
>
>
>
> ';
>
>
>
> //jpalof jwp 01012009 adding the image to the right
> side of the label
>
> if (function_exists('imagecreatefrompng')){
> $StockImgLink = '
> GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'.
> '&StockID='.urlencode($StockID).
> '&text='.
> '&width=80'.
> '&height=90'.
> ' ';
> } else {
> if( isset($StockID) and
> file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) {
> $StockImgLink = ' ' .
> $_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg ';
> } else {
> $StockImgLink = _('No Image');
> }
> }
>
> echo '
> '.$StockImgLink . '
>
>
>
>
>
>
>
>
>
> ' . $myrow['description'] . '
> ';
> echo
> '
>
> '.bar128($StockID). '
>
> ' ;
> echo '
>
>
> ';
>
>
>
> }// end displaying item options if there is one and only one record
>
> ?>
>
>
>
> Then in the SelectProduct.php I added in the Item Maintenance column a link
> called Part Label
>
> //jwp 12112008 Below adding the Tag to print part label
> // Around line 851
> echo ' ' . $rootpath . '/PartLabel.php? ' . _('Part Label') . '
> ';
>
> //jwp 12112008 Above adding the Tag to print part label
>
>
> and then add the file /webERP/includes/bar128notxt.php
>
>
>
>
>
>
> Code By Andrew Jackson
>
> Adapted From Dan Billeci
>
> dabilleci@...
>
> USAGE:
>
> echo bar128( "MyBarCode123" [,Height In Pixels] ); /// PRINTS HTML IMG
> TABLE OF THE CODE
>
> Info From: http://www.barcode-1.net/pub/russadam/128code.html
>
>
>
> *///Define Constants: height is a constant in div.b128 as height of bars
>
> ?>
>
>
>
>
>
>
> global $char128asc,$char128charWidth;
>
> $char128asc='
>
> !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
>
> $char128wid = array(
>
>
>
> '212222','222122','222221','121223','121322','131222','122213','122312','132212','221213',
> // 0-9
>
>
>
> '221312','231212','112232','122132','122231','113222','123122','123221','223211','221132',
> // 10-19
>
>
>
> '221231','213212','223112','312131','311222','321122','321221','312212','322112','322211',
> // 20-29
>
>
>
> '212123','212321','232121','111323','131123','131321','112313','132113','132311','211313',
> // 30-39
>
>
>
> '231113','231311','112133','112331','132131','113123','113321','133121','313121','211331',
> // 40-49
>
>
>
> '231131','213113','213311','213131','311123','311321','331121','312113','312311','332111',
> // 50-59
>
>
>
> '314111','221411','431111','111224','111422','121124','121421','141122','141221','112214',
> // 60-69
>
>
>
> '112412','122114','122411','142112','142211','241211','221114','413111','241112','134111',
> // 70-79
>
>
>
> '111242','121142','121241','114212','124112','124211','411212','421112','421211','212141',
> // 80-89
>
>
>
> '214121','412121','111143','111341','131141','114113','114311','411113','411311','113141',
> // 90-99
>
> '114131','311141','411131','211412','211214','211232','23311120'
> ); // 100-106
>
>
>
> ////Define Function
>
> function bar128($text) { //
> Part 1, make list of widths
>
> global $char128asc,$char128wid;
> $w = $char128wid[$sum = 104];
> // START symbol
>
> $onChar=1;
>
> for($x=0;$x<strlen($text);$x++)
> // GO THRU TEXT GET LETTERS
>
> if (!( ($pos = strpos($char128asc,$text[$x])) === false )){ // SKIP NOT
> FOUND CHARS
>
> $w.= $char128wid[$pos];
>
> $sum += $onChar++ * $pos;
>
> }
>
> $w.= $char128wid[ $sum % 103 ].$char128wid[106]; //Check
> Code, then END
>
>
> //Part 2, Write rows
>
> $html="<table cellpadding=0 cellspacing=0>
> ";
>
> for($x=0;$x<strlen($w);$x+=2)
> // code 128 widths: black border, then white space
>
> $html .= "<td>
> ";
>
> return "$html
> ";
>
> }
>
>
>
>
>
> This has worked out very well over the years. This is one of the reasons
> that we have added the image of the item to the SelectProduct.php page is
> so
> the shipping and receiving person can quickly verify a label if they have
> to
> reprint one.
>
>
> http://weberp-accounting.1478800.n4.nabble.com/Adding-Pictures-on-SelectProduct-php-inventory-page-td3396563.html
>
>
> Hope this helps out someone.
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://weberp-accounting.1478800.n4.nabble.com/Part-Labels-and-bar-codes-tp3401996p3402023.html
> Sent from the web-erp-developers mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Web-erp-developers mailing list
> Web-erp-developers@...
> https://lists.sourceforge.net/lists/listinfo/web-erp-developers
>
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Web-erp-developers mailing list
> Web-erp-developers@...
> https://lists.sourceforge.net/lists/listinfo/web-erp-developers
>
>
|