diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index 64e8e05..ef2c026 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -587,8 +587,12 @@ class Escpos(object): :param feed: print and feed before cutting. default: true :raises ValueError: if mode not in ('FULL', 'PART') """ - if feed: - self.print_and_feed(6) + + if not feed: + self._raw(GS + b'V' + six.int2byte(66) + b'\x00') + return + + self.print_and_feed(6) mode = mode.upper() if mode not in ('FULL', 'PART'): diff --git a/test/test_function_cut.py b/test/test_function_cut.py new file mode 100644 index 0000000..d485e0e --- /dev/null +++ b/test/test_function_cut.py @@ -0,0 +1,17 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import six + +import escpos.printer as printer +from escpos.constants import GS + + +def test_cut_without_feed(): + """Test cut without feeding paper""" + instance = printer.Dummy() + instance.cut(feed=False) + expected = GS + b'V' + six.int2byte(66) + b'\x00' + assert(instance.output == expected)