dompdf render html codeigniter - php

i wanna render html page (using dompdf in CI) like this
but when i gererated, output to be
(http://i.stack.imgur.com/TNiHl.png)[second image]
before i edited, generating error error issue so i edited stylesheet.cls.php, but output as 2nd image...any idea...thanx

Related

Error generating docx with opentbs : the textbox tag disappear

I'm trying to use OpenTBS on my project to generate automatically a Resume using a word template (.docx)
the template contains multiple images for the frame of the template.
when I try to generate the file with my data, i noticed with the debug option that the opening tags disappear when I use block=tbs:row inside.
here is my php code :
$domains=array(
array('id1'=>"xxx",'id2'=>"xxx"),
array('id1'=>"yyyy",'id2'=>"yyyy"),
//...
);
$tbs->LoadTemplate('mytemplate.docx', OPENTBS_ALREADY_UTF8);
$tbs->MergeBlock('domain', $domains);
on my docx side :
[domain.id1;block=tbs:row] :
[domain.id2]
these tags are inside a table which is inside a textbox.
after 2 days debugging I realized that some opening textbox tags disappear on generation causing an xml parsing error opening the document
edit : After some other tests, it's when I use the block tag inside a textbox that the bug appears.
thanks for your help.
Matt.

Create PDF Laravel 5.5?

I want to create a pdf page from html file in Laravel but I do not know how to do it. You can help me
https://github.com/barryvdh/laravel-dompdf
// Import in top of controller file
use Barryvdh\DomPDF\Facade as PDF;
// use below code to generate and download pdf file
$pdf = PDF::loadView('bladefilename', ['arrayname' => $array]);
return $pdf->download('filename.pdf');
Write Above code in the controller file
In Blade file (HTML file) set array data.
Show Below Link : https://github.com/barryvdh/laravel-dompdf/issues/126
I know I am a little bit late but hopefully this will help someone.
There are 2 ways:
Create HTML page and use jspdf to print this page. The best way is to use html2pdf: https://github.com/eKoopmans/html2pdf.js
You can use this one to convert html to canvas and print to pdf. All css will be kept but you have to change the page to fix the space between pages as there may be some bad cut at the end of each page.
Print the page using latex. You have to use laravel latex compiler: https://github.com/fvhockney/latexcompiler
It is a little bit harder to styling the page but there is no problem with paging.

cakephp 3 and fpdf cannot render pdf in form of a view

**Controller** : Test
**View where the form resides** : index.ctp
**View containing fpdf code** : pdf.ctp
I generate a pdf file using FPDF but the pdf file is not rendering properly. I have confirmed that the FPDF code is error free.
On URL
localhost/project/test
I will fill up a form and press submit. This will submit to
localhost/project/test/pdf
But here the pdf is not rendering properly. It just keeps on telling Loading.
If i submit it to some other folder/pdf.php file (same fpdf code in php file)
Everything is ok
localhost/fpdf/pdf.php
I'm answering my questions myself. Come on people HELP ME!!
The problem was that the output was not rendering as pdf. I used this controller to solve my problem.
public function pdf()
{
$this->response->type('pdf');
}

Add page break in pdf generated using mpdf library

I'm using php library mpdf for generating pdf files from HTML content. For short paragraph text mpdf is working normally but when there is more than one page long content mpdf is generating pdf file within a single page with very small font. It doesn't worked when I gave sufficient font-size.
Is there any parameter that can be set for page break in mpdf ?
Please use <div> instead of using <table>. MPDF will shrink the content inside <tr> <td> to o

php file to pdf

I was converting a HTML file to PDF using dompdf. I managed to get the desired result but a problem arose, the HTML file needs to be converted to PHP because it will receive data from a form (from another file)!
The dompdf in this case doesn't work and it not shows the result of what was written in the form.
I think what you search is a template Engine to replace values in a HTML file.
There are some Engines like Smarty, TWIG.
You can parse your HTML file and with the HTML return you can create your PDF file.
Perhaps its a bit oversized for your case but you could build your own short engine and parse your HTML file and replace your specified Tags with the form values.
You can create your html file automaticaly in temp. After request to your php file, your file generates automaticaly a .html file (in temp), then create your pdf from this file.

Categories