Page 1 of 2

Blank pdf document generated

Posted: Wed Feb 13, 2008 4:58 pm
by zeebeest
Hi,

I just installed a clean version of 1.5.1 and I noticed that the pdf functionality is not working. I get a popup which is completely blank. I didn't experience this problem at all with the 1 series of Joomla.
There's no error message so I have no clue what to look for.

Does anybody know what could be the problem?

Chantal

Re: Blank pdf document generated

Posted: Thu Feb 14, 2008 3:51 am
by hewie
Hi Chantal,

I have exactly the same problem! Clean 1.5.1 install, everything looks OK, but the pdf button does not produce the expected result. The pop-up window is blank not even showing the Acrobat menu or any error message. That is no matter what template I choose. While having a seperate 1.0.14 intall in a second browser tab (IE7), there is no problem gererating a pdf pop-up with a click on the pdf button. So, IE7 configuration issues can be ruled out !? Strange...

But I noticed the following: if I right-click the pdf icon in the 1.5.1 install and choose either "Open Link", "Open Link in New Tab", or "Open Link in New Window" then the correct (small) pop-up window with the pdf (and Acrobat menu) is displayed.

Try it out and tell me if it works for you.
Hope some PHP guys can comment on this.

hewie

zeebeest wrote:Hi,

I just installed a clean version of 1.5.1 and I noticed that the pdf functionality is not working. I get a popup which is completely blank. I didn't experience this problem at all with the 1 series of Joomla.
There's no error message so I have no clue what to look for.

Does anybody know what could be the problem?

Chantal

Re: Blank pdf document generated

Posted: Thu Feb 14, 2008 4:27 pm
by zeebeest
Hi Hewie,

I'm using IE7 as well. If I right-click on the pdf icon and select open in new tab then I do get a pdf file :) :) . I think this is good news as at least the problem is not caused by some configuration issue of my hosting account :-). It's not workable though for visitors using IE7... :'(

I'll go and dive into the code to see if I can find something... ;D

Now that I've seen the pdf *yeah* I wonder why the footer/header doesn't contain the website address anymore like in the 1.0 versions. I guess this is something for a new topic. ;)

Chantal

Re: Blank pdf document generated

Posted: Fri Feb 15, 2008 3:26 pm
by diver165
Yeah there are issues with Joomla and IE7 handling the PDF window popup. Actually it doesn't do a popup period, it opens to a new tab when the button is clicked that is blank. The PDF button works in IE 7 is to right click it and open in new window or open in new tab.

Oh and a little test on my side, I get the same results in Opera v9.25. Seems to work OK in Safari and FF.

Re: Blank pdf document generated

Posted: Fri Feb 15, 2008 4:12 pm
by hewie
Yes, Firefox has no problem with opening the correct pdf pop-up. What I find strange is that I get different results with IE7, depending on what computer I use. On my desktop, IE7 opens the small pdf pop-up window no matter what "Open..." I choose in the right-click menu. On my laptop however the same procedure results in the opening of a new Tab or new complete browser window. Strange... ???

I noticed a post from Norway folks where they might have discussed the same issue. One poster mentioned to try out his 1.5.1 install because it is working just fine. Go to http://demo.joomlainorge.no/j15/ and try it out with your IE7! The pdf pop-up from this site works with my IE7.

The href command in the source code, especially the onclick handler, is not different from my own.

Code: Select all

<td align="right" width="100%" class="buttonheading">
	<a href="/j15/index.php?view=article;&catid=1:siste-nytt&id=1:velkommen-til-joomla&format=pdf" title="PDF" onclick="window.open(this.href,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'); return false;" rel="nofollow"><img src="/j15/images/M_images/pdf_button.png" alt="PDF"  /></a>	</td>
Any ideas how I can get this damn pdf button to work?

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 1:12 am
by tuvix72
Long time reader - first time poster here...

I've been battling with the same problem the last couple days! My server is a virtual machine (VMWare), W2K3, IIS6, PHP5.2.5 and I'm browsing with IE7... The server has 5 installations of Joomla, 4 of them are v1.5.0 and the PDF button is working fine. The fifth and latest installation is Joomla 1.5.1 and the pdf icon is behaving as described above, that is I get a blank popup when clicking on it normally while the pdf works fine if I open the link in a new window or tab.

I am going to try installing another 1.5.1 to see if I run into the same problem, if I do, I'll install 1.5.0 and see how that goes.

Thanks

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 2:14 am
by tuvix72
Just to confirm, I have reinstalled both 1.5.0 and 1.5.1 and I'm having no problems with 1.5.0, while the newer version is still not working for me...

