PDFTK allows node creators to automatically merge multiple pdf documents into one file.

It uses a binary program, PDF toolkit (PDFTK) v1.45 that must be installed on the server. It also requires the installation of a library, PHP PDFTK toolkit v0.1.2, which is easily configured.

Additionally quite a bit more functionality can come from the PDFTK system binary in the future, rather than just merging.

Similar modules:
PDF Merger http://drupal.org/node/1984222 -- This module is for drupal 6.

links:
git clone http://git.drupal.org/sandbox/linwiz/1970174.git pdftk
http://drupal.org/sandbox/linwiz/1970174
http://drupalcode.org/sandbox/linwiz/1970174.git

application reviews:
http://drupal.org/node/1982010#comment-7377194
http://drupal.org/node/1987190#comment-7379362
http://drupal.org/node/1986548#comment-7379930
http://drupal.org/node/1986548#comment-7384152

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

a.milkovsky’s picture

Status: Needs review » Needs work

Manual review
1) add git clone string into project description
2) Use $path = libraries_get_path('library_name'); to get library path instead of $slibrary = 'sites/all/libraries/php-pdtfk-toolkit-master/pdftk/pdftk.php';. Read this article
3) don't hardcode 'public://'' or private files storage. $ofile = file_save_data($oimage, 'public://' . $stmpfilename, FILE_EXISTS_RENAME); use file_default_scheme() instead

linwiz’s picture

I have made the corrections at #1, #2 and #3.

linwiz’s picture

Issue summary: View changes

Added git clone url

teyser’s picture

Hi,

In drupal 6 I, created the pdf merger module sandbox project..(With help of fpdi and fpdf library)

Please refer this link to know more

http://drupal.org/node/1984222

Just check this and give your feedback ..

Regards,
-Raj.

teyser’s picture

Issue summary: View changes

Changed required library version

linwiz’s picture

Issue summary: View changes

Added link to review

linwiz’s picture

@teyser I apologize as I do not have a drupal 6 environment. You should surely start with theautomated review first, and clear up the numerous issues. I would also suggest using the coder module for drupal to double check your work.

linwiz’s picture

Status: Needs work » Needs review
linwiz’s picture

Issue summary: View changes

added similar projects

teyser’s picture

Hi Linwiz,

Thanks for your reply. Already I reviewed my code through the automated review and coder module. It does not has any error.

teyser’s picture

Issue summary: View changes

Updated summary with relevant information.

linwiz’s picture

Issue summary: View changes

added link to review

linwiz’s picture

Issue tags: +PAreview: review bonus

added three review links

linwiz’s picture

Issue summary: View changes

added review link

klausi’s picture

Assigned: Unassigned » cubeinspire
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/pdftk.install
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     119 | ERROR | No space found after comma in function call
    --------------------------------------------------------------------------------
    

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:

  1. pdftk_enable(): use variable_get('user_admin_role') instead.
  2. "watchdog('PDFTK', "PDFTK will not run for node $node->nid because the requirements have not been met. Check the Status report for more information.", NULL, WATCHDOG_ERROR);": do not concatenate variables into translatable strings, use placeholders with the watchdog message instead.
  3. pdftk_node_insert(): why do you implement a node hook and not hook_entity_insert() so that the field can work on any entity type?
  4. Why do you need cron? Does the operation take so long? I would suggest to use the batch API instead if you have many documents that you want to merge.
  5. I would write this module differently: Add a field instance setting (checkbox) to file fields to enable merging within the field. Implement entity insert/update hooks, check if the setting is present in the field info for file fields, check if the field has multiple files, merge the files together (maybe batched or queued), replace the first field item with the merge file, remove the other field items and delete the now obsolete files. That way you don't have to hard-code any field name.
  6. pdftk_permission(): the admin permission is never used?

Although you should definitively look into those issue they are not critical application blockers, so I guess this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to cubeinspire as he might have time to tkae a final look at this.

linwiz’s picture

1. This has been corrected
2. This has been corrected
3. I'm not sure, I will see if there is a reason to do this. I'm not sure what entities this would include? any benefits?
4. I would like to eliminate cron all together, but I can't find a hook where the files are available to be modified when the node/entity is created/saved/etc I am open to ideas here, but I'm unable to find a hook for this.
5. I am currently updating the UI anyway, and this will provide a better experience, thank you. What would I use to get file fields without actually having the file field name? This would be a definite improvement, but I have not come across this in information yet.
6. This is going to be used, I am currently heavily in developing this module, though it does function fully as described.

thank you for your review, klausi

klausi’s picture

Status: Reviewed & tested by the community » Fixed

You can just iterate over all fields and check their type with field_info_fields() or a similar function. Supporting other entity types is a good idea, since you may want to stick fields on users, terms, commerce products, profiles etc.

No objections for more than a week, so ...

Thanks for your contribution, linwiz!

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.

linwiz’s picture

Thank you. I have already made quite a bit of improvement with field_info_fields(). That's exactly what i was looking for, I just couldn't find it.
It seems it couldn't hurt to use this on all entities that have a file field.
Thanks for pushing this module through.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added review link