diff -Naur /tmp/mailing_label/mailing_label.module mailing_label/mailing_label.module
--- /tmp/mailing_label/mailing_label.module	2009-10-25 00:05:08.000000000 -0200
+++ mailing_label/mailing_label.module	2010-11-08 18:45:40.000000000 -0200
@@ -20,15 +20,23 @@
 */
 
 function mailing_label_form($form_state, $results) {
-  $options = array('5160' => t('Avery 5160'), 
-		   '5161' => t('Avery 5161'),
-		   '5162' => t('Avery 5162'),
-		   '5163' => t('Avery 5163'),
-		   '8600' => t('Avery 8600'),
-                   'L7160' => t('Avery L7160'),
-                   'L7161' => t('Avery L7161'),
-                   'L7163' => t('Avery L7163'),
-                  );
+  // Default label formats
+  $options = array(
+    '5160' => t('Avery 5160'), 
+    '5161' => t('Avery 5161'),
+    '5162' => t('Avery 5162'),
+    '5163' => t('Avery 5163'),
+    '8600' => t('Avery 8600'),
+    'L7160' => t('Avery L7160'),
+    'L7161' => t('Avery L7161'),
+    'L7163' => t('Avery L7163'),
+  );
+
+  // Custom label formats provided by other modules
+  $custom_formats = module_invoke_all('mailing_label_formats');
+  foreach ($custom_formats as $id => $format) {
+    $options['custom-' . $id] = $format['name'];
+  }
 
   $form['choices'] = array(
     '#type' => 'select',
@@ -52,6 +60,10 @@
 function mailing_label_form_submit($form, &$form_state) {
   $results = $form['description']['#tree'];
   $format = $form_state['values']['choices'];
+  if (substr($format, 0, 7) == 'custom-') {
+    $formats = module_invoke_all('mailing_label_formats');
+    $format = $formats[substr($format, 7)];
+  }
   mailing_label_create_label($results, $format);
 
 }
@@ -86,10 +98,10 @@
     }
     $pdf->AddPdfLabel($val);
     $val = '';
-    }
-  $pdf->Output( 'label_' . $format . '.pdf', 'D' );
+  }
+  $name = (is_array($format)) ? preg_replace('/[^0-9a-zA-Z\-_]/', '', $format['name']) : $format;
+  $pdf->Output( 'label_' . $name . '.pdf', 'D' );
   exit;
 }
 
 
-