If it helps I can post links to the two versions I just installed using the sample database and default template. Everything is identical except for the Joomla version.

Regards

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 2:47 pm
by gelauff
Not very elegant but it works:
Backup: components/com_content/helpers/icon.php
Then on line 58 replace:

Code: Select all

$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";
with:

Code: Select all

$attribs['target'] = "_blank";
This will give you a new browser window (in FF a new tab) in stead of a popup, gets you going for the time being.
Hopefully the Joomla team will find the real solution.

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 3:17 pm
by tuvix72
Beautiful! That worked just fine, thank you!!

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 4:22 pm
by zeebeest
Thank you :) :)

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 5:02 pm
by hewie
Interesting! That fix results in the original small pop-up window with the pdf for me (IE7). :o

That's great! Thanks to Grenoble.

Re: Blank pdf document generated

Posted: Tue Feb 19, 2008 5:15 pm
by tuvix72
hewie wrote:Interesting! That fix results in the original small pop-up window with the pdf for me (IE7). :o

That's great! Thanks to Grenoble.
On my end it's opening a new window in IE7 (has toolbars and such) while the original script was a popup without toolbars... As long as it works! ;D

Re: Blank pdf document generated

Posted: Wed Feb 20, 2008 6:44 am
by gelauff
hewie wrote:Interesting! That fix results in the original small pop-up window with the pdf for me (IE7). :o

That's great! Thanks to Grenoble.
A few lines above there are definitions for the popup window, which are appearantly read by your browser.
Strange thing indeed, but don't count on other IE7 versions to do the same thing.

My advice is to keep yourself informed of new updates, like I said, my solution is not very elegant.

Re: Blank pdf document generated

Posted: Wed Aug 06, 2008 8:47 pm
by Nibblers
I've got a solution to this (thanks to Ed)

You need a file:

Code: Select all

browser_detection.php 
I can send you this by e-mail. Please request at [email protected]

Extract and upload in to

Code: Select all

libraries/joomla/utilities/
Now find

Code: Select all

ICON.PHP
in

Code: Select all

components/com_content/helpers/
Place this

Code: Select all

require_once("libraries/joomla/utilities/browser_detection.php");
in line 2

Now change this line of code (line 58)

Code: Select all

$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; 


to this

Code: Select all

 
  $user_browser = browser_detection('browser');
      if ($user_browser == 'msie7') {
         $attribs['target'] = '_blank';
      } else {                     
         $attribs['onclick'] =
"window.open(this.href,'win2','".$status."'); return
false;";
      }
That should cure the problem!

Simon

Re: Blank pdf document generated

Posted: Thu Aug 07, 2008 7:58 am
by waader
I put my solution on the tracker a while ago: http://joomlacode.org/gf/project/joomla ... m_id=10656

It concers a change that was made between 1.5.0 and 1.5.1.

Re: Blank pdf document generated

