I've got a view which is accessible via a url. It's function is to produce a commerce invoice. I've used a hook_commerce_price_formatted_components() function to alter the output of the view in my theme's template.php.

When i view /user/%/invoice/%, the pdf is rendered 100% correct, including my custom hook.
When rules saves the same pdf to the server-side disk, the file does not include my custom hook, so output is wrong.

Since the file being saved is an invoice, the file should meet law regulations. The hook fixes that. Last hurdle: getting it in the saved pdf.

I've set priority to major because of high importance of invoicing.

I've tested this in dev versions 25 and 26. Issue is the same.

Thanks for any help and the great module :)


candelas’s picture

i had the same problem with the last devs. the saved pdf didnt take my tpl.php file. i could resolve it creating a new view and rewriting. but i think it is not your case, and it would be nice to have this solved. maybe, in the mean time, you can use views php module...?

elsteff1385’s picture

you mean i can use the views php module to force the view to call my hook? so in essence, copy and paste the hook from the tpl.php file to a global php field in the view?

Sounds like a good workaround...

candelas’s picture

i didnt try a hook. i had to capitalize with a selector (h3:first-letter) and tcpdf wouldnt show it. So i used views_php to do it. please, report your results.

killua99’s picture

Any update ?

elsteff1385’s picture

yes. i was using a theme hook. probably these are not used when saving a pdf (something killua99 can clarify).

I have now solved the issue by using a _alter function, which is always executed.

killua99’s picture

Issue tags: +#views_pdf_7.x-2.x

Right now I don't have any clue to answer right. But I'll store it and put a 2.x version tag to handle it in the next version.

killua99’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
vegansupreme’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

@esteff1385 in #5 you say you've solved the problem. Do you think it's still important to have PDF rules implement hook_ function?
If so, please reopen this issue and I'll look into it.