I have to generate a PDF document that could take more than one page. Each page has a html table (that has a variable length), and a QR code at the bottom of the page.
The QR code will be at the bottom of every page of the document, but, if that is too difficult to achieve, I can have it only in first page.
I have the problem that the text of the html table is printing over the QR code. I tried using $pdf->setPageRegions without any positive result, because the coordinates used to define the position of QRCode and for setRegions are in different units.
How can I achieve this?
Related
So I have an html document which I am writing inside a long string called $content. I am supposed to pass this string to a pdf builder object to print it as a pdf file.
Only problem is the pdf file has a line at the bottom that interferes with my cotent when it reaches the bottom of the page like this table
As you can see the pdf footer line crosses my table and I don't want this to happen. I want to somehow predict if this line is going to cross and then print the whole crossed content in another pdf page.
Well, I was able to generate a QR code (dynamically) using http://phpqrcode.sourceforge.net/ API.Now, I am stuck with another requirement where I need to add some text beside or below the image, describing the use of this QR code like say "SCAN ME for more offers!!". I wish to add company logo on that text too.
Is there an way to do, beside image manipulation api in PHP?
If you are displaying the QR codes on a web page, just add another div with the logo and or text. If your goal is to produce a single image you can download and you want to produce it from your script you can use http://image.intervention.io/
It is still an API based implementation. If you can clarify what you want to avoid and why and your end case I might be able to offer some other suggestions.
I am using mPDF to generate PDF files from form submissions.
The script is going through all questions and creating a HTML fieldset for each containing the question and the answers.
Since the survey is quite long, the generated PDF spans over several pages which works fine. Now, the client wants "nice & pretty" PDF files, where a fieldset does not contain a page break.
From this question, I know I can determine the remaining space of a page during the generation process.
Now the question is, how can I determine the height of the fieldset coming up next in order to decide whether or not I have to add a page break first?
Is there a function, which just renders a specific part of HTML as a PDF and returns the final height?
I am using TCPDF to create PDFs with PHP. Everything works very nice, except when text would be placed where the footer resides. In my example, the text is shown only half, the rest is behind the footer. Is there an option which defines to put it on the next page?
Besides that, my PDFs differ from print to print, some have 1 page, some 2 or more. Is it possible to say that a specific text should only be placed on the page when it fits completely? if not, it should go to the next page.
I already have this in my code, but it doesnt help, the text is still cut.
$pdf->SetAutoPageBreak(true, 25);
I am creating the PDF by creating a huge HTML string and print that to the PDF using writeHTML. This is how it looks, the bold text on top should go to the next page, its hidden behind the footer.
Thanks!
I have a php page that generates a pdf using mpdf (php to pdf).. So when the users goes to this page the pdf is generated.. I have decided that rather then output the pdf to the browser I will email it to them.. That is all fine and works great.. So at the end of the pdf generating code I put the code for the html page to show.. Like a brand new page.. All works perfectly except for in IE.. where the layout is all messed up.. BUT if I put the html code before the pdf generating code it all looks fine.. and if I put the html in its own page it all looks fine.. Something in the pdf generating code is messing with IE..
So question is.. What about if I link the pdf generating page to the html page..
ie have two pages.. one php page with the html code saying what I want displayed.... and then link to the pdf generating code.. like include("pdfpage.php"); Include won't work, but anything else? Function?
Ideas? Stuck.
Thank you
You might try to wrap your PDF generation code up and try to not let it interfere with your HTML page.
A starting point is ob_start(). You can start an output buffer before generating your PDF
. That captures any output your PDF generation code might produce. You can then have a look at it, dispose of it or do whatever you like with it.
That way, no left-overs will be interfering with your HTML page.