Label Printing


I am working on printing account address labels. I am somehow get close to it but need some help.

What i am doing is i have created a new menu item in list view action drop down menu which opens a new small window which has php code. It prints labels in 2 columns but its static now.

What i want is that the selected accounts information will pass to custom php page so that i can print labels for them. How can i pass this information to my custom made php page.

I am using on click function which opens a new window with php code. Please help me in passing these variables so that it will work.

I will appreciate your help and it will give me relief as i need to it for some client.

Hi there,

Have you looked at how the PDF Templates module parses/prints data? It may be worth having a look to see if you can utilise PDF Templates to create templates/print delivery labels.



Hello Will,

I tried using pdf templates but the problem is labels are coming only in one column but i want labels in 2 columns
I tried php code to print labels in 2 columns using for loop but it does not take php code.

Please help i need it urgently. As i commited to my client.

Dear All,

Same requirement for me
Kindly provide the code & steps for implement.



Hi Hansie,

How are you doing this via PHP? Are you echoing out the HTML? You should be able to construct HTML to output the labels into 2 columns.



Hello Will,

What i tried is create a new action button item in list view of account and defined href to my custom php page whose code is below

<?php for($k=0; $k<=2; $k++) { Echo ""; Echo "Address Label Print- HIT6 CRM"; Echo ""; for($j=0; $j<=7; $j++) { Echo ""; for($i=0; $i<=1; $i++) { Echo ""; } Echo ""; } Echo "
"; Echo "

"; } ?>

How can i pass values from list view to this custom page to print the labels. I created custom menu item in custom/ view.list.php

Another method i tried is using pdf templates. But pdf templates does not take above code. It discard php tags

You could get the items from a target list.

PS: I think you have a small bug in your html:

Echo "</tr></table>";    <---- the </tr> tag is in excess since you have closed it in your for loop!