amil Posted February 20, 2015 Share Posted February 20, 2015 Hello, I am trying to make some customizations on pdf layout for invoices (invoicepdf.tpl file). I refer vertical line text on left part, like this: I think for this, i need to setup a new "custom field" and set "show on invoice" (no issues to set a fixed text on invoicepdf.tpl file directly). But the question, is i am absolutely unable to edit sucesfully invoicepdf.tpl file to make the changes, when i set some code on file, it breaks pdf generation so definetively my code break it and a bit frustrating... Thanks in advance for all help and suggestions 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 21, 2015 Share Posted February 21, 2015 add this code in invoicepdf.tpl right after the <?php $pdf->StartTransform(); $pdf->Rotate(-90); $pdf->Cell(0,0,'This is a sample data',1,1,'L',0,''); $pdf->StopTransform(); $pdf->SetMargins(20, 10, 10, true); 0 Quote Link to comment Share on other sites More sharing options...
amil Posted February 22, 2015 Author Share Posted February 22, 2015 sentq really i am now in the right direction! That is just all i need! But i can see some issues when i try to fit my needs, for example with your code the invoice pdf is: I set a $pdf->Rotate(90); to change text orientation, but unfortunately (and unexpected to me -text orientation is okay now,but not the adjustment) the result is: This should appears from bottom-to-top but you can see its appears on top of pdf. Thank you so much!! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 22, 2015 Share Posted February 22, 2015 you could try tweaking sentq's code by replacing his Rotate line with.... $pdf->Rotate(90,105,125); also, you shouldn't need a custom field for this... if your invoices are just in one language for all customers, then just add the text into the invoice template... if you need this line to be in the client's language, then use Language Overrides and reference them in the invoicepdf.tpl code, e.g - $_LANG["invoicesdatedue"] 0 Quote Link to comment Share on other sites More sharing options...
amil Posted February 23, 2015 Author Share Posted February 23, 2015 brian! really thank you! Only a last thing to definetively finish te customization This is the result, with your $pdf->Rotate(90,105,125); This is nice, but it would be great if text can start at bottom of the invoice, like this: I am unable to alter the coords and get a sucessfully result. Thank you so much again 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 23, 2015 Share Posted February 23, 2015 I think the easiest way to do that would be to centre the text (so change 'L' to 'C') and then add spaces to the text string to lengthen the output... $pdf->SetXY(5,25); $pdf->StartTransform(); $pdf->Rotate(90,105,125); $pdf->Cell(0,0,'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don\'t look even... ',0,0,'C',0,''); $pdf->StopTransform(); $pdf->SetMargins(20, 10, 10, true); once you change the above text string to suit your own needs, you may need to play with the number of spaces used to centre it vertically. 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.