Giter VIP home page Giter VIP logo

html2pdf's Introduction

Html2Pdf

Html2Pdf is a HTML to PDF converter written in PHP, and compatible with PHP 5.6 to 8.2.

It allows the conversion of valid HTML in PDF format, to generate documents like invoices, documentation, ...

You have to write a code of HTML for Html2Pdf, and not try to convert directly an already existing html page.

Specific tags have been implemented, to adapt the html standard to a PDF usage.

You must use Composer to install this library.

It uses TCPDF for the PDF part.

Requirements

Html2Pdf works with PHP >5.6 and Composer.

You will also need at least the following php extensions:

  • gd
  • mbstring

Documentation

You will find the install documentation here.

You will find all the documentation here.

You will find lots of examples here.

Donate

You can support this project by making a donation.

Change log

See the ./CHANGELOG.md file.

Help & Support

For questions and bug reports, please use the GitHub issues page.

License

This program is distributed under the OSL License. For more information see the ./LICENSE.md file.

Copyright 2008-2023 by Laurent Minguet

html2pdf's People

Contributors

94noni avatar axi avatar berengan avatar coffeemedia avatar cwbudde avatar darius-heavy avatar divinity76 avatar f-houssait avatar fagundes avatar humancopy avatar interduo avatar jigneshsolanki avatar jjsty1e avatar juchi avatar littlebigfox avatar locojohn avatar marbetschar avatar mheesters avatar noxlux avatar ohda avatar oskarstark avatar pionell avatar pjona avatar punit5658 avatar quimcalpe avatar rubenharms avatar salemgolemugoo avatar spipu avatar szutkowski avatar tpohchai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html2pdf's Issues

i got this error in php 5.3.3

Fatal error: Can't inherit abstract function Spipu\Html2Pdf\Tag\TagInterface::getName() (previously declared abstract in Spipu\Html2Pdf\Tag\AbstractTag) in /var/www/ikoolclub.com/public_html/vkooladmin/html2pdf/src/Tag/AbstractTag.php on line 25

how to fix it thanks

Table Header is rendering twice on 1st time

After solved the issue #81 I got a new one,

The table header is rendering twice.

The HTML:

<page backtop="37mm" backbottom="0mm" backleft="0mm" backright="0mm" style="margin: 12mm;">
    <page_header style="width: 100%;">
        <table style="width: 100%;">
            <tr>
                <td style="text-align: center;  width: 19%">
                    <img src="{{img}}" width="52" style="margin: 2mm;" />
                </td>
                <td style="text-align: left; width: 81%;  padding: 1mm auto auto 1mm;">
                    {{client_name}}
                </td>
            </tr>
            <tr>
                <td>REQUERENTE:</td>
                <td>{{requerente}}</td>
            </tr>
            <tr>
                <td>PROCESSO:</td>
                <td>{{_numproc}}</td>
            </tr>
            <tr>
                <td>ASSUNTO:</td>
                <td>{{tipodescr}}</td>
            </tr>
        </table>
    </page_header>
    <h5>FICHA FINANCEIRA</h5>
    <table id="t1" style="width: 100%; font-size: 77.9%;" border="1">
        <thead>
            <tr>
                <th style="width: 15mm; text-align: center; " >Lançamento</th>
                <th style="width: 15mm; text-align: center;" >DAM</th>
                <th style="width: 16mm; text-align: center; ">Valor Documento</th>
                <th style="width: 14mm; text-align: center; ">Data Emissão</th>
                <th style="width: 14mm; text-align: center; ">Data Vencimento</th>
                <th style="width: 30mm; text-align: center; ">Classificação</th>
                <th style="width: 14mm; text-align: center; ">Data Pagamento</th>
                <th style="width: 16mm; text-align: center; ">Valor Pago</th>
                <th style="width: 15mm; text-align: center; ">Situação</th>
            </tr>
        </thead>
        <tbody>
            <tr  nobr="true">
                <td  style=" text-align: center; ">2665940</td>
                <td  style=" text-align: center; ">14688395</td>
                <td style=" text-align: right; ">364509</td>
                <td  style=" text-align: center; ">10/4/2015</td>
                <td  style=" text-align: center; ">21/7/2015</td>
                <td  style=" text-align: center; ">TAXA DE ARRECADAÇÃO</td>
                <td  style=" text-align: center; ">27/9/2015</td>
                <td style=" text-align: right; ">533300</td>
                <td  style=" text-align: center; ">ATIVO</td>
            </tr>
(...)
        </tbody>
    </table>
</page>

PHP Call:

<?php
 use Spipu\Html2Pdf\Html2Pdf;
 $orientation = 'P';
 $format = 'A4';
 $langue = 'en';
 $unicode = true;
 $encoding = 'UTF-8';
 $marges = array(12, 12, 12, 12);
 $html2pdf = new Html2Pdf($orientation, $format, $langue, $unicode, $encoding, $marges);
 $content = file_get_contents("page.html");
 $html2pdf->WriteHTML($content);
 $html2pdf->Output('processo' . $numproc . '.pdf');
?>

I'm not sure about whats happening.... I'm using the latest version of souce code and TCPDF.

Could someone help to solve it?

$kPathUrl not defined

Hello,

in tcpdfConfig.php, on line 66, $kPathUrl is set only if $_SERVER['HTTP_HOST'] is not empty.
then K_PATH_URL constant is defiened that way :
define('K_PATH_URL', $kPathUrl);
(line 80)

But $_SERVER['HTTP_HOST'] is not always set (during a CRON, for exemple), resulting in a notice :
PHP Notice: Undefined variable: kPathUrl in /var/www/sites/bazarchicv4/library/external/html2pdf/_class/tcpdfConfig.php on line 80

Question Installation

Hey,

I want to install HTML2PDF in my Website ... But I don't how to do it..
I have download the files by FTP.

And I have this error : "[ERROR] It seems that HTML2PDF dependencies are not installed... you must install thems with composer install"

I Know, I must install "composer" but how ? By SSH in my server ?

Thanks

Css Border:0; render a border.

Hello,
I do not know if it has to be considered as a problem but :

If i have border:0; in my css html2pdf draw a border on the styled block.
In a browser there isn't any border.
Finaly, I must set border:0px; (force unit) to do not draw a border.
Thanks.

Bullets not visible on Output to server

I have a strange one for you :-)

My pdf is happily displaying bullets (both UL and OL) when I output straight to the browser or as a download. The problem is when I save the pdf to the browser they disappear....! Can anyone help? I just noticed this and the project has to go live tomorrow afternoon!

Thanks in advance,

Will

Bootstrap css integration

Hi
First of all thank you so much for this nice package.
I want to say that I have a " dream " :D that soon, we can integrate bootstrap css ^^ this is very important for most apps web
Thanks :)))

hypenation

The hypenation is suported in html2pdf? If yes how is the function?
Thanks

The first page is blank and the printing starts from the second page !

Hi,
I'm using v4,
Why do I get the first page "blank" !?
Here my code :

<body>
<page backcolor="#FEFEFE" backtop="10mm" backbottom="30mm" footer="date;heure;page" style="font-size: 12pt">         
    <page_header>
        <table class="page_header">
            <tr>
                <td style="width: 100%; text-align: center">
                    <img src='{{asset('images/emec_logo.jpg')}}' alt='logo' style='width: 10mm'>                    
                </td>               
            </tr>
            <tr>
                <td style="width: 100%; text-align: center">
                <b>CONSORTIUM EMEC-ES</b>
                </td>
            </tr>
        </table>
    </page_header>
    <page_footer>
        <table class="page_footer">
            <tr>
                <td style="width: 100%; text-align: right">
                    page [[page_cu]]/[[page_nb]]
                </td>
            </tr>
        </table>
    </page_footer>      
</page>
<?php
$content = ob_get_clean(); 
$html2pdf = new \HTML2PDF('P', 'A4', 'fr', true);        
$html2pdf->writeHTML($content);
$html2pdf->Output('file.pdf');
?>
</body>

Genreated PDF different than viewed PDF

The forum is not working, so maybe some help here.

I am trying to generate a PDF, with ul li. I have the stlye="float:left" on the li objects. When rendering in the bowser ($llama->writeHTML($content,true);

The li objects stack the way I intended. When the PDF is generated, they do not stack, and it appears that the text is overwriting itself.

Any help would be greatly appreciated.

hyphenation

Hi
is the hypenation (plugin of fpdf) supported?
I tried with this code

$html2pdf = new HTML2PDF('P', 'A4', 'it', true, 'UTF-8',array(0,0,0,0));
$html2pdf->pdf->SetDisplayMode('fullpage');
$hyphen_patterns = $html2pdf->pdf->getHyphenPatternsFromTEX('hyphens/it.tex');
$content = $html2pdf->pdf->hyphenateText($content, $hyphen_patterns, array(), 1, 2, 1, 8);
$html2pdf->writeHTML($content);
$html2pdf->Output($allegato, 'F');

but not works

Thanks

Wrong width of <TD> when using border-collapse and a <div> element

Hi.
I have found a bug, when having a table with border-collapse: collapse and there is a

element in one of the cells.
You can reproduce the issue with this snippet:

<style type="text/css">
    table {border-collapse: collapse;}
    .table-bordered {border-width: 0.25mm; border-style: solid; border-color: #aaaaaa;}
</style>
<page backtop="5mm" backbottom="5mm" backleft="5mm" backright="5mm">
    <table>
        <tr>
            <th class="table-bordered" style="width: 20mm;">0 0</th>
            <th class="table-bordered" style="width: 21mm;">0 1</th>
            <th class="table-bordered" style="width: 22mm;">0 2</th>
        </tr>
        <tr>
            <td class="table-bordered"><div>1 0</div></td>
            <td class="table-bordered">1 1</td>
            <td class="table-bordered">1 2</td>
        </tr>
    </table>
</page>

The result of this code looks like this:
with-collapse
The first column is stretched over the whole page, because of the <div>element in the table cell.
But if you remove the table {border-collapse: collapse;} the table is rendered correctly. See:
without-collapse

I tried to debug the code and find out why this happens. But I was unsuccessful. So I hope you are more successful and can fix the issue @spipu ;-)

Allow to break line on table cells

I would like to propose a enhancement, if you allow me :bowtie:

There is a properties named word-wrap that works with word-break to break word preventing it to overflow the parent width, this property specifies line break opportunities within words.

For word-break Values have the following meanings:

  • normal : Break lines according to their usual rules.
<?php
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "<br />\n");
  • break-all: Lines may break between any two characters within words. Hyphenation is not applied. This option is used mostly in a context where the text is predominantly using CJK characters with few non-CJK excerpts and it is desired that the text be better distributed on each line.
<?php
$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "<br />\n", true);
  • keep-all: Lines may break only at word separators and other explicit break opportunities. Otherwise this option is equivalent to ‘normal’. This option is mostly used where the presence of word separator characters still creates line-breaking opportunities, as in Korean.
/**
* Based on @cmbuckley  original function I implemented a function to wrap my texts with line break,   
* in all cases this is the best function, fit the word base on width on the table cell. 
* When the word is  too long it will be break in a 2 lines also. 
* Similar of this style: `style="word-wrap: break-word;  word-break: break-all;"` 
**/

<?php
function smart_wordwrap($string, $width = 75, $break = "<br>") {
// split on problem words over the line length
        $pattern = sprintf('/([^ ]{%d,})/', $width);
        $output = '';
        $words = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);

        foreach ($words as $word) {
            // normal behaviour, rebuild the string
            if (false !== strpos($word, ' ')) {
                $output .= $word;
            } else {
                // work out how many characters would be on the current line
                $wrapped = explode($break, wordwrap($output, $width, $break));
                $count = $width - (strlen(end($wrapped)) % $width);

                // fill the current line and add a break
                $output .= substr($word, 0, $count) . $break;

                // wrap any remaining characters from the problem word
                $output .= wordwrap(substr($word, $count), $width, $break, true);
            }
        }

        // wrap the final output
        return wordwrap($output, $width, $break);
    }

The result into a table cell of this last is it:
capturar

But as I'm applying a fixed width it on original string not on text value of parsed on html2pdf class. It would be very useful if it respect the cell width(if defined) to break the words into lines to prevent table overflow.

TCPDF ERROR: Some data has already been output, can't send PDF file

Bonjour à tous,

merci de continuer à faire vivre ce projet, je ne connaissais pas du tout et après quelques recherches sur le net, je suis tombée dessus.

Quand j'essaie d'utiliser votre class, j'ai cette erreur :
TCPDF ERROR: Some data has already been output, can't send PDF file

Voici mon code :

$html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8');
$html2pdf->setDefaultFont('Helvetica');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($tpl);     // $tpl est ma chaine html
$html2pdf->Output('test.pdf');

J'utilise votre class sur un projet en local pour le moment avec Wamp. Une idée d'où ça peut venir ?
Merci.


When I try to use your class, I have this error :
TCPDF ERROR: Some data has already been output, can't send PDF file

Here is my code :

$html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8');
$html2pdf->setDefaultFont('Helvetica');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($tpl);     // $tpl is my html string
$html2pdf->Output('test.pdf');

I use your php class on a local project with Wamp. Any idea where it comes from ?
Thanks.

how to check if the pdf downloaded finish?

Hi, I use html2pdf and output as 'd' (i.e. $html2pdf->Output($diffname,'d');).
I want to add some alert/close the current after the download finish.
How can I check this?

how to attach with codeigniter email ?

i use pjmail in codeigniter but not working, may be problem with email config like smtp host..etc,

how to send html2pdf convert as attach in send mail codeigniter or may u want to tell me how to use pjmail in codeigniter.. thanks..

Table cellspacing to 0mm

My issue is about the cellspacing attribute set at "0" on table
The fact is there is always a thin space between cells...

I just try this on the last version (4.5.0), and the issue still exist.

Here is my sample html where you can see thin vertical and horizontal spaces :

<style type="text/css">
table td      { background: #DDDDDD; border: solid 0px #DDDDDD;height: 30px;}
</style>
<page>
    <table cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td style="width:150px;background: #DDDDDD;">Ceci est un</td>
            <td style="width:150px;background: #DDDDDD;" class="col1"><?php echo 'tést de style';?></td>
            <td style="width:150px;background: #DDDDDD;">Ceci est un</td>
        </tr>
        <tr>
            <td style="background: #FFFFFF;">Ceci est deux</td>
            <td style="background: #DDDDDD;" class="col1"><?php echo 'tést de style';?></td>
            <td style="background: #FFFFFF;">Ceci est un</td>
        </tr>
    </table>
</page>

regards

External Js

Hi,

how do we use external js( Jquery plugins ).

i have html page with javascript, highcharts, html, css but its not working with external js

any solution ..??

errors with some files inclusion

Trying to open test examples and get this errors:

Warning: require_once(/-----------/html2pdf/examples/../vendor/autoload.php) [function.require-once]: failed to open stream: No such file or directory

And then fatal error, of course
Where can i find this file?

table hold together on page break

Are there ways not to split tables on page break?
I create documents with many little tables out from a database. But some tables are splitting on page break. Is it possible to hold tables together?
Like this css: "page-break-inside: avoid"?

not working

hello, i just use html2pdf on my localhost. then open it in url localhost/html2pdf/example. then i click the qrcode.php. just show the php not directly show download message. the i tried to copy the url and paste it into the other browser and its directly show the download message. can you explain to me why?

page_header versus dynamic document

I have to create a dynamic document which is changed based on the data from my database. But this document only has a page header starting from the second page.

I wasn't capable of creating the HTML to solve that problem. Is that possible? How can I do that?

Right to left (RTL) support

Hi.

I’m developing for OpenEMR project. The project uses html2pdf library v.x.x.x to generate PDF from HTML.
I’m trying to fix their PDF report generation to generate right-to-left ( RTL ) documents correctly.
It seems there is a problem there.

$pdf = new HTML2PDF ($GLOBALS['pdf_layout'],
$GLOBALS['pdf_size'],
$GLOBALS['pdf_language'],
true, // default unicode setting is true
'UTF-8', // default encoding setting is UTF-8
array($GLOBALS['pdf_left_margin'],$GLOBALS['pdf_top_margin'],$GLOBALS['pdf_right_margin'],$GLOBALS['pdf_bottom_margin']) );

$pdf->pdf->setRTL(true);

$pdf->writeHTML($content, false);
if ($PDF_OUTPUT == 1) {

$pdf->Output('report.pdf', $GLOBALS['pdf_output']); // D = Download, I = Inline

}

Do you support RTL languages?
I don’t success to use with ‘setRTL’ method of TCPDF library.

Please let me knew about this.

Thank you.
Amiel.

Bump the PHP minimum version

In order to be able to get PSR4 we'll need to upgrade at least to PHP 5.3
Since the current minimum supported version of PHP is 5.5, we may also discuss which minimum version is more relevant.
As it's a breaking change, i think this should target the 5.0 release

Default font in HTML2PDF_parsingCss

Hi,

First merci for the HTML2PDF package.

I had a look at the source code and found out that the default font set in HTML2PDF_ParsingCss::initStyle() is set to 'Arial' at line 123, however, since HTML2PDF uses TCPDF, it is IMHO better to attempt to get the default value from the TCPDF constant PDF_FONT_NAME_MAIN, if it is set, e.g.:

--- _common/html2pdf/_class/parsingCss.class.php    (revision )
+++ _common/html2pdf/_class/parsingCss.class.php    (revision )
@@ -120,7 +120,7 @@
         $this->value['id_lst']           = array('*');   // tag - list of legacy
         $this->value['mini-size']        = 1.;           // specific size report for sup, sub
         $this->value['mini-decal']       = 0;            // specific position report for sup, sub
-        $this->value['font-family']      = 'Arial';
+        $this->value['font-family']      = defined('PDF_FONT_NAME_MAIN') ? PDF_FONT_NAME_MAIN : 'Arial';
         $this->value['font-bold']        = false;
         $this->value['font-italic']      = false;
         $this->value['font-underline']   = false;
\ No newline at end of file

Non-roman characters not displaying in page_header/page_footer tags

I am generating a document in several languages (including Japanese, Chinese, Korean, Thai, but also Greek, Polish and more). All characters display properly in the document except when they appear in page_header or page_footer tags, where they get replaced by question marks.
I've confirmed that these characters display properly when replacing <page_header> and <page_footer> tags with ordinary <div>s.

I've been trying to find a fix for this for hours with no success at all unfortunately.

Here is the code I'm using to initialize the library:
$pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(14, 14, 14, 12));
I'm using Arial Unicode MS to make sure that TCPDF uses the proper font, as described on several forums:
$pdf->setDefaultFont('arialunicid0');

As you can see on the screenshot below, all characters are properly displayed on the page, but not in the header.
japanese characters not displaying in header

Thanks for the great library by the way!

html table with 40'000 rows

I tried to use html2pdf.fr to create a pdf for a table with about 40'000 rows. Unfortunately it takes to much time. for about 1'000 Records I just have to wait about one minute and the CPU-load of the server is about 99%. Does anyone has an idea to perform the creation? The table is quite simple without any css.

background image

Hello,
How to add background image for generated PDF file?

Regards

<table> overflow's page break overlapping the page_header

Hi,
I'm trying to print a report on a table, but I'm geting some issues on

page break.

I have a default page header:
page_header

But when some table does not fit on the page, the page cells overlap the page header:
page_break

Page Code:

<page>
    <page_header style="width: 100%;">
        <table style="width: 100%;">
            <tr>
                <td style="text-align: center;  width: 19%">
                    <img src="{{img}}" width="52" style="margin: 2mm;" />
                </td>
                <td style="text-align: left; width: 69%;  padding: 1mm auto auto 1mm;">
                    Prefeitura Municipal de Nova Friburgo - RJ<br>SEMMADUS</td>
                <td  style="text-align: left; width: 12%; padding: 1mm auto auto 1mm;">
                    Folha:<br><br><br><br>
                </td>
            </tr>
            <tr>
                <td>REQUERENTE</td>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td>NRO. PROCESSO:</td>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td>ASSUNTO:</td>
                <td colspan="2"></td>
            </tr>
        </table>
    </page_header>
    <div style="position: relative;  page-break-before: right;  clear:both; margin-top: 35mm;">
        <h5>FICHA FINANCEIRA</h5>
        <table border="1" style="width: 100%; font-size: 75.7%;">
            <thead>
                <tr>
                    <th style=" text-align: left; " >Num.</th>
                    <th style=" text-align: left;" >DAM</th>
                    <th style=" text-align: center; ">Valor Documento</th>
                    <th style=" text-align: left; ">Data Emissão</th>
                    <th style=" text-align: left; ">Data Vencimento</th>
                    <th style=" text-align: left; ">Classificação</th>
                    <th style=" text-align: left; ">Data Pagamento</th>
                    <th style=" text-align: left; ">Valor Pago</th>
                    <th style=" text-align: left; ">Situação</th>
                </tr>
            </thead>
            <tbody>
                <tr nobr="true">
                    <td>2680313</td>
                    <td>15135325</td>
                    <td>999999.00</td>
                    <td>00/00/0000</td>
                    <td>00/00/0000</td>
                    <td>nono nono no no nono nono no</td>
                    <td>00/00/0000</td>
                    <td>999999.00</td>
                    <td>Cancelado</td>
                </tr>
                (.....)
                <tr nobr="true">
                    <td>2680313</td>
                    <td>15135325</td>
                    <td>999999.00</td>
                    <td>00/00/0000</td>
                    <td>00/00/0000</td>
                    <td>nono nono no no nono nono no</td>
                    <td>00/00/0000</td>
                    <td>999999.00</td>
                    <td>Cancelado</td>
                </tr>
            </tbody>
        </table>

    </div>
</page>

PHP Call:

<?php
 use Spipu\Html2Pdf\Html2Pdf;
 $orientation = 'P';
 $format = 'A4';
 $langue = 'en';
 $unicode = true;
 $encoding = 'UTF-8';
 $marges = array(12, 12, 12, 12);
 $html2pdf = new Html2Pdf($orientation, $format, $langue, $unicode, $encoding, $marges);
 $content = file_get_contents("page.html");
 $html2pdf->WriteHTML($content);
 $html2pdf->Output('processo' . $numproc . '.pdf');
?>

I tried to put a margin on table> instead page content but no success, when table creates a new header on the second page it doesn't respect the original table> margin.
I'm not sure, but I think it's a bug, because table overflows should respect the page_header and don't overlap.
Regards.

Image slowing too much PDF creation

With a JPG of 140k, one PDF of 12 pages is generate in 54s.

Without, the PDF is generate in 6s.

I try to check where this issue come from, i think it's from TCPDF (try with v5 to v6.2.11), but i'm not sure.

Allow to specify a fallback image if an image is not available

When an image is not available, it is currently replaced by a pink area.

It could be great to :

  • allow to specify the background color to use if no image is available
  • allow to specify a replacement image

This change will imply to update _drawImage and _drawRectangle methods.

use a variable with the Output command

I need to replace the hard code filename used in the Output command by a variable like $filename because the file name is never the same.
I tried the following two approaches but none is working:

$html2pdf->Output('$exemple.pdf','F');
or
$html2pdf->Output($exemple.pdf,'F');

Any idea ? Thank you very much in advance.

Install without Composer

Hi there,

I don't have server level access to the website I'm developing and I would like to know how to easily include HTML2PDF without the need of composer? Is there a fully extractable package that I can use?

Thanks,

Error with dependencies with 4.5.1 (but OK with 4.4.0)

Hi,
I have this error when I use HTM2PDF 4.5.1
[ERROR]
It seems that HTML2PDF dependencies are not installed...
you must install thems with composer install

When I replac with the previous version 4.4.0, everything is OK.
I m on a Debian 8 server, PHP 5.6.
Not a big deal ... it's just to let you know !

SVG parameter display="none"

Hello,
I am sorry, but forum is not online, so I will ask here:
is possible render PDF from SVG which contains multiple layers and a few has parameter display="none" ...? Will html2pdf accept such parameter?

Thank You

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.