diff -up /home/rajesh/drupal_modules/mailing_label/mailing_label.module ./mailing_label/mailing_label.module
--- /home/rajesh/drupal_modules/mailing_label/mailing_label.module	2009-10-24 22:05:08.000000000 -0400
+++ ./mailing_label/mailing_label.module	2010-03-17 08:50:56.000000000 -0400
@@ -24,6 +24,7 @@ function mailing_label_form($form_state,
 		   '5161' => t('Avery 5161'),
 		   '5162' => t('Avery 5162'),
 		   '5163' => t('Avery 5163'),
+		   '5167' => t('Avery 5167 Return Address'),		   
 		   '8600' => t('Avery 8600'),
                    'L7160' => t('Avery L7160'),
                    'L7161' => t('Avery L7161'),
@@ -35,12 +36,26 @@ function mailing_label_form($form_state,
     '#title' => t('Select a mailing label size'),
     '#options' => $options,
     '#tree' => TRUE,
+    '#description' => t('Check the box of the labels you will be using - usually Avery 5160')
   );
   $form['description'] = array (
     '#type' => 'hidden',
     '#tree' => $results, 
   );
-  $form['submit'] = array('#type' => 'submit', '#value' => t('Print PDF'));
+  /*
+  * 2-20-2010 Added form field to give a file nme prefix for the output file
+  */
+  $form['filename'] = array (
+   '#title' => t('File Name'),
+   '#type' => 'textfield',
+   '#description' => 'Enter a file name for the mailing label output file',
+   '#maxlength' => 20,
+   '#required' => FALSE,
+   '#size' => 20,
+   );
+  
+  $form['submit'] = array('#type' => 'submit', '#value' => t('Make My Labels'), 
+  '#description'=>t('This will make a PDF file for you to download and use to print your labels'));
 
   return $form;
 }
