-
Notifications
You must be signed in to change notification settings - Fork 33
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
setting up for printing #1
Comments
Oh, I see you already posted :) To sum up, following issues need some attention:
|
Hello i have the same Problem 'ModuleNotFoundError: No module named 'niimprint'' i try to set PYTONPATH, but which path i need to set ? Where is the module niimprint located ? |
@yveszemp set it to the root directory of the project (directory with If you're on windows: |
wow great, many thanks for the ultra fast Reply. now it works. |
a little question, is there a way to support to print PDF ? |
@yveszemp well, yes, but it needs to be implemented. Right now it's only possible by converting pdf into image |
ok great, i will check to convert the file. Many Thanks. |
transcription of my problems setting up the printer:
Андрей:
Hi, try running export PYTHONPATH=$(pwd) before running the python command. You should use python3
me:
now i get farther:
python3 niimprint -m b1 -i testqr.png
opening testqr.png
size : 171x171
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/bboett/AndroidStudioProjects/niimprint/niimprint/main.py", line 82, in
print_cmd()
File "/usr/lib/python3/dist-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bboett/AndroidStudioProjects/niimprint/niimprint/main.py", line 78, in print_cmd
printer.print_image(image, density=density)
File "/home/bboett/AndroidStudioProjects/niimprint/niimprint/printer.py", line 104, in print_image
self.set_label_density(density)
File "/home/bboett/AndroidStudioProjects/niimprint/niimprint/printer.py", line 253, in set_label_density
return bool(packet.data[0])
^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'data'
Андрей:
Sorry, the error message is a little cryptic, I'll fix it later. Basically, it means your printer doesn't respond for some reason... I'm assuming you're connecting it via USB and relying on auto-detecting the serial port. Can you show me the output of lsusb command (list usb devices) and also ls /dev/serial/by-id (list serial ports). Also check if your printer is turned on: when you connect it via USB, it starts charging, but you need to press the power button for it to power on.
me:
and eventually if you can help me out with the printing itself....? i have some strangeness... i print out a qr code, source is a svg file to allow easier testing.... so at 300 i hit the too big limit.... 299 prints out the qr code with 1cm place left on the left side, and cutting off the last 3mm on the bottom.....
and thats completely weird??
the labels are 4cm wide and 6 cm long, so depth should really are a problem, and i should be able to use the full width?
so there is some systemic problem i don´t seem to grasp...
Андрей :
About your images, Right now the code is a little naive and probably just uses some default value (72dpi probably). So my advice to you is to use a .png right now. To print on a 40x60 mm label you should pass a 320x480px image (8px/mm, as said in the readme). Also, these printers are not very accurate in terms of print alignment, so don't try to print something very close to label edges (add a 1-3mm margin).
me:
the strange thing is, i just tested with an image with some text, and now i can address the full width.... (need to look if there are 5cm wide labels now :D ) and indeed you are right with the margins.... depending on how good the roll is aligned you can have bad surprises,,,,,
so the problem probably is my generated qr code.... will have to dig into the svg file itself :(
again:
anyway thanks a lot for helping me set this up
and thanks for your efforts for this project!
ciao
bboett
The text was updated successfully, but these errors were encountered: