Quantcast
Channel: All Discussions - mPDF Forum
Viewing all 108 articles
Browse latest View live

How to print Indian Rupee(₹) symbol in pdf using html?

$
0
0
Hi,
   Can anyone knows how to print indian rupee symbol using WriteHtml() method in mpdf?
        

PHP Strict Standards: Non-static method INDIC::_move_info_pos() should not be called statically

$
0
0
Hi
when you are generating pdf from html in indic (gujrati) this error occurs. The problem is mpdf sometime fails to process "raph" properly.
if you go through indic class and check _move_info_pos() method signature. you will see 

function  _move_info_pos(&$info, $from, $to) {
$t = array();
$t[0] = $info[$from];
if ($from > $to) {
array_splice($info, $from, 1);
array_splice($info, $to, 0, $t);
}
else {
array_splice($info, $to, 0, $t);
array_splice($info, $from, 1);
}
}  

this is not static but in code at 2-3 place its called as static and thats why it fails. what i did is just added static keyword in function signature and it works.

 
static function  _move_info_pos(&$info, $from, $to) {
$t = array();
$t[0] = $info[$from];
if ($from > $to) {
array_splice($info, $from, 1);
array_splice($info, $to, 0, $t);
}
else {
array_splice($info, $to, 0, $t);
array_splice($info, $from, 1);
}
}  

hope it will help someone too. :)

generating a pdf with generated text

$
0
0
hi forum,

new here, impressed by mpdf!

now i work on a page on which the text mainly is generated (by javascript) with text snippets from an other file (the page contains different text after each page load). consequently the html has mainly empty css tags, the rest is 'filled in' while loading the page.

now it seems not possible to include the actual text in a mPDF-generated pdf (as it reads only the initial html).

is there a work around; could mPDF generate a pdf including dynamically generated text???

thanks in advance!






Weird Floating Tables Bug

Volunteers for spam moderation?

Problem printing mixed portrait/landscape

$
0
0
Note, I am new to mPDF, so be gentle ...

I generate a new instance with $mpdf=new mPDF('c'); and then in a loop, pulling data from a mySQL database, use a series of $mpdf->WriteHTML() to generate an invoice for members of our co-op, with $mpdf->AddPage(); at the end of the iteration. In the loop I also add to a string variable a one-line summary of the invoice info. After the loop (which produces about 400 pages) I generate a new page in landscape with $mpdf->AddPage('L','','1'); (also resetting the line numbering, but not currently using it) and use $mpdf->WriteHTML($SummaryList); to add the summary info (about 12 pages) and finally $mpdf->Output();.

It is slow (about 5 minutes) but that is not the issue. The output looks fine in the browser (Firefox 39.0 on OS X 10.6.8) but if I print it the portrait pages are scaled down so that they are only occupying 70% (A5) of the A4 sheet. If I save the PDF as a file and print from Adobe, it prints properly. 

Is this an mPDF problem, and if so is there a solution?

Thanks.

Can you use mysql fetch() to print out results into a table?

$
0
0
This software is great and thank you for sharing it with us!

Ok I have a basic letter that I want to use my database results to feed in the data into a table at the bottom of my page. But I cant seem to get it to work. Is this possible using the software? or is it me :) my example is below

<?php

mysql query right here 
$html = 'html goodness and table creation';








while($row = mysql_fetch_array($res)){


$html .= '<td>'.$row['no1'].'</td><td>' . $row['no2']. '</td>'; }

$html .='end table and html';

include("../mpdf.php");


$mpdf=new mPDF(); 


$mpdf->WriteHTML($html);

$mpdf->Output();

exit;


Thanks in advance for your help




Multiple pdf documents

$
0
0
Hi,
Is there a way to generate multiple pdf files in a single submit.
For example: i want to generate identical pdf files and change only user name. So i made html form with textarea for users field (separate users with comma). After submit I explode them in an array and within foreach loop i call a function for creating pdf file for every user. Doesn't really work as I imagined; it creates the file for the first user only but it does call the function every time with different user as an argument.

Can anyone help me with this?
thx

How to switch off footers defined in CSS with @page?

$
0
0
Hi all,

When setting footers defined with @page for the whole document like this:

@page {

            odd-footer-name: html_footer-right;
            even-footer-name: html_footer-left;
            }

using the *-footer-value="-1" option for a pagebreak seems to have no effect:

<pagebreak odd-footer-value="-1" even-footer-value="-1" />

Is there a better way to switch off HTML footers for arbitrary pages? I'm also interested in optionally switching off footers for the <tocpagebreak>

Cheers!

Daniel

How to use Unicode font in the PDF

$
0
0
I am facing a problem while using unicode font in my pdf. Can you say me any parameters need to be passed to use the unicode or it is not supported by default..?

Error parsing image file

