Code Monkey home page Code Monkey logo

Comments (6)

ssieb avatar ssieb commented on July 4, 2024

If that's actually a full php example, you need to mark it as code so it doesn't get interpreted:

```
code here
```

from mpdf.

carloscodde avatar carloscodde commented on July 4, 2024

Si en realidad se trata de un ejemplo completo de PHP, debes marcarlo como código para que no se interprete:

<p><b style="font-size: 0.73rem;"><u><br></u></b></p><p><b style="font-size: 0.73rem;"><u><br></u></b></p><p><b style="font-size: 0.73rem;"><u>test</u></b><br></p><table border="0" cellpadding="0" cellspacing="0" width="662" style="width: 498pt;">
<colgroup><col width="63" style="mso-width-source:userset;mso-width-alt:2304;width:47pt">
<col width="64" span="5" style="width:48pt">
<col width="57" style="mso-width-source:userset;mso-width-alt:2084;width:43pt">
<col width="74" span="3" style="mso-width-source:userset;mso-width-alt:2706;
width:56pt">
</colgroup><tbody><tr height="20" style="mso-height-source:userset;height:15.6pt">
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.6pt;
 width:498pt">1. Entrega del servicio 1.</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.0pt;
 width:498pt">2. Entrega del servicio 2.</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.0pt;
 width:498pt">3. Entrega del servicio 3</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;
 width:498pt">- titulo</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;
 width:498pt">- requerimiento 1</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;
 width:498pt">- requerimiento 2</td>
</tr>
<tr height="20" style="height:15.0pt">
 <td height="20" class="xl66" colspan="10" style="height:15.0pt;mso-ignore:colspan">- requerimiento 3</td>
</tr>
<tr height="18" style="mso-height-source:userset;height:14.1pt">
 <td height="18" class="xl65" width="63" style="height:14.1pt;width:47pt"><br></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="57" style="width:43pt"></td><td class="xl65" width="74" style="width:56pt"></td><td class="xl65" width="74" style="width:56pt"></td><td class="xl65" width="74" style="width:56pt"></td></tr>
<tr height="20" style="height:15.0pt">
</tr>
<tr height="19" style="mso-height-source:userset;height:14.45pt">
</tr></tbody></table><p><br></p><p style="text-align: center; "><b>TEST TEST TEST.</b></p><p style="text-align: center; "><b><br></b></p>

ready

from mpdf.

ssieb avatar ssieb commented on July 4, 2024

Can you make a minimal example including php?
Also, that html is not really valid, but it looks like it's coming from a Microsoft product, so that's not really surprising.

from mpdf.

carloscodde avatar carloscodde commented on July 4, 2024

Here is the example: It appears that removing the init_set commands allows for a preview, but this was not the case with older versions. Additionally, the format looks completely different. Finally, it still points to an undefined variable in the MPDF class.

<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

require_once '../../lib/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();

$html = '<p><u><br></u></p><p><u><br></u></p><p><u>Notas importantes respecto al servicio</u><br></p><table border="0" cellpadding="0" cellspacing="0" width="662" style="width: 498pt;"><br />
<br />
<br />
<br />
<br />
<tbody><tr height="20" style="mso-height-source:userset;height:15.6pt"><br />
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.6pt;<br />
 width:498pt">1. Entrega del servicio: a coordinar.</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.0pt;<br />
 width:498pt">2. Los trabajos están cotizados para ejecutarse de lunes a<br />
 viernes en horario de 08:30 a 17:30 hrs.</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td colspan="10" height="20" class="xl69" width="662" style="height:15.0pt;<br />
 width:498pt">3. Por parte del cliente:</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;<br />
 width:498pt">- Estacionamiento para nuestro camión o vehículo de laboratorio.</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;<br />
 width:498pt">- Contar con los servicios de higiene básicos (baño, agua<br />
 potable) para nuestros técnicos.</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td colspan="10" height="20" class="xl70" width="662" style="height:15.0pt;<br />
 width:498pt">- Disponibilidad total de la(s) balanza(s).</td><br />
</tr><br />
<tr height="20" style="height:15.0pt"><br />
 <td height="20" class="xl66" colspan="10" style="height:15.0pt;mso-ignore:colspan">-<br />
 Tener grúa horquilla para el traslado de masas patrones y operario de ésta,<br />
 en el caso de plataformas.</td><br />
</tr><br />
<tr height="18" style="mso-height-source:userset;height:14.1pt"><br />
 <td height="18" class="xl65" width="63" style="height:14.1pt;width:47pt"><br></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="64" style="width:48pt"></td><td class="xl65" width="57" style="width:43pt"></td><td class="xl65" width="74" style="width:56pt"></td><td class="xl65" width="74" style="width:56pt"></td><td class="xl65" width="74" style="width:56pt"></td></tr><br />
<tr height="20" style="height:15.0pt"><br />
</tr><br />
<tr height="19" style="mso-height-source:userset;height:14.45pt"><br />
</tr></tbody></table><p><br></p><p style="text-align: center; ">EN EL CASO EVENTUAL QUE EL EQUIPO NO SUPERE LAS PRUEBAS DE CALIBRACIÓN, ESTO NO ES RESPONSABILIDAD DEL LABORATORIO DE METROLOGiA COVERY S.A. Y LOS TRABAJOS SERÁN FACTURADOS DE ACUERDO A LOS VALORES COTIZADOS.</p><p style="text-align: center; "><br></p>';


$mpdf->writeHTML($html);

$mpdf->Output('test.pdf', 'I');

from mpdf.

ssieb avatar ssieb commented on July 4, 2024

Can you make a minimal example? It appears to be something with the <br> tag, so find out which one it is.

from mpdf.

finwe avatar finwe commented on July 4, 2024

Your line breaks in the "full" example code between <table and <tbody or between tr tags don't make sense. You even have br tags inside other HTML tag parameters. Use well-formed HTML and the error should not appear (as it does not with your previous HTML code examples).

Closing as "unable to reproduce", can reopen with more concise code example previewing the error.

from mpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.