Hi,

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 :)

Comments

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...?

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...

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.

Any update ?

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.

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.

Version:7.x-1.x-dev» 7.x-2.x-dev