1

im developing a report from html to pdf and i found this application that was very greatfull...but now i have the problem when i write on my html many info (around 3-4 pages) internet explorer(v7) sent the msg (Internet Explorer Cannot Open the Internet Site) this is very frustating because i dont know if this solution have a character limit or what is happening i must to generate around 7 pages on pdf but now i have only 2..i reviewed all the scripts and i can not found any problem...can you sent me an easy solution i need it as soon as possible (its not a navigator problem because i delete some info and the html2pdf works fine.. but i write more html code again and sent this error)

2

I'm afraid that we won't be able to help you without any code example.

is your html code correct?

Can you try to add the html code to your page little by little, to locate the faulty code?

when found, post it, it will be more helpful for us to help you.

3

ok, thanks for the suggestion, ím verifying now.. i discover my mistake.. i tried to put only html code and all the information appears my problem is now with the info from mysql and php... im trying to made step by step...but maybe the trouble is that i have many variables do you have any document to verify how you made the consults??? and im asking if there will be not problem with many variables?

4

socotroco (./4) :
but maybe the trouble is that i have many variables do you have any document to verify how you made the consults???

not sure to understand this sentence...

and what variables are you considering?
if it's PHP variables, then I don't think PHP has a serious limitation with this, but we never know...

I think that you don't give enough technical information at all for us to be of any help.

Please give numbers, post code examples, etc.

5

it could also be a pb of memory limit : when php has a error of memory limit, it just send a blank page to the client... no error appear ! try to increase the setting of memory_limit in php.ini
Ancien pseudo : lolo

6

I'm having a similar problem which only occurs in Internet Explorer (6 & 7), everything works fine in Firefox. Internet Explorer 6 and 7 will only create pdf up to 2 pages. On a four page pdf Firefox will output fine, IE 7 gives a 'Cannot find server' error and IE 6 doesn't even attempt to load it. If Firefox isn't having any problems then I wouldn't have thought memory_limit is the cause?? Current memory_limit in php.ini is 16M

Here is my code:

	
	 //get posted values
  $refno = $_GET['refno'];
  $instructno = $_GET['instructno'];
  $date = $_GET['date'];
  $address = $_GET['address'];
	if($instructno){
	  $documentname = $instructno.'.pdf';
	}else{
	  $documentname = 'photosheet.pdf';
	}
 	ob_start();
	
 	include('photosheet.php');
	$content = ob_get_clean();
  
	// conversion HTML => PDF
	require_once('html2pdf.class.php');
	$html2pdf = new HTML2PDF('P','A4', 'en');
	$html2pdf->WriteHTML($content);
	$html2pdf->Output($documentname); 


and code for photosheet.php is:

page backtop="15mm" backbottom="10mm">
	<page_header>
		<table style="width: 90%; border:none;"  align="center">
			<tr>	
			  <td style="width:20%;"></td>			
				<td  style="text-align: center; width: 60%; font-size: 24px; border: solid 1px black;" >Company name</td>		
				<td style="width:20%;"></td>		
			</tr>
			<tr>
			  <td style="text-align: left;">Reference No: <?php echo $refno; ?></td>
				<td style="text-align: center;">Instruction No: <?php echo $instructno; ?></td>
				<td style="text-align: right;">Date: <?php echo $date; ?></td>
			</tr>
		</table>
	</page_header>
	
	<page_footer>
		<table style="width: 90%; border:none"  align="center">
			<tr>
				<td style="text-align: left;	width: 10%; height:7mm;">Property</td>
				<td style="text-align: center;	width: 90%; border: solid 1px black;"><?php echo $address; ?></td>
			</tr>
		</table>
	</page_footer>
	
	<table style="width: 90%;border: solid 1px #000000; border-collapse: collapse" align="center">
<?php 

 foreach ($_REQUEST as $key=>$value) {
    if (is_array($value)) {
		   $n=0;
			 $i=0;
			 $lastkey = end(array_keys($value));
		 while($i < ($lastkey+1)){
			$img =$value[$i];
	 if	(isset($img)){
   if(!($n&1)){
?>
	  <tr>
			<td style="width: 50%; text-align: center; border: solid 1px #000000; height:62mm;">
			  <?php  
				 echo '<img src="'.$img.'" style="width:90%" />';	
				 $n=$n+1;
				echo '</td>';
  }else{   ?>
       <td style="width: 50%; text-align: center; border: solid 1px #000000; height:62mm;">
			  <?php  
				 echo '<img src="'.$img.'" style="width:90%" />';	
				 $n=$n+1;	
				echo '</td></tr>';
     }
       }else{
       //if the image isn't ticked do nothing
      } 
			$i=$i+1;  
     } //close for loop		
    }  //close if array loop 
		} //close while loop
if($n&1){ ?>
		   <td style="width: 50%; text-align: center; border: solid 1px #000000; height:62mm;">&nbsp; </td></tr>	
<?php   }
?>
	</table>
	</page> 



(I'm using v3.20 and PHP5)

7

it works on FF but not width IE6 and IE7 ?! with exactly the same pdf, the same URL ?

does it already crash if you increase the memory_limit to 32Mo ?
Ancien pseudo : lolo

8

Yes it works on FF but not with IE6 or IE7 with exactly the same pdf and the same URL.

The hosting company this site is on charges to increase the memory_limit so I don't want to do this unless I'm sure it's the problem and if it's working in FF could this really be the problem?

I've set up a test page you can look at if want to see what happens with the different browsers. There is a link to a 2 page pdf and a link to a 4 page pdf. Clicking 'Print Photo Sheet' produces the pdf. (Having now set it up to open the pdf in a new window, I'm getting an Error No 6 in IE, rather than the Cannot find server or nothing at all that I was getting before). Most of the images are around 50kb or less, so I can't see that the number of images could be causing the problem?

http://www.genmaint.co.uk/pages/test.php

9

the pb is maybe the length of the URL !

try to use POST and not GET method in your form wink
Ancien pseudo : lolo

10

I hadn't thought about that. Did a quick google search and I think you might be right. I'll give it a go later on and let you know how I get on.

11

Well changing from GET to POST method has solved the problem.

Thank you Spipu!

12

you are welcome wink
Ancien pseudo : lolo