$
0
0
Hi i am using some images in my pdf but my images are not displayed. It is showing a 'X' with red bg. I have gone through the path and type of image. Everything is looking fine and when i use $mpdf->showImageErrors = true; the below error is displayed. 

Error parsing image file - image type not recognised, and not supported by GD imagecreate

I have gone through the forum with same questions but did not find the solution yet...

Page number removal

$
0
0
Hello All this is a great bit of software. Im trying to remove the page numbering on the bottom and I believe Im not doing it correctly. I have tried what is shown here http://mpdf1.com/manual/index.php?tid=109 and the page numbering still lives :) I will show code below

include("./MPDF57/mpdf.php");

$mpdf=new mPDF('win-1252','A4','','',20,15,48,25,10,10); 
$mpdf->setFooter(' ');
$mpdf->useOnlyCoreFonts = true;    // false is default

$mpdf->SetTitle("blank");
$mpdf->SetAuthor("Me");
$mpdf->SetWatermarkText("Paid");
$mpdf->showWatermarkText = false;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');


$html = 'Hello';
$mpdf->WriteHTML($html);
$mpdf->Output(); exit;

exit;

Integrating mPDF with Laravel 5

$
0
0
Hi, this will only be of relevence to those who use Laravel. I managed to be able to use mPDF within Laravel 4.2 relatively easily, but I'm having some problems with Laravel 5.

If guess this will probably be down to paths and namespaces, so I'll try and explain a little more.

I created a folder called 'libraries' within the main App folder and copied over the mPDF folder, so the mPDF library resides at 'App\libraries\Mpdf'.

Within my laravel app, I place "use App\libraries\Mpdf\mpdf ;" at the top of every file that calls mPDF.

I added the statement "namespace App\libraries\Mpdf;" at the top of mpdf.php, so I know that my Laravel 5 App is managing to call the mPDF class correctly.

However, it still keeps bombing out with:

production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function ReadCSS() on a non-object'

I suspect this is likely be a problem with pathnames, and may relate to _MPDF_PATH.

Has anyone else tried this and come accross anything similar ?

Thanks
Neil.

Fold marks on each page

$
0
0
I want to automatically output fold marks at the middle-left side of each page, but the header/footer ignores/hides my "position:absolute" divs:

<div style="position:absolute;left:0mm;top:87mm;width:10mm;height:0.1mm;background-color:#000000"></div>
<div style="position:absolute;left:0mm;bottom:105mm;width:10mm;height:0.1mm;background-color:#000000"></div>
<div style="position:absolute;left:0mm;top:148.5mm;width:15mm;height:0.1mm;background-color:#000000"></div>

What's the correct way to automatically repeat such exact positioned lines on each page? I'm using huge tables and automatic page breaks, so I can't output them manually.

Column Break Inside?

$
0
0
I am trying to apply a "column break inside" to keep a div element from being split up from the end of a column to the beginning of the next column (force all of it to go to the top of the next column).  

So far, I have tried all of these (and different combinations) with no luck...

page-break-inside: avoid;
break-inside: avoid-column
overflow: hidden
-webkit-column-break-inside: avoid
-moz-column-break-inside: avoid
-o-column-break-inside: avoid
-ms-column-break-inside: avoid

Is this possible with mPDF?

Position:absolute not working in the footer

$
0
0
Hello everyone, I tried to use the following code

<div style="position:absolute; bottom:25px; right:0px; width:40px; background-color:#1e82c0; color:white; padding:10px;"><b>XX</b></div>

In the body and I get the image below as expected (number of page in a blue box anchored to bottom right), but when I put the code in the SetHTMLFooter method I can't see anything.

How can I obtain the same result?

Thanks


image

Anchor link to jump in a section

$
0
0
Is there a way to create an anchor link to jump a given section created with: <bookmark content="Section X" />?

In HTML we can do it with an <a href="#Section2">Jump</a> and <div id="Section2">XXX</div>

Thanks

Table of contents - Is it possible to remove the dotted line?

$
0
0
Just wondered whether it was possible to remove the dotted line that gets created either via config or by CSS styling?

Thanks
Steve

Table of Content

$
0
0
Hi,
is there a different way to create a table of content.
I'm looking for a way to work with placeholder and combine them with the pdf page number at the end of html document via javascript or php.

maybe a GLOBAL property ....

something like:
$string = str_replace( "%%PAGENUMBER%%" , GLOBAL[ 'page' ] , $string );

php if statement

$
0
0
Hello everybody,
I´m learning mpdf and I found that I can not use IF statement in files where I generate mpdf. If I use the statemet mpdf simply do nothing. But If there is no if statement everything work correctly.

Can ou post me your experience ? Do you use If statement ?

Thank you

TOmas
Viewing all 108 articles
Browse latest View live