@@ -52,7 +67,8 @@ function mailing_label_form($form_state,
 function mailing_label_form_submit($form, &$form_state) {
   $results = $form['description']['#tree'];
   $format = $form_state['values']['choices'];
-  mailing_label_create_label($results, $format);
+  $file_name = $form_state['values']['filename'];
+  mailing_label_create_label($results, $format, $file_name);
 
 }
 
@@ -68,13 +84,13 @@ function mailing_label_pdf_form($results
  * Create label function  
  *
 */
-function mailing_label_create_label(&$contactRows, &$format) {
+function mailing_label_create_label(&$contactRows, &$format, $file_name) {
   $path = drupal_get_path('module', 'mailing_label');
   require_once ($path .  '/mailing_label-ufpdf.php');
   
   $pdf = new Mailing_Label_PDF_Label($format,'mm');
   $pdf->Open();
-  $pdf->AddPage();
+  //$pdf->AddPage();
   $pdf->AddFont('DejaVu Sans', '', 'DejaVuSans.php');
   $pdf->SetFont('DejaVu Sans');
       
@@ -82,12 +98,17 @@ function mailing_label_create_label(&$co
   $val = null;
   foreach ($contactRows as $row => $value) {
     foreach ($value as $k => $v) {
-      $val .= "$v\n";
+      if (!stristr($k,'_mailing_label_newline')){
+       $val .= ' '.$v;//the field is not flagged as starting on a new line - prepend a space
+       }
+      else{
+       $val.="\n".$v;//field flagged as starting on a new line - prepend a newline
+       }
     }
     $pdf->AddPdfLabel($val);
     $val = '';
     }
-  $pdf->Output( 'label_' . $format . '.pdf', 'D' );
+  $pdf->Output( $file_name. '_label_' . $format . '.pdf', 'D' );
   exit;
 }
 
diff -up /home/rajesh/drupal_modules/mailing_label/mailing_label_plugin_display_attachment.inc ./mailing_label/mailing_label_plugin_display_attachment.inc
--- /home/rajesh/drupal_modules/mailing_label/mailing_label_plugin_display_attachment.inc	2009-10-24 20:53:53.000000000 -0400
+++ ./mailing_label/mailing_label_plugin_display_attachment.inc	2010-03-23 14:53:25.000000000 -0400
@@ -2,19 +2,30 @@
 // $Id: mailing_label_plugin_display_attachment.inc,v 1.3.2.3 2009/10/25 00:53:53 acouch Exp $
 
 /**
- * The plugin that handles date navigation attachments.
+ * The plugin that handles Mailing label attachments.
  * 
  * Creates a special attachment for this purpose only. 
  */
 class mailing_label_plugin_display_attachment extends views_plugin_display_attachment {
   
   function defaultable_sections($section = NULL) {
-    if (in_array($section, array('row_options', 'row_plugin', 'items_per_page'))) {
+   if (in_array($section, array('row_options', 'row_plugin', 'items_per_page'))) {
+   //if (in_array($section, array('items_per_page'))) {
       return FALSE;
     }
     return parent::defaultable_sections($section);
   }
-
+/**
+* 2/20/2010 Added this function to catch exposed filters
+* makes a single page useful in generating 
+* labels for various lists based on exposed filters
+*/
+ function option_definition () {
+   $options = parent::option_definition();
+   $options['inherit_exposed_filters'] = array('default' => TRUE);
+   return $options;
+ }
+ 
   function options(&$display) {
     parent::options($display);
     $display->display_options['items_per_page'] = 0;
@@ -22,7 +33,7 @@ class mailing_label_plugin_display_attac
     $display->display_options['defaults']['style_options'] = FALSE;
     $display->display_options['defaults']['items_per_page'] = FALSE;
     $display->display_options['defaults']['row_plugin'] = FALSE;
-    $display->display_options['defaults']['row_options'] = FALSE;
+    $display->display_options['defaults']['row_options'] = FALSE; 
   } 
 
   function render() {
@@ -30,15 +41,44 @@ class mailing_label_plugin_display_attac
     $fields = $this->view->display[$current_display]->handler->handlers['field'];
     $view=$this->view;
     $i=0;
+    //catch the inline fields from the defualt view
+   $row_options = $this->view->display[$current_display]->handler->options['row_options'];
+   
+   //if the row optins are left as defualts the variable may be null from above so check that and grab default value
+   if (empty($row_options)){
+     $row_options = $this->view->display['default']->handler->options['row_options'];
+   }
+   $allFields = array_keys($fields); //grab labels for all the fields - stuff them in a number indexed array
+   
+   if (!empty($row_options)){ //if there are no inline fields then we do nothing
+       	$inlines=$row_options['inline'];
+   	if (!empty($inlines)){
+   	  //there are inline fields to process so do it
+   	  $prepends=array_flip(array_diff_key(array_flip($allFields),$inlines));// find the fields not in the inlines array
+   	  if ($prepends[0]==$allFields[0]){
+   	   $x = array_shift($prepends);//omit the first field since it's not necessary to prepend it
+   	  }
+   	  $allFields=array_flip($allFields);  //flip keys and values
+   	  foreach($allFields as $id=>$new_id){
+   	     $new_id=$id;   //get rid of numeric values and assign field names again
+   	    if (in_array($id,$prepends)){
+   	      $new_id.='_mailing_label_newline'; //change the key name for this field so when we process the form we know to start on a new line
+   	    }
+   	    $allFields[$id]=$new_id;  //the values of this array are the field keys used in the result set
+   	  }
+       }
+   }
+   
+
     foreach ($view->result as $result) {
-      foreach ($result as $rid => $output) {
         foreach ($view->field as $id => $field) {
-          $results[$i][$id] = check_plain(strip_tags(($view->field[$id]->theme($result))));
+          $results[$i][$allFields[$id]] = check_plain(strip_tags(($field->theme($result))));
+
         }
-      }
+
     $i++;
     }
-   
+
     return mailing_label_pdf_form($results);
   }
 
diff -up /home/rajesh/drupal_modules/mailing_label/mailing_label-ufpdf.php ./mailing_label/mailing_label-ufpdf.php
--- /home/rajesh/drupal_modules/mailing_label/mailing_label-ufpdf.php	2009-10-24 20:53:53.000000000 -0400
+++ ./mailing_label/mailing_label-ufpdf.php	2010-03-17 08:46:46.000000000 -0400
@@ -53,6 +53,10 @@
                                'lMargin' => 0.148, 'tMargin' => 0.5, 'NX' => 2, 'NY' => 3,
                                'SpaceX' => 0.2031, 'SpaceY' => 0, 'width' => 4.0, 'height' => 3.33,
                                'font-size' => 12),
+               '5167' => array('name' => '5167', 'paper-size' => 'letter', 'metric' => 'mm',
+                               'lMargin' => 7.62, 'tMargin' => 12.7, 'NX' => 4, 'NY' => 20,
+                               'SpaceX' => 7.62, 'SpaceY' => 0, 'width' => 44.45, 'height' => 12.7,
+                               'font-size' => 6),                         
                '8600' => array('name' => '8600', 'paper-size' => 'letter', 'metric' => 'mm',
                                'lMargin' => 7.1, 'tMargin' => 19, 'NX' => 3, 'NY' => 10,
                                'SpaceX' => 9.5, 'SpaceY' => 3.1, 'width' => 66.6,
@@ -174,6 +178,12 @@
      * function to Print a label
      */
     function AddPdfLabel($texte) {
+    
+          if (($this->countX ==0) and ($this->countY==0)) {
+            $this->AddPage();  
+          }
+    	
+    
         $posX = $this->marginLeft+($this->countX*($this->width+$this->xSpace));
         $posY = $this->marginTop+($this->countY*($this->height+$this->ySpace));
         $this->SetXY($posX+3, $posY+3);
@@ -195,11 +205,7 @@
             $this->countY=0;
         }
 
-        // We are in a new page, then we must add a page
-        if (($this->countX ==0) and ($this->countY==0)) {
-            $this->AddPage();
-        }
-    }
+     }
 
 }
 
Common subdirectories: /home/rajesh/drupal_modules/mailing_label/ufpdf and ./mailing_label/ufpdf
