Reputation: 2129
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???
Upvotes: 5
Views: 13536
Reputation: 363
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/
Upvotes: 0
Reputation: 7791
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.
Upvotes: 3
Reputation: 8154
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.
Upvotes: 4
Reputation: 8862
TCPDF is good for pdf creation.
There is new module TCPDF. See tcpdf_example submodule to get started.
For installation see INSTALL.txt:
Upvotes: 1
Reputation: 4338
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
Upvotes: 1
Reputation: 2126
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
Upvotes: 5