0

I have a project plan content type. I would like to be able to change the "start date" field value to the current date, and set the "deadline date" field value to 2 weeks after. Then I would like to convert this data into a file (eg. pdf) which I can then attach to another entity.

The majority of this can be achieved using the Set Data Value action in Rules module; except of course for converting the data into a file. The module FillPDF comes quite close although it only allows for converting Webform data to pdf and not node data.

The following modules are able to convert nodes to pdf, however they do not have Rules integration: PDF using mPDF, Printer, email, PDF versions

What is the best way to achieve this?

0

rules download module will definitely working with your requirement. This was previously discussed on drupal issue.

Rules Download:

Exposes some Rules actions to download files from the internet using HTTP and use them within rules.

This module exposes the following actions:

  • Download a file from the internet.

There's a possibility, if you fetches an URL from the site that triggered the rule, that, depending on your configuration, it triggers the same rule again. To prevent that, each file that is downloaded is appended with a special URL parameter (drupal_rules_download=1) that prevent the action to be run again.

Downloaded files are stored within the Drupal files system, so they can then be used to set file fields on entities and other drupal actions in which a file field item is expected. For adding it to a single File field use "Set a data value" and for a multiple File field use "Add an item to a list".

This module started of as an attempt to create PDF with the print module and use it in Rules, but because of how Print module works, it was safer to do it as a separate request and then, the module involved into something more general and flexible.

  • Yes I had actually already looked at Rules Download, but it only appears to be able to download files. I need to be able to convert node data into pdf. – FrontEnd Sep 1 '15 at 11:32
  • Have to tried it ? It provides action in rules through which you create pdf of node. – vgoradiya Sep 1 '15 at 11:35
  • Yes I have; the only action I can see is "Download a file from the internet". Where can you see a node to pdf action? – FrontEnd Sep 1 '15 at 12:26
0

It appears that this module is the answer: PDF Archive

The only issue with this module is that it only converts the text of the node. Any images are not outputted to the pdf.

PDF Archive:

The PDF Archive module provides the ability to generate PDF archives of any entity triggered by Rules actions. Both the entity view mode and role of the simulated user used for rendering the entity can be set per rule. An example feature is included to demonstrate the configuration of this module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.