1 (edited by virshu 08/25/2013 06:47:49 pm)

Topic: [SOLVED] Customize the look and feel of PDFs

I may have misunderstood something important. When the program talks about "templates" (like, template invoice or template delivery) I thought it is the template ("look and feel") of Invoice PDFs, etc. However, this thread https://frontaccounting.com/punbb/viewtopic.php?id=3198 indicates that it's something completely different. And documentation is skimpy on this topic.

Therefore, a broader question: what is the best (easiest) way to customize the look and feel of the PDF that comes out of the "Print Invoice"? Is it the PHP code of report (107 in this case)? or there is some "template" that variable information is put on top (like Smarty)? Or something else?

Re: [SOLVED] Customize the look and feel of PDFs

The document design can be done in /reporting/includes/header2.inc and /reporting/includes/doctext.inc.
The other header info can be done inside /reporting/includes/pdf_report.pdf and of course the various repXXX.php files inside /reporting folder.

/Joe

Re: [SOLVED] Customize the look and feel of PDFs

Thank you. That was amazingly quick! On a related note, pdf_report says

 // leave layout files names without path to enable including
// modified versions from company/x/reporting directory
include("includes/doctext.inc");
include("includes/header2.inc");

however, include_path doesn't include company subdirectory, and therefore only stock doctext gets included. Is it a setting that I can specify to override core files without modifying them?

Thanks

Re: [SOLVED] Customize the look and feel of PDFs

Yes, you can store changed report files  either as  descibed in the cited comment, or as an part of extension module. See find_custom_file function defined in  mian.inc and called in reporting/prn_redirect.php. Keep in mind this mechanism works only for report files (repXXX.php).
Janusz

Re: [SOLVED] Customize the look and feel of PDFs

Excellent! Thank you. I didn't realize that I need to copy repXXX itself as well, since I wasn't planning to make changes there. Once I did that, find_custom_file indeed found it in company/0/reporting, and used my custom doctext and header2.