Hi,
We've been using a Drupal module (https://drupal.org/node/1733320) on our production system and it is working fine for our day-to-day needs.
I'm currently doing some modifications to the module, so that I can not only provide a link for clients to click on a link to generate a PDF on the fly which then immediately starts downloading for them, but so we can, as administrators, save the PDF on the server for further processing (zipping it up with some other files, to be specific).
The creator of the Drupal module has designed it to use the Prince php class, as is. At this stage we don't seem to see that any of the convert* methods in the class return anything other than 'success'.
My modifications to the Drupal module extend the Prince class and will use the DrupalStreamWrapper interface to give other Drupal module developers/themers/site builders the ability to choose what they want to do with the PDF - save it to Drupal's 'private://' or 'public:' URIs, or a directory of choice for the module developer, as well as to send the file straight to the users browser.
To do so, I've changed all the 'private' properties and methods in the Prince class to 'protected'. I'd be interested to know the decisions about why 'private' was chosen. I hope you don't mind me asking?![:-)](/forum/static/smiley/smileface.png)
I can also see, from a Drupal point of view, that it would make sense for us to use the Libraries API module (https://drupal.org/project/libraries). It might be useful if the comments at the top of the Prince php class file had some version information in it.
I'm happy to supply my modified version if that helps?
Kind regards,
Richard
https://drupal.org/user/55284
We've been using a Drupal module (https://drupal.org/node/1733320) on our production system and it is working fine for our day-to-day needs.
I'm currently doing some modifications to the module, so that I can not only provide a link for clients to click on a link to generate a PDF on the fly which then immediately starts downloading for them, but so we can, as administrators, save the PDF on the server for further processing (zipping it up with some other files, to be specific).
The creator of the Drupal module has designed it to use the Prince php class, as is. At this stage we don't seem to see that any of the convert* methods in the class return anything other than 'success'.
My modifications to the Drupal module extend the Prince class and will use the DrupalStreamWrapper interface to give other Drupal module developers/themers/site builders the ability to choose what they want to do with the PDF - save it to Drupal's 'private://' or 'public:' URIs, or a directory of choice for the module developer, as well as to send the file straight to the users browser.
To do so, I've changed all the 'private' properties and methods in the Prince class to 'protected'. I'd be interested to know the decisions about why 'private' was chosen. I hope you don't mind me asking?
![:-)](/forum/static/smiley/smileface.png)
I can also see, from a Drupal point of view, that it would make sense for us to use the Libraries API module (https://drupal.org/project/libraries). It might be useful if the comments at the top of the Prince php class file had some version information in it.
I'm happy to supply my modified version if that helps?
Kind regards,
Richard
https://drupal.org/user/55284