Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> html2pdf problem z drukowaniem tekstu <br/>
arbak
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 27.09.2006

Ostrzeżenie: (0%)
-----


  1. //description of object
  2. if ($_GET['mode']=="agent" && trim($rowtemplate['description_short'])!=""){
  3. //echo $rowtemplate['description_short'];exit();
  4. $rowobject['objectdescription'] = $rowtemplate['description_short'];
  5. $rowobject['objectdescription'] = strip_tags(trim($rowobject['objectdescription']),'<br><br /><p>');
  6.  
  7. }else{
  8. $query = "SELECT languageID,description
  9. FROM rental_object_description a, language b
  10. WHERE a.rentalObejctID = '".$objectid."'
  11. and a.languageID = b.ID
  12. and b.identifier ='".$lang."' ";
  13.  
  14. $result = $_DB->query($query);
  15. $rowobjectdescription=$result->fetchRow() ;
  16. $rowobject['objectdescription']=$rowobjectdescription['description'];
  17. //echo $rowobject['objectdescription']; exit();
  18. //$rowobject['objectdescription'] = htmlspecialchars_decode($rowobject['objectdescription']);
  19. $rowobject['objectdescription'] = html_entity_decode($rowobject['objectdescription']);
  20. //$rowobject['objectdescription'] = str_replace("<br />","",$rowobject['objectdescription']);
  21.  
  22. $rowobject['objectdescription'] = strip_tags(trim($rowobject['objectdescription']),'<br><br />');
  23.  
  24.  
  25.  
  26. if ($agentinfo['editor']=="1"){
  27. $rowobject['objectdescription'] = nl2br($rowobject['objectdescription']);
  28. }
  29.  
  30. }
  31.  
  32. $rowobject['furnished']= $pullDownListsObj->getPulldownListlabel(1145,$lang,$rowobject['furnished']);
  33. $rowobject['separateToilet']=$pullDownListsObj->getPulldownListlabel(114,$lang,$rowobject['separateToilet']);
  34.  
  35.  
  36. $rowobject['objectdescription'] = $this->convToUtf8($rowobject['objectdescription']);
  37. //echo $rowobject['objectdescription'];exit();
  38. $rowobject['housetype_env']=$housetype_env;
  39.  
  40. $rowobject['price']=number_format($rowobject['price'],0,",",".");
  41. $postalcode=str_replace(" ","",$rowobject['postalCode']);
  42.  
  43. $postalcode_number=substr($postalcode, 0,4);
  44. $postalcode_letters=substr(strtoupper($postalcode), -2);
  45. $rowobject['postalCode']=$postalcode_number." ".$postalcode_letters;
  46. //echo $rowobject['postalCode']; exit();
  47. //var_dump($rowobject);exit();
  48. $objTmplContent->assign( "DATA",$rowobject);
  49. //var_dump($rowobject);
  50. $filenamePDF=str_replace("+","_",urlencode(trim($rowobject['street']).$objectid)).".pdf";
  51. $objTmplContent->parse("content");
  52. $content=$objTmplContent->text("content");
  53. //echo $content;exit();
  54. // conversion HTML => PDF
  55. $html2pdf = new HTML2PDF('L',$lang);
  56.  
  57. if ($_GET['mode']=="agent"){
  58. $html2pdf->pdf->SetDisplayMode('fullpage');
  59.  
  60. }else{
  61. $html2pdf->pdf->SetDisplayMode('real');
  62.  
  63. }
  64. //$html2pdf->setModeDebug();
  65. $html2pdf->pdf->SetMargins(20,18);
  66. //$html2pdf->pdf->IncludeJS("print(true);");
  67. $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  68. $html2pdf->Output($filenamePDF);
  69. //}
  70. //catch(HTML2PDF_exception $e) { echo $e; }
  71. }else{
  72. echo "No PDF brochure";
  73. }
  74.  



  1. <table width="95%" cellpadding="3" cellspacing="3" style="page-break-after: always">
  2. <tr><td width="95%">
  3. <h3 style="padding:0;margin:7px 0 0 0;">{Description}:</h3>
  4. <div style="width:95%; page-break-before:always">{DATA.objectdescription}</div>
  5. </td></tr>
  6. </table>
  7.  
  8. </page>



Mam problem z <br/> w html2pdf napisałem to w sposób , który podaję powyżej ale wciąż otrzymuję błąd:

Fatal error: Uncaught <span style="color: #AA0000; font-weight: bold;">ERREUR n°7</span><br>Fichier : /var/www/vhosts/domena/httpdocs/library/html2pdf/html2pdf.class.php<br>Ligne : 5524<br><br>le contenu d'une balise TD ne rentre pas sur une seule page thrown in /var/www/vhosts/domena/httpdocs/library/html2pdf/html2pdf.class.php on line 5524



a gdy usunę fragment z '<br><br />' pdf działa ale nie tworzy tekstu od nowej linijki.

Jak w inny sposób zrobić break <br /> albo jak to naprawić?

Dzieki z góry za pomoc

Ok zamykam temat sprawa rozwiązana.
Pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.12.2025 - 22:03