Posted: Thu Aug 07, 2008 9:46 am
by Nibblers
Strange - I can clearly see the posted (simple) solution yet when I was searching for this very thing it failed to show (otherwise I'd have given it a go!). In my extensive 2 hour trawl looking for a solution it would seem many others have failed to find this thread as well. "Why are search engines not indexing keywords from the http://joomlacode.org tracker project??" I ask aloud.

Simon

Re: Blank pdf document generated

Posted: Thu Aug 07, 2008 11:01 am
by mtporter
wonderful!! works like a charm now!

replaced line 58 in icon.php to $attribs['target'] = "_blank";

wonderful
wonderful

works in FF and IE now.

Re: Blank pdf document generated

Posted: Sat Aug 30, 2008 10:28 pm
by leeuniverse
mtporter wrote:wonderful!! works like a charm now!

replaced line 58 in icon.php to $attribs['target'] = "_blank";

wonderful
wonderful

works in FF and IE now.
My IE6 using Maxthon classic wasn't able to open directly, it would open my Adobe and then simply give a message "cannot open file" or some such. IE6 by itself would simply open a save dialoge. Simply changing to the above in line 58 was simple and easy and works in my maxthon, ie6, netscape and firefox. Opera seems to not work any way. You can only right click and use Save As. And I don't have IE7 to test with yet.

I'm still curious however what the "consequences" might be, compared to this or using the code posted above by Nibblers or the fix on the Joomla Tracker page (link posted above), both of which I haven't tried yet. Anyone have any thoughts? By the way Nibblers, can't you upload your browser detection file as an attachment?

Re: Blank pdf document generated

Posted: Sat Aug 30, 2008 10:50 pm
by adamos46
I noticed after upgrading to 1.5.6 the pdf output shows blank pages. the [target] _blank didnt solve it. FF & IE7 show blank pages.

Re: Blank pdf document generated

Posted: Sat Aug 30, 2008 10:57 pm
by leeuniverse
Okay..... Further testing I've figured out what looks like the TRUE FIX for this issue across ALL BROWSERS on a fresh install of Joomla 1.5.6, SEO activated, and using eXtplorer extension to edit the files.

Per the fix listed at the above link (cudo's to the guy who found the fix), this is what needs to be done:

Go into "libraries\joomla\environment\response.php" at line 201, and this code is listed:
JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false );
Replace the above with these two lines:
JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate', true ); // Extra CYA
JResponse::setHeader( 'Cache-Control', 'post-check=0, pre-check=0', false ); // HTTP/1.1
This correction which is from a previous version (per the link above) causes the PDF to work correctly and consistently (according to the proper joomla behavior of opening the pdf) across ALL browsers that I listed above, even Opera works. This thus appears to be the correct fix. Of course, still don't know if it "really" is, why this was changed in later Joomla's. Maybe a mistake?

Re: Blank pdf document generated

Posted: Sat Aug 30, 2008 11:01 pm
by leeuniverse
adamos46 wrote:I noticed after upgrading to 1.5.6 the pdf output shows blank pages. the [target] _blank didnt solve it. FF & IE7 show blank pages.
hmmm.... My Firefox has alway's worked no matter which way, but not an upgraded Joomla, it's a fresh install.
However, try the above fix. This may fix everyone's problems, though your problem might be due to "upgrading"?

Re: Blank pdf document generated

Posted: Sun Aug 31, 2008 5:19 am
by adamos46
Still.. it doesn't work. print/email work fine. PDF output is blank.


-adam

Re: Blank pdf document generated

Posted: Sun Aug 31, 2008 5:53 am
by leeuniverse
Ya, don't know what to tell you then.... Working fine on my end. Do you have to anti-spyware popup blockers or anything running? Likely an obvious question, but who knows. Do you have Adobe installed? Try to do a fresh FULL install of 1.5.6 into another directory or domain or something and see what happens, to see if it's your upgrade or maybe something with your computer itself, or maybe even your webhosting. Maybe your permissions or webhosting is not properly set up? I use HostGator..... Do you have SEO activated?

Re: Blank pdf document generated

Posted: Sun Aug 31, 2008 3:37 pm
by adamos46
I manage my own servers. I have two servers running Joomla 1.5.6. Permissions are fine. They were working fine 2 weeks ago. I will do a fresh install on a testing server and see if that is gonna solve it.

Re: Blank pdf document generated

Posted: Tue Sep 02, 2008 6:58 pm
by Transonic
I have several sites that have been updated to 1.5.6. I tried your code and all of them work correctly when clicking the PDF icon for the first time! Thanks so much for your help. :)

Re: Blank pdf document generated

Posted: Tue Sep 02, 2008 7:39 pm
by adamos46
Damn it, I completely forgot. I had a new designer and I disabled cache on the testing servers. I enabled it and after 5 minutes it worked.

Thanks leeuniverse

-adam

Re: Blank pdf document generated

Posted: Wed Sep 03, 2008 1:20 am
by leeuniverse
Your welcome.... :) The real thanks however goes to the person in that one link that actually found the related solution.
But, it should have been on this forum already. Everyone should be having this issue.

Re: Blank pdf document generated

Posted: Wed Sep 03, 2008 2:06 am
by AbyssLLC
gelauff wrote:Not very elegant but it works:
Backup: components/com_content/helpers/icon.php
Then on line 58 replace:

Code: Select all

$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";
with:

Code: Select all

$attribs['target'] = "_blank";
This will give you a new browser window (in FF a new tab) in stead of a popup, gets you going for the time being.
Hopefully the Joomla team will find the real solution.
Thanks. The above simple change worked. I appreciate it. Have a great day! :D

Re: Blank pdf document generated

Posted: Wed Sep 03, 2008 4:40 am
by leeuniverse
Dear friend.... Don't use "that" fix, use the proper one I posted.
Should work for you anyway.

Re: Blank pdf document generated

Posted: Wed Sep 03, 2008 3:36 pm
by adamos46
leeuniverse: I dont know if you have this problem too but after the fix, when I click on the pdf it shows a blank screen. When I refresh, the pdf shows up ok. I tried to play with the cache and revalidate but it doesnt fix it.