dutchnet Posted July 4, 2008 Share Posted July 4, 2008 When a customer opens your pdf invoice he can have a look at the properties of the pdf file. We changed our pdfconfig.php file a little so when one of our customers decides to have a look at the properties he will see the following Personalized information: // set document information $pdf->SetAuthor("DutchNet"); $pdf->SetTitle("Hosting Invoice"); $pdf->SetSubject("Invoice for Hosting and Domain services"); The Title can even be a bit more fancy if you add the invoice number to the Title like: $pdf->SetTitle($invoiceprefix.' : '.$invoicenum); the above line should be added just below: # Header Bar $invoiceprefix = $_LANG["invoicenumber"]; /* ** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice **/ if ($status!="Paid") { $invoiceprefix = $_LANG["proformainvoicenumber"]; } 0 Quote Link to comment Share on other sites More sharing options...
Damainman Posted September 12, 2009 Share Posted September 12, 2009 Does this apply to the latest version? 0 Quote Link to comment Share on other sites More sharing options...
Stream101 Posted September 12, 2009 Share Posted September 12, 2009 Since the post is from 2008, I would have to say that it might work, but it isnt applied for it. 0 Quote Link to comment Share on other sites More sharing options...
hklcf Posted November 19, 2009 Share Posted November 19, 2009 let's me try tonight 0 Quote Link to comment Share on other sites More sharing options...
dutchnet Posted November 26, 2009 Author Share Posted November 26, 2009 We still use the same layout with version 4.1.2, no problems detected yet 0 Quote Link to comment Share on other sites More sharing options...
timgws Posted November 26, 2009 Share Posted November 26, 2009 If you really want professional PDF invoices, I would suggest that you do what we have done where I work at the moment. Make a HTML template, replace values in this template (such as "{client_name}" etc), write out a temp file and render a PDF with wkhtmltopdf (google it!). This has allowed us to create very professional looking PDFs. 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted November 27, 2009 Share Posted November 27, 2009 If you really want professional PDF invoices, I would suggest that you do what we have done where I work at the moment. Make a HTML template, replace values in this template (such as "{client_name}" etc), write out a temp file and render a PDF with wkhtmltopdf (google it!). This has allowed us to create very professional looking PDFs. nice idea, but at the moment i would prefer a PHP-only solution. 0 Quote Link to comment Share on other sites More sharing options...
dansgalaxy Posted December 20, 2009 Share Posted December 20, 2009 Thanks for the tip! Is it possible to also add the signing? and security stuff? 0 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted December 21, 2009 Share Posted December 21, 2009 Is it possible to also add the signing? and security stuff? Nice question! any answer? 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 27, 2009 Share Posted December 27, 2009 hi , sorry but my whmcs do not have any file named , pdfconfig.php , which file should i alter ? 0 Quote Link to comment Share on other sites More sharing options...
Stream101 Posted December 27, 2009 Share Posted December 27, 2009 Look for pdfconfig.tpl in your templates/[your_template]/ directory. 0 Quote Link to comment Share on other sites More sharing options...
AtlGirl Posted December 27, 2009 Share Posted December 27, 2009 Try looking in the includes directory for phpconfig.php. 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 (edited) hi, thanks i found them.. the files that generate pdf are, includes\ , tcpdf.php , tcpdf_unicode.php and template\[tempatename]\invoicepdf.tpl , thank u all for replying look at my attachment . it is a part from the generated pdf . http://forum.whmcs.com/attachment.php?attachmentid=1238&stc=1&d=1261978031 i have read some where that i should replace the fonts with tcpdf UTF-8 fonts. but i didnt find anything specific about it . every where they just said that tcpdf is compatible with utf-8. and the samples worked fine . i dont know why whmcs cannot work correct. it only shows squares. Edited December 28, 2009 by LAZer414 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 the strange thing is that for arabic/persian utf8 characters it brings square or ? instead of characters. i have downloaded the latest tcpdf , and replaced the font files but no changes. then i tried the samples of tcpdf and found that if the text on the source of the page being readable then it generates a good pdf. so i have converted my database from latin to UTF-8. now my data in the pages are correctly readable , and the data in the database is also readable in phpmyadmin and everything is UTF-8. but when i generate a pdf file still it brings squares. i tried changing the fonts to the following fonts that works fine for arabic/persian characters. zarbold,almohanad,dejavusans. but i think whmcs do not use them at all! because after uploading those fonts to the includes\fonts dir , and setting the font nam ein the invoicepdf.tpl, // set font $pdf->SetFont('dejavusans', '', 12); still it shows squares. i have deleted fonts from my ftp . and it still shows squares ! i`m getting mad... look at my attachment . it is a part from the generated pdf . http://forum.whmcs.com/attachment.php?attachmentid=1238&stc=1&d=1261978031 i have read some where that i should replace the fonts with tcpdf UTF-8 fonts. but i didnt find anything specific about it . every where they just said that tcpdf is compatible with utf-8. and the samples worked fine . i dont know why whmcs cannot work correct. 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 the strange thing is that for arabic/persian utf8 characters it brings square or ? instead of characters. i have downloaded the latest tcpdf , and replaced the font files but no changes. then i tried the samples of tcpdf and found that if the text on the source of the page being readable then it generates a good pdf. so i have converted my database from latin to UTF-8. now my data in the pages are correctly readable , and the data in the database is also readable in phpmyadmin and everything is UTF-8. but when i generate a pdf file still it brings squares. i tried changing the fonts to the following fonts that works fine for arabic/persian characters. zarbold,almohanad,dejavusans. but i think whmcs do not use them at all! because after uploading those fonts to the includes\fonts dir , and setting the font nam ein the invoicepdf.tpl, // set font $pdf->SetFont('dejavusans', '', 12); still it shows squares. i have deleted fonts from my ftp . and it still shows squares ! i`m getting mad... 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 here is what ive done. i have downloaded the latest tcpdf , and replaced the fonts in it with the fonts in includes\fonts. then tested and the results were the same. then i have tested examples of tcpdf and saw that if the text on the source of the file being readable then it generates a good pdf. so i have converted my db from latin to utf-8. now my data on the pages are correct and alsso the data in the db in phpmyadmin is readable so everything is now UTF-8. but still pdf generates squares. 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 (edited) here is what ive done. i have downloaded the latest tcpdf , and replaced the fonts in it with the fonts in includes\fonts. then tested and the results were the same. then i have tested examples of tcpdf and saw that if the text on the source of the file being readable then it generates a good pdf. so i have converted my db from latin to utf-8. now my data on the pages are correct and alsso the data in the db in phpmyadmin is readable so everything is now UTF-8. but still pdf generates squares. i think that it dont read the font files at all , i have defined the fonts in invoicepdf.tpl // set font $pdf->SetFont('dejavusans', '', 12); i have tested the fonts that work fine on arabic like bzarbold and almohanad , i have double checked everything but results were the same. what should i do ? Edited December 28, 2009 by LAZer414 0 Quote Link to comment Share on other sites More sharing options...
LAZer414 Posted December 28, 2009 Share Posted December 28, 2009 hi i have finally solved the square and ? problem it was because of the fonts . after converting the db to utf-8 and the files to utf-8 without bom , and uploading new fonts , we should set utf-8 fonts . the fonts in tpl file did not run because they were defind in includes\tcpdf.php function SetFont , by changing the fonts family to my required fonts , it worked thank u all. 0 Quote Link to comment Share on other sites More sharing options...
exdeliver Posted December 31, 2009 Share Posted December 31, 2009 anyone got a screenshot? 0 Quote Link to comment Share on other sites More sharing options...
karrde Posted February 7, 2010 Share Posted February 7, 2010 WHMCS version 4.1.2 Title and Creator are set automaticaly from WHMCS with your company name and invoice + number for the title. If you want to have keywords and a subject. Go to whmcs/includes/tcpdf.php and search for var $subject = ''; var $keywords = ''; and replace with your needs. 0 Quote Link to comment Share on other sites More sharing options...
Daworm Posted March 11, 2010 Share Posted March 11, 2010 Is there a web-based page to generate / modify the look of the PDF file? IE: contents in it? In the code it looks like it's sorta designed with that in mind? 0 Quote Link to comment Share on other sites More sharing options...
vchosting Posted March 11, 2010 Share Posted March 11, 2010 Not that I know of within WHMCS or anything - I simply modify the code but it can be a little complex and syntax is very important 0 Quote Link to comment Share on other sites More sharing options...
alaufi Posted April 5, 2010 Share Posted April 5, 2010 hi i have finally solved the square and ? problem it was because of the fonts . after converting the db to utf-8 and the files to utf-8 without bom , and uploading new fonts , we should set utf-8 fonts . the fonts in tpl file did not run because they were defind in includes\tcpdf.php function SetFont , by changing the fonts family to my required fonts , it worked thank u all. can you give me files after edit thanks 0 Quote Link to comment Share on other sites More sharing options...
timgws Posted April 7, 2010 Share Posted April 7, 2010 Is there a web-based page to generate / modify the look of the PDF file? IE: contents in it? In the code it looks like it's sorta designed with that in mind? Yes. use wkhtmltopdf. 0 Quote Link to comment Share on other sites More sharing options...
antoniojeldres Posted April 16, 2010 Share Posted April 16, 2010 Anyone have a screetshoot, I want to have someone do a custom invoice or maybe copy one already done. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.