You are not logged in.

#1 2015-11-06 14:54:27

Arakis
Member
From: Hamminkeln - Germany
Registered: 2013-08-11
Posts: 46
Website

Print A4 paper, but transform (resize & crop) for label printer

Hello,
in my shipping application, the output is always a A4 (full paper size) PDF document, but the real label uses only 25% of the paper (real size).

Now i want to print the label area with a label printer, but it should as simple as possible in the working workflow.

So, when "watching" the A4 paper (output from shipping application), i simply want to choose a printer and print without calling a converter script "manually".

Is there any way? Im label printer works as cups printer.

Maybe somthing like a virtual "man in the middle" printer, that converts the document, and prints then to the final printer. It's no problem for me to build a script that converts input_A4.pdf to output_label.pdf, but the workflow of the very-day-use have to be without calling this script manually before doing a real print.

Last edited by Arakis (2015-11-06 16:08:59)

Offline

#2 2015-11-06 19:16:42

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: Print A4 paper, but transform (resize & crop) for label printer

I *think* - I've never done anything like this myself - that you would need to write a CUPS filter, and create a new print queue using it as an extra intermediate step.
See http://www.cups.org/documentation.php/d … ilter.html, and http://www.cups.org/documentation.php/d … ilter.html.
This might also be helpful: https://en.opensuse.org/SDB:Using_Your_ … om_Filters, https://www.google.co.nz/search?q=creat … PS+filters, https://eloquence.marxmeier.com/sdb/htm … 83643.html, and perhaps http://www.cups-pdf.de/documentation.shtml.

Offline

#3 2015-11-08 13:21:26

Arakis
Member
From: Hamminkeln - Germany
Registered: 2013-08-11
Posts: 46
Website

Re: Print A4 paper, but transform (resize & crop) for label printer

Hey pypi,
thank your for the tips. https://eloquence.marxmeier.com/sdb/htm … 83643.html was the greate hint (using the lagacy System V Printing system). It works now as expected.

The only problem i have: the custom system v printing script receives an already reduced size of the paper (and reduced dpi). When i scale the part of the paper, that i need, than it looses quality. Better would be to get the real original resolution, scale the needed part and downsize the paper size. But every time i try to change the paper size of the "virtual system v printing printer", the printer converts to a "normal" printer, native driver. Maybe i have to modify the whole legacy v printing printer only via command line / printers.conf / the ppd-file.

the current quality is ok for bar codes and adress label, but not for QR codes (i think). But on the other hand, my printer (thermal printer) has only 203 dpi, this is not very high.

Offline

#4 2015-11-08 13:57:59

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Print A4 paper, but transform (resize & crop) for label printer

Arakis wrote:

So, when "watching" the A4 paper (output from shipping application), i simply want to choose a printer and print without calling a converter script "manually".

Maybe you can output all pdf documents in a monitored directory (inotifywait -cm). When a new file is detected, then it will be converted and printed.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2015-11-11 04:36:40

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: Print A4 paper, but transform (resize & crop) for label printer

Well, according to someone's old blog post, the filter that changes the size of the image is the first one in the queue (which makes sense - kind of). As such, you'll need to figure out how to "move" your filter so that it runs before the filter that does the resizing; at this point, you probably know more than I do big_smile
Tell us how you get on!

Offline

Board footer

Powered by FluxBB