I am using fpdf.php to export the PDF document from PHP. I'm still facing the problem that I couldn't export flash content in to the PDF
What do you mean by flash content? You should separate data generating code from data displaying code, so you can write two components for displaying data: one for flash and one for pdf.
If you mean to take a .swf file and convert it into a PDF then you will need to find a different solution since the fpdpf.php library, since it doesn't support converting .swf files into PDFs.
Related
I have generated an E-bill using html, css, bootstrap and php. Is there any way I can get it directly into PDF format (easily downloadable format)?
What all I could find was creating pdf using the code(FPDF etc). But that's not what I want. I already have the e-slip structure ready.
Thanks
Is there a way in PHP that can open remote PDF file, searching for specific text, replace it with new one & save the modified PDF file on the server?
Thanks
You can use a combination of tools or just one of them. Depends on how complex the file is and how much noise either of these generates.
DomPDF - converts HTML to PDF.
TCPDF - creates PDF files.
FPDI - uses already existing PDF files.
My personal recommendation would be to go for FPDI.
After many days of research, there is no plugin can extract pdf data from 'extraction protected' PDF.
I am working with a tool which lets user upload a .csv file.
That csv file contains an address column. I have to use the address from each row in another HTML template. That HTML template is like this
. After creating that template I then need to convert it into a PDF, store the PDF on a file server and give the user a link to the PDF.
I've finished the first two steps - csv upload and created complete template with address, but I'm stuck on how I can convert a template into a PDF.
I have looked into a few php-pdf libraries like fpdf mpdf. I'm facing a problem in creating pdf with html template.
A link to a library wich convert HTML to PDF and works pretty well.
First the link to the library
HTML2PDF
Then some code* to create your PDF using your own generated HTML, where $content is your HTML string.
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf');
*Code taken from the "example page" of the site.
I have used tcpdf in many cases, https://tcpdf.org/
Works well with tables, I have made receipts and accounting related stuff with it. Handle UTF-8 without problems, why it's my way to go.
Only downside is that code is bit long and complicated and it doesn't keep tables as tables in pdf and turns them to divs, so paddings and other styles might be bit trickier to do.
One way is to use webkit based HTML to PDF converter.
Pros are that it is easy to customize and style and to see in the browser how it will look and then you can be sure that it will look as same in PDF as well. You could use CSS and JavaScript as well to style and modify.
Cons are that it is hard to install it on the production server sometimes. But there are web services and APIs that get you covered.
For example one service is https://pdfapi.io. It is free to use. Only when your amounts get bigger, then it will charge like a cup of coffee.
Hope that helps.
Is it possible to Print the highchart as a PDF using DOMPDF or any other PHP Html pdf generators?
Version 2 of Highcharts includes PDF generation. The Highcharts client side will export an SVG string, and there will be server modules based on Batik that do the conversion to PDF. You can try it out at Link.
This component will only convert the chart itself. If you want to convert the whole webpage or parts of it, check out the server library with the name of wkhtmltopdf (read WebKit HTML to PDF). It converts the charts too.
Take a look at their latest announcement about generating images on the server.
Once you save the images, you can add them to a pdf using libraries such as tcpdf
Please familiarise yourself with the included exporing module and parameters which can be used http://api.highcharts.com/highcharts#exporting
I've been using FPDF utility in order to export html output to pdf reoprt.
I'm successfully sending text and displaying it in the pdf file, but the problem comes up while trying to display real html structures- like tables and etc.In this case it seems like the encoding is not working well.
I've been trying to come up with a solution, but haven't had a success so far.
Any suggestions?
Thanks in advance
If you want to convert HTML to PDF in PHP you should have a look at MPDF. With FPDF you have to parse the HTML yourself, extracting paragraphs, formatting, images and tables and then need to call the FDPF functions for creating the elements in the PDF - you're basically rewriting MPDF functionality.