I want to create pdf files in drupal .module file.
I have view of bulk operations in which I have added an operation send pdf file and download pdf file.
I want to get some data from the database and and create a pdf file from it and when I select an operations it should create and send the pdf file in an email.
So how could I do this???
You should look first in the PHP library for creating PDF files. You can use TCPDF or many others in the PHP libraries:
https://stackoverflow.com/questions/560583/which-is-the-best-pdf-library-for-php
After doing a quick search at Drupal Modules I found this module. And I also found this by Googling. The latter one seems to need no additional PHP modules and should be easy to integrate.
There is a new module named PHP WK HTML to PDF
From his site:
This is intended for module developers, nothing is usable from the
front-end.
This module is a Drupal Library implementation for the PHPWkHtmlToPdf
wrapper and as a result is extremely small because it uses WkHtmlToPdf
to do the heavy work.
And you can use if you want Views PDF
With this module you can output a view as a PDF document. Each field
of the view can be placed on the PDF page directly in the
administration interface. Therefore a new display called "PDF" is
added.
You should use the module print. This module allow you to print a node but also any page of your site. After enable the module you can generate pdf simply by visiting url starting with printpdf/NID or printpdf/AnyPAth.
To generate the pdf it can use the following libraries: dompdf, TCPDF, wkhtmltopdf.
Follow the installation guide
TCPDF is good for pdf creation.
There is new module TCPDF. See tcpdf_example submodule to get started.
For installation see INSTALL.txt:
Download and install libraries module.
Download TCPDF library from http://sourceforge.net/projects/tcpdf/files/
Extract it to sites/all/modules/libraries.
Download and install TCPDF module.
Check the status report to verify if the installation was successful.
Have fun.
I had a very intricately styled view recently that I just couldn't get looking the same as a pdf, I used this service to do it and I was pretty impressed. http://www.html2pdfrocket.com/
Related
I am working with laravel.I want to put downloadable document on my web page.Can someone help me please?
To download PDF file from your Laravel project, you may use https://github.com/barryvdh/laravel-dompdf It will allow to download both static and dynamic content to download from your website as well.
Do you need to render it using laravel? or is it already available for download?
If you need to render it I suggest you use laravel dompdf as stated by the first comment.
If you already have the pdf try this:
Download PDF
It works for me
I have a problem when trying to edit existing PDF. In non-symfony part of code I've used FPDI library and I could just open existing pdf as:
$pdf->setSourceFile('example.pdf');
Now in the symfony part of the project we're using White october bundle for symfony2 which is basically wrapper around TCPDF library.
But the problem is TCPDF does not have any option to open existing file as template. So is there any way I could edit existing pdf file without including another bundle? Since I don't want to have multiple bundles doing almost exact same thing.
According to the documentation of TCPDF library, you can use the import method.
If your library doesn't allow it, use another one ?
Edit: KnpSnappy doesn't allow editing. Only generating.
I have created a PDF form with DOMPDF library. Now i want to have digital signatures in it. I have come to know that DOMPDF doesn't support digital signatures so, i created form using TCPDF but the styling in TCPDF is weak so the form looks ugly.
So is there any external library, or some thing like PHP scripts or any other extensions which i can integrate with my Current pdf form created with DOMPDF.
I am using Open cart.
I have made an application in Yii. Now as per my application requirement I have to make them print in PDF format. I searched over Yii docs but did not got any docs about converting file into printable PDF format. So any help and suggestions will be highly appreciable.
Look into WkHtmlToPdf:
http://code.google.com/p/wkhtmltopdf/
It uses Webkit's rendering engine to make PDFs from HTML / CSS. It's the best library out there that I've found and I've done a bunch of research.
Edit:
Mike on the Yii forum has already built an OO wrapper for WkHtmlToPdf and just released a Yii extension for it.
I have recently used MPDF for a project. It allows you to convert HTML output into PDF format. If you are looking for something simple this might be what you are looking for. Personally, I find it easier to work with HTML/CSS for layout than PDF boxes. I am not sure just how well it scales with complex layouts, though.
Yii also supports using Zend modules. You can use Zend_Pdf if you so choose.
See this documentation page on how to integrate third-party libraries with your Yii code.
Either way, as has already been mentioned, there are tons of PDF libraries available for PHP.
You should search for php libraries to do that. Link to one of them - http://www.tcpdf.org/
I have had great success using fpdf - http://www.fpdf.org/
Unfortunately this feature is not part of Yii. You can try TCPDF, though. http://www.tcpdf.org/
TCPDF lets you parses your HTML output to PDF document. The PDF document can be output in your server or to the user as a direct download.
Hers the extension to create PDF files.
Yii2-PDF
I want to generate multiple pdf reports on click of single print button and zip all the pdf's and store it in a folder.
Any help please. I need this functionality in my project.
According to https://stackoverflow.com/questions/560583/which-is-the-best-pdf-library-for-php
, the best pdf php library is FPDF.
They also mention that Zend has a nice PDF Lib. If you are using CodeIgniter you may wish to use the Zend library, as Zend libraries work nicely inside of CodeIgniter. (A simple Google search will show up several tutorials on using Zend libs as CI libs).
Someone on the CI Forums has instructions on using FPDF with CodeIgniter:
http://codeigniter.com/forums/viewthread/45365/
As for the second part of your question, wrapping data in a zip file is easily done with with CodeIgniter Zip Encoding library as detailed in the user guide.