Would be cool if the view theming worked on the mailing labels and could accept HTML or css markup, such as changing font sizes, making certain fields bold, and rearranging the order of fields.

Comments

darrellduane’s picture

I've figured out how to insert a new line into the data that appears on a label I'm generating my data from a PHP block in my view

neither  '<br>'  nor '\n' generate a new line, but I learned that chr(10) will generate a carriage return in php


I'm trying to figure out how to print out the following characters:  &, ", ', <, >.  These characters come through looking as follows, respectively:
   &amp; &quot; &#039; &lt; &gt; 

I tried using chr() but it doesn't fix the problem.  I will make a bug report up and see if we can get into the code to fix this problem.

letapjar’s picture

The problem is that the pdf file is not generated by anything that parses HTML or CSS.

Rearranging field order with css is probably not feasible. As far as changing font sizes and making things bold go - this would require that you override the default display settings and would require some modifications to the plugin display attachment as well as the ufpdf file.

We would need a way to catch the bold/italics/underline properties and then use appropriate font substitutions. The font would have to be defined correctly in the first place so that bold, italics etc existed.

Also, we would need some way to check that the selected formatting does not make the label text larger than the selected label.

Seems like a lot of effort just to get a prettier label.

How many people actually need this? And what is the use case where the mopdule is not useful without this feature?

richardtmorgan’s picture

The issue with characters is solved here: http://drupal.org/node/604434

While you're at solving that by modifying the mailing_label.module file, it is also possible to specify the font differently if desired (I wanted labels printing with just the name, so I wanted a bigger font-size) - the call to $pdf->SetFont('DejaVu Sans'); can be given a style parameter as its second parameter, and a size (in points) parameter as the third. So for my name labels I altered this to $pdf->SetFont('DejaVu Sans', '', 18); - or you can just alter this in the label definition in the mailing_label-ufpdf.php file.

kristen pol’s picture

This is useful in order to extend the mailing_label module to name badges/tags. I need to create name tags for a client. They also needed mailing labels so I started with this module which was great. But I was hoping to leverage this module to do the name tags too. I'm not sure how easy it would be to make a generic way to handle changing font size/style for each views field. I'm currently having trouble just getting a new line but I haven't tried added the chr() code above yet. Most likely I will end up copying the mailing_label module and modifying it for this particular client but if I end up doing a more generic solution then I will post back a patch.

Kristen

richardtmorgan’s picture

Kristen,

I made a version of this module with an administration interface which allows you to set the font size for a particular label type:

http://drupal.org/node/638546#comment-2856822

This allows us to use a small font for mailing labels and a much bigger font for name labels. If that's all you want, this might do it for you?

bluegeek9’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.