Jump to content
Sign in to follow this  
blecky

PDF data sheet maker / Browser Problem

Recommended Posts

I was able to install the contributiion and got it to work. It appears there is no Problem with Mozilla and MSIE, but the PDF Data sheet does not load if I use Opera. Meanwhile, I wrote a little script which uses the same library to parse my sales conditions and to create a pdf file and it turned out, the problem occurs, when the application_top.php is included. There must be something in that file or other scripts loaded by that file, which cause the problem.

 

:?: Has somebody else the same experience? and perhaps a solution for it?

 

rgds

Share this post


Link to post
Share on other sites

I use Opera (v6.05) for test purposes, and the data sheet works fine (like in IE 6.0, Netscape 7.0), the only thing I could say is File>Quick preferences>Enable pug-ins (but I bet you already did that).

Share this post


Link to post
Share on other sites

@ivan

 

If you refer to the preferences in Opera, yes, they are set. The mysterium is that the script I wrote works ok even in Opera. However, if I include application_top.php I get the same problem I have with the datasheet. I am using osCommerce 2.2MS1 with many additional contributions installed.... :(

Share this post


Link to post
Share on other sites

Ivan:

 

Yes, you visited the right site. In order to get it work, I changed the link in product_info.php - I don't use the tep_href_link function. If I use that function I get an error message, because the products_id variable is then empty and the script cannot find the image ....

 

I'm using the same Opera version you do. If I use the standard HTML link, nothing happens in Opera, MSIE and Mozilla work, although a customer reported he is not able to view the pdf datasheet with MSIE.

 

Obviously, the problem is caused by the empty variable. As said before, I wrote a script, which creates a pdf file for our sales and shipping terms. It is very simply - not as fas as complex as yours. Get the same results: If I use a HTML link it is loaded (in all browsers), if I use the tep_href_link function I get an error, because the image is not found. If you like, you can view it in the German version of the store. Just select AGB from the info box and the link to the pdf file is at the bottom of the return page. Or directly http://shop.laserpointer4u.de/catalog/agb.pdf?la=DE.

 

I am rather frustrated, because it should not be a big deal to add you contribution and now this.

 

Thanks for your help!

rgds

Share this post


Link to post
Share on other sites

Ivan:

 

I just installed Opera 7 on another computer and everything works fine. Must be something with this machine. Remains the tep_href_link issue.

 

rgds + thanks again.

Werner

Share this post


Link to post
Share on other sites

Hi Werner, the only thing I can recall about empty variable is that with MS1 the link should be :

<?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('pdf/pdf.gif') .'</a>'; ?>

with older snapshots :

<?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info_values['products_id']) .'" target="_self">' . tep_image('pdf/pdf.gif') .'</a>'; ?>

$product_info['products_id'] VS $product_info_values['products_id'], but in this case the variable would always be empty. Take a look at these FAQ from the FPDF site.

I like what you did w/ your "sales and shipping terms", why don't you post a contribution?

Share this post


Link to post
Share on other sites

Hi Ivan,

 

I use the correct link and it works, if I have "Use Save URL's" in the admin disabled, but it does not work if it is enabled (the variable $products_id remains empty). I was not yet able, to find out why.

 

 

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled

if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {

if (strlen(getenv('PATH_INFO')) > 1) {

$GET_arrays = array();

$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $HTTP_SERVER_VARS['PHP_SELF']);

$vars = explode('/', substr(getenv('PATH_INFO'), 1));

for ($i=0, $n=sizeof($vars); $i<$n; $i++) {

if (strpos($vars[$i], '[]')) {

$GET_arrays[substr($vars[$i], 0, -2)][] = $vars[$i+1];

} else {

$HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];

}

$i++;  

}

 

if (sizeof($GET_arrays) > 0) {

while (list($key, $value) = each($GET_arrays)) {

$HTTP_GET_VARS[$key] = $value;

}

}

}

} else {

$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

}

 

 

Re: my script

It is not final yet, I want to make it look better, like different font for the paragraph header. When it's done, I will give it to the community.

Share this post


Link to post
Share on other sites

Hi Werner,

try placing this after require('pdf/fpdf.php'); (line 14 or near) in pdf_datasheet_functions.php:

 if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {

     $products_id = substr (strrchr (getenv('PATH_INFO'), "/"), 1 );

 }

I tried w/ SE safe URLs in IE 6 NS 7 and Opera 6, it works so far but I think there's must be something to adjust ....

HTH

Share this post


Link to post
Share on other sites

Ivan:

 

That did it!! Works perfect now!! Tanks for your support! :lol: :lol:

 

Have a nice weekend!

 

rgds

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×