I'm working on a project that has a need to generate a cached pdf before the pdf is needed. I wrote a custom rules action to generate a pdf without returning the pdf as print_pdf_generate_path() does. What I'm having trouble with is storing the cached version in the print_pdf private cache directory. file_unmanaged_save_data() shows the file was saved successfully, but the file isn't there. If I change the directory where the file is stored, it works perfectly, but I need it to be stored in the print_pdf cache directory. I've tried changing the permissions on the directory with no luck. Oddly, I CAN get it to work if I run my code from a drush script, but through the Drupal it doesn't work. Any ideas why this may be happening? Is there something special about that directory that I'm missing?
Thanks!
Comments