From: Daintrees <p.d...@pa...> - 2004-10-15 18:35:55
|
Chris and I had a Skype text discussion on this yesterday and we thought = replacing the $_SESSION['PageSize'] with $_SESSION['DefaultPageSize'] = was the least pain fix. I have already done this in my development = version - although I don't think I committed it yet. There are only two = scripts to fix session.inc and PDFStarter_ros.inc The difficulty with changing the $PageSize variable is that every PDF = script would then have to change - there's quite a few of those. Phil ----- Original Message -----=20 From: skaill=20 To: web...@li...=20 Sent: Saturday, October 16, 2004 1:06 AM Subject: Re: [Web-erp-developers] PDFOrderStatus.php Change the lines at 112 and 113 ... $PageSize =3D array(0,0,$Page_Width,$Page_Height); $pdf =3D & new Cpdf($PageSize); to $PDFPageSize =3D array(0,0,$Page_Width,$Page_Height); $pdf =3D & new Cpdf($PDFPageSize); Basically change $PageSize to $PDFPageSize in these two lines. This = assumes the pdf class does not change PageSize which I'm fairly = confident is the case. Also, the switch assumes that $PageSize is always set with a legal = value. If it's possible for it not to be then there should be a default = case that will ensure the variables such as $Page_Width are set. The isset test and setting of $PageSize should be left as is to ensure = it is set the same as $_SESSION['PageSize'] for all versions and = settings. Especially php 4.2.3! Steve ----- Original Message -----=20 From: Chris Bice=20 To: web...@li...=20 Sent: Thursday, October 14, 2004 3:47 PM Subject: RE: [Web-erp-developers] PDFOrderStatus.php Well its quite simple, odd, but simple. =20 PDFStarter_ros.inc: Lines 25 - 27: =20 if (!isset($PageSize)){ $PageSize =3D $_SESSION['PageSize']; } =20 Basically, if you have not set the $PageSize Variable, it sets it to = your session variable. Which is fine the First time you print it. But = because of the following line 112: =20 $PageSize =3D array(0,0,$Page_Width,$Page_Height); =20 At this point, with RegisterGlobals on, it assumes $PageSize is the = same as $_SESSION[PageSize]. So when you set $PageSize to an array, it = throws off the whole equation, because earlier you are expecting a = String like "Letter" or "A4" or something to that effect. =20 Does that make sense?? =20 -----Original Message----- From: web...@li... = [mailto:web...@li...] On Behalf Of = Daintrees Sent: Thursday, October 14, 2004 2:04 PM To: web...@li... Subject: Re: [Web-erp-developers] PDFOrderStatus.php =20 I am not sure I understand this snag. I thought we could run with = register globals on or off. I need some help here Chris. I have come accross this complaint = about the small PDF box before - but I don't understand why. =20 Phil ----- Original Message -----=20 From: Chris Bice=20 To: web...@li...=20 Sent: Friday, October 15, 2004 3:16 AM Subject: RE: [Web-erp-developers] PDFOrderStatus.php =20 Ok. I found the issue. If you happen to have Register_Globals = =3D On in your PHP.INI file, within the PDFStarter_ros.inc file, around = line 112, it sets your $_SESSION[PageSize] from a string to an array. = Does it say anywhere in the installation, that you will need to be = required to have globals turned off?? If So, is there a way to operate = with Globals turned on? Looking for Compatibility Issues here . =20 Chris =20 -----Original Message----- From: web...@li... = [mailto:web...@li...] On Behalf Of = Chris Bice Sent: Thursday, October 14, 2004 9:00 AM To: web...@li... Subject: [Web-erp-developers] PDFOrderStatus.php =20 The First Time I ran this I got the report, a 14 Page PDF File = that looks outstanding. Great work for whoever created it. But when I = try to print it out again, no matter what I do I get this tiny blank = page in Acrobat Reader. Any Idea's as to what is going on? At first I = thought maybe it was a session error, but the more I think about it the = more I doubt that theory. |