- Issue created by @badeadrian
- Merge request !2Add hook for customizable PDF filenames in wkhtmltopdf module → (Open) created by badeadrian
Currently, the wkhtmltopdf module generates PDF filenames based directly on the URL, which often results in less readable or user-friendly filenames. This can be problematic for users who need to manage multiple PDFs and prefer more descriptive or standardized names.
Install and enable the wkhtmltopdf module.
Generate a PDF using the module.
Observe the generated filename, which is a URL-encoded string.
Implement a hook in the wkhtmltopdf module that allows for the alteration of the PDF filename before it's generated. This hook, hook_wkhtmltopdf_pdf_filename_alter(&$filename, $url), would enable other modules or site builders to programmatically set a more meaningful or consistent filename.
Implement the proposed hook in the wkhtmltopdf module.
Test the hook to ensure it allows for effective filename alteration.
Document the hook for other developers to use.
No direct user interface changes would occur from this update. The impact is primarily on the generated PDF filenames.
Introduction of a new hook hook_wkhtmltopdf_pdf_filename_alter(&$filename, $url) in the wkhtmltopdf module. This hook would not break existing functionality but would add an additional layer of customization for developers.
No changes to the data model are required for this enhancement.
Active
1.0
Code