João,
I was wondering if it might be possible to have a default pdf filename based on type. It didn't look like there was a way to hook into print_pdf_controller from the outside to do this so I thought I'd run it by you.
João,
I was wondering if it might be possible to have a default pdf filename based on type. It didn't look like there was a way to hook into print_pdf_controller from the outside to do this so I thought I'd run it by you.
Comments
Comment #1
jcnventuraHi,
Install the token module, and you'll be able to use some tokens to generate the PDF filename. I should document it more :)
Let me know if that helps you..
João
Comment #2
JaredAM commentedNo, I think you've documented that fine, what I was trying to get at was the ability to set multiple filenames + tokens (for each content type).
For example:
Filename for type Page: [title] - [date]
Filename for type MyCCKType: [title] - [location_city][location_province]
Filename for type MyCCKType2: [title] - [field_mycustomfieldtype]
etc.
Comment #3
jcnventuraNo, this hasn't been done yet.. And it's so specific, that I don't think most users would find it so useful to 'burden' their type-specific configuration with this sort of thing.
I guess I could add a themeable function so that advanced users could write their own PHP code to come up with whatever they wanted, though..
João
Comment #4
JaredAM commentedSure, however you think might be best.
I was simply thinking of something along the lines of what the path auto module does. A simple foreach to get each type and then just store different patterns for each type. That way it's not pushed out to the content types, but is internal to the print module.
Finally got dompdf working for my project, thanks for the great module.
Comment #5
jcnventuraAs part of #1579954: Add drupal_alter for PDF filename, the hook_print_pdf_filename_alter() was added. If someone needs to customize their PDF filenames by type, it's possible to write a custom function to alter the filename as desired.