This module is used Conversion of HTML page to PDF using mPDF PHP Library. This module allows you to generate the pdf documents of any node:
PDF creation (at www.example.com/show_pdf/nid)
where nid is the node id of content to render.
By creating your own CSS file and/or the pdf--node.tpl.php files, it is possible to change the look of the output page to suit your taste. For a more fine-grained customization, it is possible to use a template file named:
Drupal 7: pdf--node--[node-type|node-id].tpl.php
located in the same module directory i.e., 'pdf_using_mpdf'.
Where node-type & node-id are Drupal's node type (e.g. page, story, etc.) and node-id (eg: 12) respectively.
API Function : pdf_using_mpdf_api()
This API function is available to content developers that prefer to generate a pdf file of custom path. The function takes two parameters, first a rendered html content and an optional second parameter, name of the pdf file. E.g: pdf_using_mpdf_api($html) where $html is any html content.
You must install the following third-party tools to generate PDFs:
mPDF
Please follow the instructions in the README.txt files carefully.
Sandbox URL - http://drupal.org/sandbox/osscube/1819680
Version - 7.x
Reviews of other projects
- http://drupal.org/node/1835638#comment-6711728
- http://drupal.org/node/1836550#comment-6721838
- http://drupal.org/node/1837270#comment-6721860
3 more review of other projects
- http://drupal.org/node/1840692#comment-6734816
- http://drupal.org/node/1841486#comment-6749460
- http://drupal.org/node/1839230#comment-6753164
3 more Reviews of other projects :
- http://drupal.org/node/1856652#comment-6803088
- http://drupal.org/node/1846194#comment-6803552
- http://drupal.org/node/1852392#comment-6803272
3 more Reviews of other projects :
- http://drupal.org/node/1844022#comment-6811672
- http://drupal.org/node/1858586#comment-6811612
- http://drupal.org/node/1856652#comment-6803088
Another 3 more Reviews of other projects :
- http://drupal.org/node/1874178#comment-6876924
- http://drupal.org/node/1870348#comment-6863482
- http://drupal.org/node/1870738#comment-6863454
Another 3 more Reviews of other projects :
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | pdf.png | 89.75 KB | priyankprajapati |
Comments
Comment #1
brajendrasingh commentedManual Review :
1) Do not use html tag within t() function.
2) Use t() function for defining description at line no 46 in pdf_using_mpdf.module file.
3) Declaration of all themes should be in a single array in hook_theme() . You can apply your theme rendering conditions as where needed.
4) Please keep pdf_using_mpdf_config_submit() function in pdf_using_mpdf.admin.inc file.
5) Please do not use $_REQUEST variable in pdf_using_mpdf_config_submit() function.
5) Use system_settings_form() function for saving admin settings information.
6) Please don't add LICENSE.txt, it will be added by drupal community after completing review process and full project release.
Thanks....
Comment #2
brajendrasingh commentedManual Review :
1) Do not use html tag within t() function.
2) Use t() function for defining description at line no 46 in pdf_using_mpdf.module file.
3) Declaration of all themes should be in a single array in hook_theme() . You can apply your theme rendering conditions as where needed.
4) Please keep pdf_using_mpdf_config_submit() function in pdf_using_mpdf.admin.inc file.
5) Please do not use $_REQUEST variable in pdf_using_mpdf_config_submit() function.
5) Use system_settings_form() function for saving admin settings information.
6) Please don't add LICENSE.txt, it will be added by drupal community after completing review process and full project release.
Thanks....
Comment #3
vineet.osscube commentedComment #4
vineet.osscube commentedThanks brajendra singh for giving your reviews. I had update the module, you can check it now.
Comment #5
klausiThis issue is not fixed? See http://drupal.org/node/532400
Priority is normal right now, see http://drupal.org/node/894256
We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #6
klausiProject 1: http://drupal.org/node/1823698
Project 2: http://drupal.org/node/1822638
Project 3: http://drupal.org/node/1823696
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
Comment #7
radheyshyam commented1). Anonymous user can not access admin/config/user-interface/mpdf, Please check it.
2).Use t() function for defining description at line no 152, 159 in pdf_using_mpdf.admin.inc file.
3).Generate PDF document title show to anonymous user, please manage it by permission.
Comment #8
vineet.osscube commentedThanks Radhey Shyam for your comments. Issues has been resolved.
Comment #9
devin carlson commentedI'd suggest removing a CREDITS.txt file in favor of simply adding the text from that file into the bottom of README.txt.
I believe this module should be dependent upon the Libraries API and use the module's API functions for loading the mPDF library. Currently a constant
MPDF_LIB_PATHis defined which dictates where the mPDF library resides. Unfortunately, hard-coding the path this way will pose problems for multisite installations and is difficult for other modules/themes to customize.The non-breaking space should be removed as well as the line breaks. Use multiple paragraphs and variable substitution and required.
The access callback should not be TRUE, it should instead use an access arguments which requires the "administer custom mpdf" permission. All access-related code should be removed from
pdf_using_mpdf_generate_pdf().There's no need for the comment.
Both the title and the markup text should be run through the
t()function. You'll also probably want to enclose the markup in<p></p>as it is displaying a paragraph of text.You should use variable substitution here to make the text easier to translate.
This should probably be a paragraph (which would also eliminate the need for so many line breaks).
The text should be run through
t()with appropriate variable substitution and the<p>should be concatenated with the translated text just like</p>is.There's no need for the comment.
Comment #10
vineet.osscube commentedHi Devin Carlson,
Thank you for your feedback.
Reply - Thanks for the suggestion Devin, but I prefer CREDITS.txt to be a separate file.
Reply - Looking at the multisite installation point, I have used Libraries API now so that mPDF library path is no more hard-coded and the mPDF library can be imported either from the /sites/../libraries directory or the module's directory itself(if not found in /sites/../libraries directory).
Reply - The path for mPDF library is dynamic, i.e. mPDF library can either reside in the sites/all/libraries/mpdf or in the pdf_using_mpdf module directory itself. This module is capable to include mPDF library from any of the above mentioned paths. So, I believe it may not pose any problems for multisite installations or pose any difficulty for other modules/themes to customize.
Reply - Non-breaking spaces have been removed and multiple paragraphs are used.
Reply - access_callback is now associated with a callback.
Reply - Yes sure, there was actually no need for this comment. I have removed it.
Reply - I have put the whole string in
t()function, translation would be much faster now.Reply - Yes you are correct, this should be a paragraph. Corrected.
Reply - The text now runs through
t()function.Comment #11
vineet.osscube commentedHi klausi,
Reply - Reviews of other projects
http://drupal.org/node/1835638#comment-6711728
http://drupal.org/node/1836550#comment-6721838
http://drupal.org/node/1837270#comment-6721860
These links are also listed in the Issue Summary above. You can review this project now. Thanks.
Comment #12
stred commenteddefine('MPDF_LIB_MODULE_PATH', 'sites/' . $_SERVER['SERVER_NAME'] . '/libraries/mpdf');Comment #13
stred commented... and i change the status
Comment #14
vineet.osscube commentedHi stred,
Thank you for the review and feedback.
Reply - Yes, the current release of mPDF is 5.4 . Thanks for the correction.
Reply - mPDF support section is an important section and I believe it must be a separate section in all as mPDF library is not installed with this module.
Reply - There is already a Requirements section.
Reply - mPDF library can work in either paths - firstly, it can be accessed from the /sites/mysite-name/libraries/ or /sites/all/libraries/ directory and secondly, it can also be accessed in this modules's directory as well /sites/mysite-name/modules/ or /sites/all/modules/.
Reply - Could you please put some light on this. This is not clear to me.
Reply - All coding standard errors have been corrected.
Reply - stred, Iam afraid you could not see any buttons, if you are talking about any specific button then please specify because buttons are displaying now.
Comment #15
radheyshyam commentedHi,
1). No description of MPDF Libraries storage directory overview into README.txt file. Please check it.
2). Add mPDF library to "sites/all/libraries/mpdf/mpdf.php" or "sites/all/modules/custom/pdf_using_mpdf/mpdf/mpdf.php". message show after configure mpdf, please check it.
Comment #16
vineet.osscube commentedHi radhey_shyam,
Thanks for your feedback. All the necessary changes you mentioned have been made and reflected.
Comment #17
grisendo commentedThis kind of translation are not correct, since grammar structure couldn't be respected in some languages:
That one is in pdf_using_mpdf.admin.inc line 165, but there are a lot in the whole project.
Use instead the form:
This other t() use is critical, since it generates a new translatable string every time a variable/constant like MPDF_LIB_PATH changes, and it uses t() function inside string for another t() function (lines 171-176 in pdf_using_mpdf.admin.inc):
Please, fix all wrong t() uses.
Removing review bonus tag. After fixing, you can add it again if you have done another 3 reviews of other projects.
Comment #18
vineet.osscube commentedHi grisendo,
Thank you for your feedback. All the changes have been made.
Comment #19
grisendo commentedThere are some more t() bad uses not fixed:
pdf_using_mpdf.pages.inc, line 300
pdf_using_mpdf.admin.inc, line 103
pdf_using_mpdf.admin.inc, line 158
pdf_using_mpdf.admin.inc, line 175
pdf_using_mpdf.module, line 24
Generally, it's a bad use:
Please, check all t(), maybe I lost some others.
Comment #20
vineet.osscube commentedAll
t()functions have been rectified. Thanks.Comment #20.0
vineet.osscube commentedReviewed other projects. Now edited issue summary to note down those projects under "Reviews of other projects" section.
Comment #21
vineet.osscube commented3 more review of other projects
Comment #22
stixes commentedHey,
First glance:
Could be a promising module, however the print module does accomplish this task as well, and implements flexible pdf libraries as well. It does not use mPdf however.
I would advocate you spend your efforts contributing an mPdf option to the print module, rather then developing a separate module.
Automated review using PAReview:
There is still a master branch in your repository.
There is version information in the info file, which should be removed as it is maintained by drupal.org.
Documentation:
The README.txt states you require Drupal 7.0 . I would assume this is a minimum requirement, but changing to "Drupal 7.0 or later" goes a long way.
CREDITS should go into README.txt as an earlier reviewer mentioned.
Code:
This function is completely redundant:
you would change in your hook_menu:
to
and remove the above mention function.
The following access callback should be refactored to use permissions rather then admin role. user_access already has this exception anyway, so this function is not only redundant, but restricts the use of the admin pages to the admin user..
I stopped here. There is alot of work to complete this, and I do consider this module a duplicate of the print module.
Comment #23
klausiThis sounds like a feature that should live in the existing print project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the print issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.
If that fails for whatever reason please get back to us and set this back to "needs review".
Comment #24
vineet.osscube commentedHi,
We the developers of pdf_using_mpdf are not satisfied with the comments posted by jm@bellcom.dk.
We believe that our pdf_using_mpdf module is not just a mere copy of the print module. We have looked at the print
module and its functionality and all we can say is that our pdf_using_mpdf module is a
module with a fresh look and much less complex functionality.
The print module has provided in its documentation that it can support mPDF library,
however, it cannot work with mPDF library like a piece of cake. pdf_using_mpdf module is developed specifically
to work with the mPDF library freely and with an ease and its developers believe rather
than converging it with the print module, it is best to keep things simple and straight with
much less complexity and give drupal community users a module that is light and much less sophisticated.
The print module provides API functions to insert different types of links, however, pdf_using_mpdf module provides an API function to generate PDF file itself.
If we look at the print module's functionality, the print module first creates a printer friendly page and then allows for creating
a PDF file, however the pdf_using_mpdf module can create a PDF file of any given HTML directly.
The print module does not create a password protected file, neither does it provide any functionality to
associate any author information, subject of a PDF file, watermark text, or any header and footer information of a PDF file, all this is accomplished by using pdf_using_mpdf module.
Comment #25
klausiOk, so I think we can continue with this application.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #26
vineet.osscube commentedHi klausi,
Thanks for the support and feedback
Reply - removed master branch
Reply - removed 'version' from pdf_using_mpdf.info file
Reply - all variables are prefixed with our module name
Reply - all constants are prefixed with our module name now
Reply - loading pdf_using_mpdf.module have been removed from global context
Reply - removed placeholder !default_help
Reply for comment #22 - the method pdf_using_mpdf_admin_config_access() is a necessity because not just any role can access the admin settings, moreover, this will definitely not restrict admin from using this page because it has been purposefully written for admin use only.
Comment #27
vineet.osscube commented3 more Reviews of other projects :
http://drupal.org/node/1856652#comment-6803088
http://drupal.org/node/1846194#comment-6803552
http://drupal.org/node/1852392#comment-6803272
Comment #27.0
vineet.osscube commented3 more Review of other projects done
Comment #28
pere orgapdf_using_mpdf_user_access():Is really needed?
pdf_using_mpdf_admin_config_access(), could be implemented as:PDF_USING_MPDF_MPDF_MODULE_PATH. Others likePDF_USING_MPDF_PDF_PAGE_SIZEshould be better if the user can customize them using the UI.Comment #29
vineet.osscube commentedHi netol,
Thanks for the feedback
This function has been scrapped now and following changes are made -
'access callback' => user_access('administer custom mpdf'),in the pdf_using_mpdf.module file
-- The function
pdf_using_mpdf_admin_config_access()has been modified.-- Yes, the constants like
PDF_USING_MPDF_PDF_PAGE_SIZEand others are needed specifically to modify the settings of the generated PDF file. If you look at the configuration page of this module, you will find a number of settings for PDF file that a user can change/customize using UI.Comment #30
klausimanual review:
require_once 'mymodule.inc';Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #31
vineet.osscube commentedHi klausi,
Reply - removed user_access() from pdf_using_mpdf_generate_pdf() in pdf_using_mpdf.pages.inc
Reply - corrected and tested.
Reply - when loading a node with _pdf_using_mpdf_node_generator(), access has been taken care of.
Reply - removed module_load_include('inc', 'pdf_using_mpdf', 'pdf_using_mpdf.pages'); from pdf_using_mpdf_menu().
Reply - I really think it should have been a permission case rather than limiting it to just admin. Corrected.
----- corrected.
Reply - correct and tested. Now template file is of node.tpl.php rather than pdf--node.tpl.php.
Reply - it was necessary to insert a link to a rendered node and let the default theme render the links accordingly, hook_node_view_alter() is used for the purpose of rendering a node link according to the current theme.
Reply - _pdf_using_mpdf_generator() defined in the pdf_using_mpdf.module file.
Comment #31.0
vineet.osscube commented3 more Review of other projects
Comment #32
klausimanual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #33
vineet.osscube commentedHi Klausi :
1)
Reply - issue resolved. we had use the user_access() directly in both menu.
2)
Reply - renamed the permission to "generate pdf using mpdf".
3)
Reply - No issues are with uppercase variables, still we had change it to lower case.
4)
Reply - Issue resoved. plaint text function removed.
5)
Reply - issues resolved.
6)
Reply - issue resolved. Now return variable is appropriate.
7)
Reply - issue resolved. handled by node_access().
Comment #33.0
vineet.osscube commentedReview another 3 more modules.
Comment #34
klausiPlease don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #35
klausimanual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #36
klausiNow actually removing tag.
Comment #36.0
vineet.osscube commentedAnother 3 manual reviews
Comment #37
vineet.osscube commentedHi Klausi :
Thanks for making it status RTBC,
Reply - Issue resolved. implements library checks in hook_requirements() using library API.
Reply - Issue resolved, remove all static library path and handled it by library_get_path.
Also Review another 3 modules.
Comment #38
vineet.osscube commentedAdding PAReview:review bonus tag here..
Comment #39
klausino objections for more than a week, so ...
Thanks for your contribution, osscube!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #40
vineet.osscube commentedThanks Klausi for all your valuable reviews and comments. We had really learned a lot from you.
Thank every body !
Comment #41.0
(not verified) commentedanother 3 review bonus
Comment #42
priyankprajapati commentedHello friends.
i have download and install the mpdf module also install the mpdf library.
after that i go to the admin/config/user-interface/ mpfd
then message display like this...
Add mPDF library to "sites/all/libraries/mpdf/mpdf.php" or "sites/all/modules/custom/pdf_using_mpdf/mpdf/mpdf.php". message show after configure mpdf, please check it.
so how can i add the libraries ?? how can i solve my problem???
Comment #43
klausiThis project application is closed. Please post bugs to the module's issue queue at https://www.drupal.org/project/issues/pdf_using_mpdf?categories=All
Comment #44
Chetan Sharma commentedDear Vineet,
I am using this module to print html data into pdf using pdf_using_mpdf_api() function.
When I am sending html to pdf using this function, It always gives me "504 Gateway Time-out" . I have also checked my server max_execution_time.
Could you please help me over the issue.
Thanks in advance.
Comment #45
aryashreep commentedThere is some coding standard errors to fix :
Review of the 7.x-2.x branch (commit a61a87c):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Source: http://pareview.sh/ - PAReview.sh online service
Comment #46
yash_khandelwalBelow is the basic example of 'PDF using mPDF'
Comment #47
kattekrab commented@Chetan Sharma this project application was approved 4 years ago.
The full module can be found here:
https://www.drupal.org/project/pdf_using_mpdf
You may wish to repost your support request there.
Comment #48
yash_khandelwalComment #49
informatikadomicile1 commentedHello i'm looking for a custom of this module.
print $content;if i need to see more on the content type generated byComment #50
avpadernoComment #51
avpaderno