2 replies [Last post]
cloudmine's picture
Offline
Joined: 07/16/2008
Juice: 72
Was this information Helpful?

Hi,

I want to develope a module, that will print the data from order on something like this:

http://poczta.lublin.pl/eng/wzory/druki/k_paczka.jpg

That's a Polish form required to send a single package and it has to be printed on a dot-matrix printer.
There aren't any open-source programs that print on such form.

I was thinking about putting a link to print data from the order near the 'Invoice' link in the Order section.
Since I've had a long break in PHP programming and I'm also new to Drupal CMS, I want to ask you for some hints where to start and where is the best place to implement such thing so that it could be a module in the future.

Because the form has very specified dimensions, I think the best way is to use PHP's image functions, so that the image would be printed same on every printer.

Antoni

PreviewAttachmentSize
k_paczka.jpgk_paczka.jpg53.19 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Printing data from the order on a post form

Hi Antoni. Getting into image manipulation and web->print is outside of my normal work. However, I can help the with Drupal question. Eye-wink

If you're looking to have a link next to the "Invoice" link, that's called a secondary link for the order page. You define pages and their tabs by implementing hook_menu() in a custom module. You'll basically want to look in the uc_order.module and copy the code for the invoice tab from uc_order_menu(). You'll of course need to change the path, the callback, and maybe tweak the weight so it shows where you want it. Then in the callback function for that menu item you can do your image creation and display. For more information, check out the module development handbooks on drupal.org or invest in Pro Drupal Development (Drupal 5) or Learning Drupal 6 Module Development (Drupal 6).

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Printing data from the order on a post form

This is kind of how the UPS module does its label. The size of the image is constrained in some HTML that's in the documentation. Rigging up some kind of template might be easier than messing with image manipulations.

I don't know what the best way to build your module would be. Is it just a static image? The link could be put just about anywhere, then. The UPS shipping module puts the file path of the package label in the packages table, so something like that could work too. All the entries would be the same, but that's not a big deal, I don't think.