Author Topic: generic label printing extension  (Read 36305 times)

mhans

  • Beginner
  • *
  • Posts: 13
generic label printing extension
« on: October 03, 2008, 23:46:57 pm »
I've created a small extension for printing labels for those of us that don't use one of those fancy shipping modules that support this. It does two things:

  • prints a plain address label
  • prints a label for each item in the order. This is useful if you sell, say, coffee and want to put a label on each bag of freshly ground coffee.

It's pretty configurable, so you can use just one or the other of the features. The output is in PDF.

Give it a go and let me know what you think. The extension is attached to this post.

Martin

[attachment cleanup by admin]

mart3223

  • Beginner
  • *
  • Posts: 11
Re: generic label printing extension
« Reply #1 on: October 05, 2008, 13:44:05 pm »
Dear Martin,

Thnx for youre hack. Installation was simple, but as PDF export i only get empty PDF file's. No text ore something els. Waths goes wrong?

Martijn

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #2 on: October 05, 2008, 21:32:12 pm »
Hi Martijn,
good question. I just tried to install my hack on a completely fresh Joomla 1.5.7 with a VirtueMart 1.1.2 and it works. Which versions are you using? Which browser do you use? I tried with Firefox 3, IE 7 and the latest Chrome.

If you run Firefox, could you try installing the "web developer" addon? That gives you an option to view the source code - even for PDFs. I'd like to see what that looks like.

I did find one bug, though, so here is an updated version. The first version always picked the billing address even though there was a shipping address.

Martin

[attachment cleanup by admin]

mart3223

  • Beginner
  • *
  • Posts: 11
Re: generic label printing extension
« Reply #3 on: October 06, 2008, 10:27:20 am »
Martin,

I have install the new version, but it still doesn't work. The source code that i get: 

Code: [Select]
%PDF-1.3
3 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 19>>
stream
x�3R��2�35W(�� �
endstream
endobj
5 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 6 0 R>>
endobj
6 0 obj
<</Filter /FlateDecode /Length 19>>
stream
x�3R��2�35W(�� �
endstream
endobj
1 0 obj
<</Type /Pages
/Kids [3 0 R 5 0 R ]
/Count 2
/MediaBox [0 0 226.77 141.73]
>>
endobj
2 0 obj
<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
/Font <<
>>
>>
endobj
7 0 obj
<<
/Producer (FPDF 1.52)
/Title (Order no 20080193 to Abdet  -)
/Subject (Labels for order no 20080193)
/Author (generic_label_printing extension for VirtueMart by Martin Hans \(mhans at gmx dot net\))
/Creator (generic_label_printing extension for VirtueMart by Martin Hans \(mhans at gmx dot net\))
/CreationDate (D:20081006082126)
>>
endobj
8 0 obj

<<
/Type /Catalog
/Pages 1 0 R
/OpenAction [3 0 R /FitH null]
/PageLayout /OneColumn
>>
endobj
xref
0 9
0000000000 65535 f
0000000341 00000 n
0000000434 00000 n
0000000009 00000 n
0000000087 00000 n
0000000175 00000 n
0000000253 00000 n
0000000512 00000 n
0000000864 00000 n
trailer
<<
/Size 9
/Root 8 0 R
/Info 7 0 R
>>
startxref
967
%%EOF

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #4 on: October 06, 2008, 13:53:24 pm »
Martijn,
Hmm. So it is a PDf that you get - without error messages. Could you try to attach the configuration file that you use - if you modified the one from the distribution? Which version of Joomla/Virtuemart are you using?

Martin


mart3223

  • Beginner
  • *
  • Posts: 11
Re: generic label printing extension
« Reply #5 on: October 06, 2008, 14:04:48 pm »
Dear Martin,

I use the standard config file, without any changes. File is attached. I use VM1.1.2 and Joomla! 1.5.6



[attachment cleanup by admin]

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #6 on: October 06, 2008, 16:36:42 pm »
Martijn,
I've attached a new version. In this version I have added a new option which turns on some debug output. Please install it, turn on VM_GLP_DEBUG, generate a PDF and send me the PDF.

Note that the PDF will expose details of your order, so you may want to use a sample order or email the PDF directly to me (mhans at gmx dot net).

Martin

[attachment cleanup by admin]

mart3223

  • Beginner
  • *
  • Posts: 11
Re: generic label printing extension
« Reply #7 on: October 06, 2008, 17:03:55 pm »
Hello Martin,

As attachment the PDF export from a order in the shop.

Greets, Martijn

[attachment cleanup by admin]

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #8 on: October 09, 2008, 22:25:25 pm »
Hi Martijn,
I haven't forgotten about you. I've just been too busy to put more work into this this week. I expect to get back to you next week.

Martin

manouch

  • Beginner
  • *
  • Posts: 24
Re: generic label printing extension
« Reply #9 on: October 15, 2008, 11:32:08 am »
hi
thank you for your hack
maybe something new
it's working for me when i am in the backend administration
but it's not working when i am in the frontend admin (i've the same answer than Martin mart3223)...
maybe something related to the path or index index2 index3 use in order.order_label_generic_print.php...?

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #10 on: October 15, 2008, 15:19:52 pm »
Hi Manouch,
Thanks for the tip. You are right that it does not work in the frontend admin. I just tried to make it work in frontend also, but it's not so easy. Grr. Virtuemart thinks that everything must be HTML. I hope VM 2.0 will improve this and also add a decent plugin system so we don't need to hack the source in order to add functionality.

Can you confirm this, martijn? Does it work in the backend admin for you?

Martin

mart3223

  • Beginner
  • *
  • Posts: 11
Re: generic label printing extension
« Reply #11 on: October 15, 2008, 15:28:20 pm »
Hello Martin,

Is all the way into the front end it does not work. But unfortunately in back to me yet. So I get the PDFs with BUG-Report but no other information.

Greetings Martijn

Sorry for my minimum english

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #12 on: October 15, 2008, 22:36:41 pm »
Hi Martijn,
Okay. I'll need you to make another debug-PDF for me. The previous did not contain enough information for me to track this down.

New version is attached.

Martin

[attachment cleanup by admin]

mhans

  • Beginner
  • *
  • Posts: 13
Re: generic label printing extension
« Reply #13 on: October 15, 2008, 23:34:45 pm »
Hi Manouch,
I've made it work in the frontend admin as well. New version attached. Notice that the installation procedure has changed. There is another file you'll need to edit now.

Manouch do you get content in your PDFs or are they empty like Martijns are?

Martin

[attachment cleanup by admin]

manouch

  • Beginner
  • *
  • Posts: 24
Re: generic label printing extension
« Reply #14 on: October 16, 2008, 03:51:15 am »
hi guys
this is now working very well for me in both modes frontend and backend admin...
I have a pdf with 2 pages. First page the name and the adress, second page the product title, product attributes and product weight...

(thank you very much)
good luck Martijn