printers | Mainly Ricoh
kandi X-RAY | printers Summary
kandi X-RAY | printers Summary
Whenever my organization hires or fires someone, I have to go into each of our 5 printers and add/remove the user. This is often the step I forget to do, and it's definitely the one I like the least. So I've written a python wrapper for dealing with these machines from Hell.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Add a user
- Wraps a SOAP request
- Get tagid from userid
- Returns SOAP headers
- Disconnect from the server
- Delete a user
printers Key Features
printers Examples and Code Snippets
Community Discussions
Trending Discussions on printers
QUESTION
The following code snippet should return the Media Trays available to a printer.
However, with some drivers, specifically Ricoh PCL6 Driver for Universal Print
and HP Universal Printing PCL 6
, in addition to Printer Trays, these drivers also list paper types such as Recycled
, Thick
, Matte
, etc.
From what I can tell, OpenJDK is properly using DC_BINNAMES
when calling DeviceCapabilities
. OpenJDK doesn't even seem to use DC_MEDIATYPENAMES
at all in the source code, so I wouldn't expect e.g. Purple Paper
to even be a queryable property, yet it lists when querying trays from the Ricoh driver.
So what's wrong? Are these PCL 6 drivers just bugged? Is DeviceCapabilities
at fault? Or does the bug live in OpenJDK?
ANSWER
Answered 2022-Mar-25 at 02:01The drivers are bugged. Workarounds exists, but they are complex.
The short:- Match driver name on
Ricoh|HP
andPCL6|PCL 6
- Filter any trayIds > 1000
Some drivers such as HP expose the printer trays properly in other areas, for example:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\\PrinterDriverData
InputSlot
InputSlotDisplayNames
... however this isn't true for drivers such as Ricoh.
After examining a lot of drivers (HP, Ricoh, Xerox, Konica, etc) I've isolated the issue to the following:
- PCL6 drivers
- HP or Ricoh as the vendor
In cases with both vendors, the DC_BINS
value is always > 1000, which is partially explained in the PCL6 MediaSource
specification, quoting:
"... External input trays
1
through248
are selected by substituting the values8
through255
for the enumerated values. Example,8
=first external input tray
,9
=second external input tray
, etc. ..."
Although there's nothing about the 1,000 specifically, and vendors such as Xerox use values over 7000 without the bug. That said, with the problematic vendors, what is observed is that when values are > 1,000 they tend to be actually valid MediaType
values (NOT MediaSource
values), but incremented by 1,000.
Oddly enough, this is very limited to HP and Ricoh and does not apply to other PCL drivers. For example:
- Konica uses trayID of
1000
=LCT
, or "Large Capacity Tray", which is valid. - Xerox offers a PCL6 driver, but commonly uses trayIDs higher than 1000, e.g.
7153
=Tray 1
,7154
=Tray 2
. - Ricoh is known to use trayID of
1025
in the PCL5 version of its driver, which is a valid tray value of1025
=Auto Tray Select
, but this doesn't seem to be the case for their PCL6 driver, which has theMediaType
values mixed in.
So to "fix" this issue, I wrote a series of custom parsing to find out the driver vendor and the tray id.
To locate the trayId from Java:
QUESTION
I am trying to read cells from .xls file and place them into particular spots in a static text and then have that generated as .txt file.
I managed to write code that generates what I need, but it only works for the first row in the .xls file. It generates 4 files according to the number of rows, but every file has values from the first row. I understand that I have static cell values for the first row in the code, but I am not sure how to amend this and get the code to go row by row/cell by cell and generate relevant .txt file for each row. My guess is that it needs to be incorporated into the for loop somehow?
For context, each row represents one printer, and these files are then used to import the printers into a system.
I'll be glad for any help/suggestions.
This is what my test .xls file looks like
...ANSWER
Answered 2022-Mar-08 at 21:19The following code works fine on my computer after creating an Excel file with your sample data. Here's what I changed to make it work: The second for loop wasn't necessary so I removed it and outdented the code that was formerly in that loop. I changed the range()
invocation to start at one and go one past the number of rows since the row numbers start at zero in xlrd. And I changed the .cell
method calls to use the row
variable instead of always getting values from row one.
QUESTION
I am using Python3.9 and pandas.
I am trying to build a DataFrame, but during execution I get this error:
...ANSWER
Answered 2022-Feb-25 at 17:41If I understand correctly, I think your issue is you are appending a list to a list, therefore creating a list of lists of length 1, even though you have 14 elements in the nested list.
There are a few ways to handle this. You can go into the list item by list indexing, i.e. printer[0]
, and access the data you intended.
Another way it can be handled is to use list comprehension to unpack the list when appending. Something like this:
_ = [printers.append(thing) for thing in someList]
or
printers = [thing for thing in someList]
You may also want to consider creating a separate list variable instead of doing everything inside the append method.
QUESTION
I've come across this problem many times over the years and still live in hope that there is an easy way to do this that I have missed. I work with barcodes a lot. They are usually made of black dots or lines on a white background. Barcode readers generally work faster and more accurately when the edges are crisp and then size of the lines or dots are precise.
Most barcode generation algorithms will give you a compact barcode usually with the smallest element size being one pixel. A typical QR code could fit in a 21 x 21 grid. This would be too small to see if printed pixel to pixel on most printers and would typically be scaled up. The result of scaling it up depends on the method used and although sometimes you are given a choice, often you have no options that make the image suitable. Even printing directly will often give you expected gray artefacts or forms of dithering. The most consistent way I have found is to scale the images before they are use daily in other places such as Microsoft Word, lightburn and a few others I use that still give me a headache.
Below I will go through what I have tried and show the results. I am limiting this to bitmaps only because using vectors here is not something I need on my current project.
My current best resolution is not pretty, it is slow and although I could improve the speed by locking the bits in the bitmap, I am hoping someone has a really simple answer that I had totally missed on my search again this time.
Here is an image of a simple QR code blown up in GIMP.
The problem is, if it is scaled up, it'll often end up looking like this:
Below I created a small test program to go through all the different modes I know of and then generate a matrix of images which I have reproduced below. The version I currently use is Mode 99 which involves inspecting each pixel and drawing a square.
Does anyone have any better ideas?
...ANSWER
Answered 2022-Feb-09 at 19:27You can use a library like ImageTracer.NET to convert the image to a vector image, then it'll scale as big as you need:
QUESTION
I'm trying to create a Printing Server in rust and face a problem when trying to send JSON as a response.
I've found on the Rocket documentation that is really easy to send JSON as a response: You just have to use the Serde library.
Unfortunatly, that wasn't so simple for me...
Here is my current code :
...ANSWER
Answered 2021-Aug-06 at 14:23You are using rocket 0.5.0-rc.1 and rocket_contrib 0.4.10. While Json
from rocket_contrib does implement Responder
, it implements the Responder
trait of Rocket v4, not that of Rocket v5.
In Rocket v5, Json
is not part of rocket_contib
anymore, but included in the rocket
crate (note that you need to enable the json
feature on the rocket
crate):
QUESTION
I recently started getting into PowerShell with very basic lines/scripts. I need some assistance with a printer script that I have that runs under a user's login at logon.
Currently, every time the users log in the printer script will run (even if the printers are added, it will re-add them). This takes a while each time and I feel I could be smarter about how this is done.
I'd like to reconfigure the script to only run if the printers do not exist.
Below is my code:
...ANSWER
Answered 2022-Jan-17 at 23:36Continuing from my comment, here's an approach you can take:
QUESTION
What are those controls on the right side of the Windows settings app?
The closest control I could find in the XAML Controls Gallery app are Expander
s, but they do not seem to offer the same functionality (expanding either up and down, no way to specify a title (such as "Printers & scanners") and a subtitle (such as "Preferences, troubleshoot") in addition to content (such as the "Add device" button in the screenshot).
How can I achieve a similar look and behavior in my UWP app with WinUI 2.7?
...ANSWER
Answered 2022-Jan-15 at 05:05Not sure exactly the control they are using, but you can get a pretty similar style using a ListView and Expanders.
Here's the outcome I got: Expander List Image
My XAML code:
QUESTION
i am looking for a way to take a script that I have created. And simply run it against the individual printers all at once. I do not care about returning any information other than success or failure if that is possible.
so far this is what I have come up with:
...ANSWER
Answered 2022-Jan-07 at 07:19As stated in above comment. I'd try to run the scriptblock via Invoke-Command
with the -AsJob
parameter. Which will return a job, that you can await. Combined with PSRemoting you can fire multiple Invoke-Command
s that'll return a job to a remote execution. See the PowerShell docu for an example. If you need to pass local parameters to the remote job, in a readonly manner, see this example.
QUESTION
as the title states,
I am having trouble displaying my webpage properly on other screen resolutions.
I am not certain why it looks so bad on other screen resolutions and not scaling to the device itself.
I don't know exactly where to start, I would think that it has something to do with the way that I positioned my div containers but I am not too sure...
and would like a more experienced person to answer my question before I started messing with the code.
below is my HTML, CSS code:
...ANSWER
Answered 2022-Jan-04 at 19:50I advise you to follow many good techniques when developing a responsive webpage, here I explain to you:
- Replacing in your CSS absolute units such as px for percentages or em. It is always much better to work with relative measurements rather than absolute ones. From my experience, I always try to work with em, here is a conversion from px to em.
- Using responsive layouts like flex or grid.
- Adding metadata related to the viewport in the HTML head tag. I can see you haven't written it. As we can read in W3Schools viewport is the user's visible area of a web page. It varies with the device so it will be smaller on a mobile phone than on a computer screen. You should include the following element in all your web pages:
In conclusion, try to avoid absolute positioning because it is not the best option. Try to follow this advice and I am sure your webpage will turn so much better. :D.
QUESTION
I'm working on a software project which I've created with Electron and React. I didn't create the project from scratch, I am using a boilerplate which uses Webpack.
The software is for managing (selling & redeeming) vouchers, so I also have to print some receipts. Using the printer over network is working fine, just as it should. For printing I'm using the node-thermal-printer
package (https://www.npmjs.com/package/node-thermal-printer).
But some of the printers don't have a network interface, just USB or Serial.
When using the node-thermal-printer
with a USB connected printer, you have to provide a "driver" to be able to print. They suggest either the electron-printer
or printer
module, which both seem to be native NodeJS modules.
The boilerplate seems to compile the native modules for the architecture that is currently used and creates a *.node
file, which is copied to the .wepback/
folder during the build phase. But as soon as I want to use the package, I get an error that the module could not be found.
I'm importing the module with the following line:
const printerDriver = require("printer");
When running npm start
the native dependencies are compiled and a node_printer.node
file is created and copied to .webpack/main/native_modules/lib/node_printer.node
.
As soon as I click the button for printing, I receive the following error:
...ANSWER
Answered 2022-Jan-04 at 15:33Instead of hardcoding the absolute path in the require you can just reconstruct it using a solution like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install printers
You can use printers like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page