Topic: Labels

The label option is not working.  When I click print nothing happens.  Any advice or fixes?  Thanks!

Here is the AJAX error I received: 


Error Type:   E_WARNING

Rendered Page:   Click here to view contents able to be rendered

Source File:   /home/adminchadwick/chadwick.k12.mo.us/tracmor/admin/labels.php     Line:   351

Line 346:                  if ($i < $this->lstLabelOffset->SelectedValue && $this->intCurrentBarCodeLabel == 0) {
Line 347:                    $arrTD[] = sprintf("<td width=\"%spx\" style=\"text-align:center\"><img src=\"../includes/php/tcpdf/images/_blank.png\" height=\"%s\" /></td>", $intCellWidth, $intImageHeight);
Line 348:                  }
Line 349:                  elseif ($this->intCurrentBarCodeLabel < $intBarCodeArrayCount) {
Line 350:                    $arrTD[] = sprintf("<td width=\"%spx\" style=\"text-align:center\"><img src=\"..%s/%s_%s.png\" height=\"%s\" border=\"0\" align=\"center\" /></td>", $intCellWidth, __TRACMOR_TMP__, $_SESSION['intUserAccountId'], $this->intCurrentBarCodeLabel+1, $intImageHeight);
Line 351:                     $image = ImageCreateFromPNG(sprintf("http://%s/includes/php/barcode.php?code=%s&encoding=128&scale=1", $_SERVER['SERVER_NAME'] . __SUBDIRECTORY__,  urlencode($this->strBarCodeArray[$this->intCurrentBarCodeLabel++])));
Line 352:   
Line 353:                     if ($this->lstLabelStock->SelectedValue != 1 ) {
Line 354:                      // Get image width
Line 355:                       $intImageSx = imagesx($image);
Line 356:                       // Get image height


Call Stack:

#0 (): QcodoHandleError()
#1 /home/adminchadwick/chadwick.k12.mo.us/tracmor/admin/labels.php(351): imagecreatefrompng()
#2 /home/adminchadwick/chadwick.k12.mo.us/tracmor/admin/labels.php(421): AdminLabelsForm->CreateTableByBarCodeArray()
#3 /home/adminchadwick/chadwick.k12.mo.us/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(657): AdminLabelsForm->btnPrint_Click()
#4 /home/adminchadwick/chadwick.k12.mo.us/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(774): QFormBase->TriggerMethod()
#5 /home/adminchadwick/chadwick.k12.mo.us/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(242): QFormBase->TriggerActions()
#6 /home/adminchadwick/chadwick.k12.mo.us/tracmor/admin/labels.php(524): QFormBase::Run()


Variable Dump:   Show/Hide

  _COOKIE
  _FILES
  _GET
  _POST
  _SERVER

Last edited by brilla (2009-06-16 09:01:01)

Re: Labels

Is this an upgrade or a new install of 0.2.0? 

Also,  does your web server have write permission on the tracmor/tmp directory?

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

It's an upgrade from 0.1.0.  Permissions are set to 755, write for owner.  Should I set them to write for all?

Re: Labels

Yes,  try setting to 777 and see if that allows you to generate labels.

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

Same error after setting to 777.  This is newest version of Firefox.  In IE8, nothing happens after selecting Print.

PHP Version:    5.2.6
MySql Version:    5.0.32
Qcodo Version:    0.3.32 (Qcodo Beta 3)
Build Date:    Mon Jun 15 23:24:41 PDT 2009

Last edited by farmeunit (2009-06-16 10:01:47)

Re: Labels

Looking more closely at the error you received,  I think your problem may be that you have not installed and/or enabled the GD library on your PHP installation.   Tracmor requires GD as stated on the download page

It should be easy to install.  On Fedora/RHEL/CentOS Linux distributions,  you would run:

yum install php-gd

On Debian-based distros (e.g. Ubuntu) you would run:

sudo apt-get install php5-gd

XAMPP based installs on Windows should have it enabled by default.

Just make sure to restart your web server after installing/enabling it.  Let us know if that solves the problem.

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

I look in PHP Information and it appears to be enabled.  This is the information there:
gd
GD Support     enabled
GD Version     bundled (2.0.34 compatible)
FreeType Support     enabled
FreeType Linkage     with freetype
FreeType Version     2.2.1
GIF Read Support     enabled
GIF Create Support     enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support     enabled
XBM Support     enabled

We're on a webhost, so I'll have to ask them to make any changes, but they're generally pretty helpful.  If you have any other ideas or need more information, let me know.

Re: Labels

We did upload a picture into an Asset, and it showed correctly.  Not sure if it's related to the same thing but thought I would let you know.  Thanks for all your help!

Re: Labels

Having the same exact issue. GD is installed, 777 permissions. Any more suggestions?

Re: Labels

I have an idea what the problem might be. I noticed the following in the imagecreatefrompng documentation:

A URL can be used as a filename with this function if the fopen wrappers have been enabled.

Please check your php.ini and make sure that the following is set:

allow_url_fopen = On
Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

jsinclair wrote:

I have an idea what the problem might be. I noticed the following in the imagecreatefrompng documentation:

A URL can be used as a filename with this function if the fopen wrappers have been enabled.

Please check your php.ini and make sure that the following is set:

allow_url_fopen = On

Thanks for looking but allow_url_fopen is set to on. If I manually go to that URL I get a bar code but the imagecreatefrompng function just eventually times out.  Other tidbits that might help: I'm running ubuntu server and and several apache2 named vhosts on the same server. I'll keep trying and report back If I figure it out.

Thanks again

Re: Labels

jsinclair wrote:

Please check your php.ini and make sure that the following is set:

allow_url_fopen = On

It is set to on.

Here is link to our PHPCore Information: http://www.chadwick.k12.mo.us/downloads … mation.doc

Re: Labels

Hi

I have the same problem, GD installed tmp dir 777, allow_url_fopen set to on. On Firefox before you get the error a popup box appear

"An error occurred during AJAX Response parsing."

"The error response will appear in a new popup."

When you click ok a new window appear with the mentioned error

Re: Labels

Hi

I found my problem. Make sure the .php files in the includes/php directory have executable writes (744).

Matt

Re: Labels

Same problem here. It consisted of two separate errors:

1. In line 351 of labels.php it uses $_SERVER['SERVER_NAME'] to construct the URL. This does not work if tracmor is not running on port 80.

2. The genbarcode executable is only shipped in versions for linux and windows. This does not work with another OS like Solaris.

Re: Labels

I'm getting the same error, and I've tried everything in this thread. Does anyone else still have this problem? Is there anything else I can try?

Re: Labels

What platform is your web server (Windows, Linux, other)? You should make sure that genbarcode is working on your server by running it from the command line (it's located in the includes/php directory). You should get the following output:

Genbarcode 0.4, Copyright (C) 2001,2002,2003 by Folke Ashberg
Genbarcode comes with ABSOLUTELY NO WARRANTY.

Usage: genbarcode <code> [<encoding>]

You can use the following types:
ANY    choose best-fit (default)
EAN    8 or 13 EAN-Code
UPC    12-digit EAN 
ISBN   isbn numbers (still EAN-13) 
39     code 39 
128    code 128 (a,b,c: autoselection) 
128C   code 128 (compact form for digits)
128B   code 128, full printable ascii 
I25    interleaved 2 of 5 (only digits) 
128RAW Raw code 128 (by Leonid A. Broukhis)
CBR    Codabar (by Leonid A. Broukhis) 
MSI    MSI (by Leonid A. Broukhis) 
PLS    Plessey (by Leonid A. Broukhis)
93     code 93 (by Nathan D. Holmes)

If the genbarcode included in tracmor isn't working on your platform, you can download the genbarcode source from  here and compile it yourself. Please let us know if that solves your problem.

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

I'm on a linux shared host...
PHP Version:    5.2.13
MySql Version:    5.0.90
Qcodo Version:    0.3.32 (Qcodo Beta 3)
Build Date:    Mon Jun 15 23:24:41 PDT 2009

What shell command do I use to test genbarcode? Also, if it's not running, is there a way for me to get it working on a shared environment?

Thanks for your help :-)

Re: Labels

Do you have access to the shell on your shared host? If so, go to your tracmor/includes/php directory and try to run genbarcode. Example (your directory structure may differ):

cd /var/www/tracmor/includes/php
./genbarcode

That should return the output I mentioned in my last post. If you get an error, then you probably need to compile genbarcode on whatever linux distro your shared host uses.

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

When I try to run it, it says permission denied (I do have ssh access to my host). Does that mean that it isn't installed on the server? Or that I just can't use it. Is it possible for me to set this up? Or will I need to ask my hosting provider to do it for me? I obviously don't have root access. Thanks for your help.

Re: Labels

You might be getting permission denied because the user you are logged into the shell with does not have sufficient privileges to run it. Or it could be that it is not set to be executable for some reason. You could try this from within the includes/php directory:

chmod +x genbarcode
Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

That was it! Thanks, sorry for taking up so much of your time for a permissions error lol. Thanks again!

Re: Labels

No problem at all. Glad you got it working.

Justin Sinclair

Got Inventory? Get Tracmor.

Re: Labels

I'm getting the same results as the OP. I've read through this thread and tried everything (I believe). I've adjusted the permissions to include/php, made sure GD is enabled, uncommented 'extension=php_GD2.dll' in my PHP.ini, and made sure 'allow_url_fopen = On' was uncommented.

However I do have SSL up, and it should be using port:443, however I dont think this is the problem right? I've tested it by using standard "http" (which is going through port 80), and I still get the same results as the OP.

Anything else I should try?

I apologize for reviving this thread

Last edited by Chan (2010-09-22 15:44:42)

Re: Labels

I'm also having trouble getting labels to print. On a shared host, without shell access. GD is installed, allow_url_fopen is on, tmp directory set to 777, and have set executable permissions on the php files in includes/php. Nothing. Anyone?

Last edited by Keith (2011-02-10 14:04:16)