-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cut after last label only #150
Comments
This does not seem to be supported without further changes as both command sets handled here are supported by your model: brother_ql/brother_ql/conversion.py Lines 175 to 187 in 56cf439
convert(qlr, images, **kwargs)
qlr.cut_at_end = True
qlr.add_expanded_mode()
instructions = qlr.data but I have not tested it and this probably will not actually work. |
No, that did not work.
…On Sat, Mar 2, 2024 at 1:27 AM FriedrichFroebel ***@***.***> wrote:
This does not seem to be supported without further changes as both command
sets handled here are supported by your model:
https://github.com/pklaus/brother_ql/blob/56cf4394ad750346c6b664821ccd7489ec140dae/brother_ql/conversion.py#L175-L187
You might try to use
convert(qlr, images, **kwargs)qlr.cut_at_end = Trueqlr.add_expanded_mode()instructions = qlr.data
but I have not tested it and this probably will not actually work.
—
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIUWJS7Y27TKQ5TFHXCE3YWGLONAVCNFSM6AAAAABEC6AQA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUG42DINZUGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
__________O___________
_______-\<,____________
_____(_)/_(_)___________
_________________________
***@***.***>____604-518-1749(m)__604-461-7532(h)
|
Then you might want to create your custom raster class: class CutAtEndRaster(BrotherQLRaster):
def add_expanded_mode(self):
self.cut_at_end = True
return super().add_expanded_mode()
qlr = CutAtEndRaster(model)
instructions = convert(qlr, images, **kwargs)
send(instructions=instructions, printer_identifier=printer, backend_identifier=backend, blocking=True) |
That gets a cut after each label.
…On Sun, Mar 3, 2024 at 9:56 AM FriedrichFroebel ***@***.***> wrote:
Then you might want to create your custom raster class:
class CutAtEndRaster(BrotherQLRaster):
def add_expanded_mode(self):
self.cut_at_end = True
super().add_expanded_mode()
qlr = CutAtEndRaster(model)instructions = convert(qlr, images, **kwargs)send(instructions=instructions, printer_identifier=printer, backend_identifier=backend, blocking=True)
—
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIUWLRIGSQYF7AJ6UW5ZTYWNP55AVCNFSM6AAAAABEC6AQA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZVGI2DIOJYG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
__________O___________
_______-\<,____________
_____(_)/_(_)___________
_________________________
***@***.***>____604-518-1749(m)__604-461-7532(h)
|
Did you set |
This is cuts every label if 'cut' is True, or no cuts if False
┆ kwargs = { 'rotate': '90', 'cut': True, 'label': labelsize, }
┆ qlr = BrotherQLRaster(model)
┆ convert(qlr, images, **kwargs)
┆ qlr.add_cut_every(2)
┆ instructions = qlr.data
┆ send(instructions=instructions, printer_identifier=printer,
backend_identifier=backend, blocking=True)
This was the previous. Again with 'cut' False no cuts, 'cut' True cuts
after each label.
┆ kwargs = { 'rotate': '90', 'cut': False, 'label': labelsize, }
┆ class CutAtEndRaster(BrotherQLRaster):
┆ def add_expanded_mode(self):
┆ self.cut_at_end = True
┆ super().add_expanded_mode()
┆ qlr = CutAtEndRaster(model)
┆ convert(qlr, images, **kwargs)
┆ qlr.add_expanded_mode()
┆ instructions = qlr.data
┆ send(instructions=instructions, printer_identifier=printer,
backend_identifier=backend, blocking=True)
…On Sun, Mar 3, 2024 at 11:57 AM FriedrichFroebel ***@***.***> wrote:
Did you set cut=False for this? Then you are only left with doing the
same as in my previous comment with add_cut_every(n) and setting n to the
number of pages you have.
—
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIUWPTZY234ARZAY5EGW3YWN6CNAVCNFSM6AAAAABEC6AQA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZVGI3TSNBQGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
__________O___________
_______-\<,____________
_____(_)/_(_)___________
_________________________
***@***.***>____604-518-1749(m)__604-461-7532(h)
|
is wrong. You need a custom |
I thought something like this would work, but still get cuts after every
label:
┆ kwargs = { 'rotate': '90', 'cut': False, 'label': labelsize, }
┆ class CutAtEndRaster(BrotherQLRaster):
┆ def __init__(self, model, pages):
┆ self.pages = pages
┆ self.page_count = 0
┆ print('pages: %s' % (pages), file=sys.stderr)
┆ super(CutAtEndRaster, self).__init__(model)
┆
┆ def add_autocut(self, flag):
┆ self.page_count += 1
┆ print('add_autocut: flag: %s page_count: %s' % (flag,
self.page_count), file=sys.stderr)
┆ if self.page_count == self.pages:
┆ print('add_autocut: calling super', file=sys.stderr)
┆ super(CutAtEndRaster, self).add_autocut(flag)
┆
┆ def add_cut_every(self, n):
┆ print('add_cut_every: n: %s overide: %s' % (n, self.pages),
file=sys.stderr)
┆ if self.page_count == self.pages:
┆ print('add_autocut: calling super', file=sys.stderr)
┆ super(CutAtEndRaster, self).add_cut_every(self.pages)
┆
┆ qlr = CutAtEndRaster(model, len(images))
┆ convert(qlr, images, **kwargs)
┆ instructions = qlr.data
┆ send(instructions=instructions, printer_identifier=printer,
backend_identifier=backend, blocking=True)
…On Mon, Mar 4, 2024 at 3:15 AM FriedrichFroebel ***@***.***> wrote:
convert(qlr, images, **kwargs)
qlr.add_cut_every(2)
is wrong. You need a custom BrotherQLRaster class which overrides
add_cut_every with your custom logic and cut=True set, as convert misses
these parameters.
—
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIUWJ4C5A24XUS77GR6QTYWRJV3AVCNFSM6AAAAABEC6AQA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZWGM2DOMBTGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
__________O___________
_______-\<,____________
_____(_)/_(_)___________
_________________________
***@***.***>____604-518-1749(m)__604-461-7532(h)
|
My application prints either one or two labels on pre-cut 62x100 labels.
I need to cut after the last label only.
If a single label is printed cut after it.
If two labels are printed cut only after the second.
I am using pdf2image convert_from_bytes to generate an images list (from pdf on stdin.)
And then:
Setting cut to False I get no cut. Setting it to True I get a cut after each label.
Suggestions? Thanks!
The text was updated successfully, but these errors were encountered: