Multiple cupsWriteRequestData for a single file? #98
Replies: 3 comments 1 reply
-
Never mind. I just scrolled down to find the example that said what the documentation for the call didn't. `FILE *fp = fopen("filename.pdf", "rb"); if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info, if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest, fclose(fp);` |
Beta Was this translation helpful? Give feedback.
-
I wouldn't close it just yet. This section of the documentation needs to state a single file or data stream may be broken up into multiple small writes to conserve resources. While I'm being a documentation PITA, cupsLastError() and cupsLastErrorString() are mentioned all over in the documentation, but they have no links on the left and the internal links don't work. https://openprinting.github.io/cups/libcups/cupspm.html#cupsLastErrorString |
Beta Was this translation helpful? Give feedback.
-
Sure. I'm a bit of a documentation Nazi. |
Beta Was this translation helpful? Give feedback.
-
The documentation is unclear. I suspect it is a Highlander situation; "There can be only one"; but wish to ask if it is possible to have multiple
cupsWriteRequestData()
calls for a single file print job?The way the doc reads, everything must fit into RAM on the device using Cups to print. While my development machines mostly have 120GB of RAM, I have developed for and used Linux on embedded systems which only have 512MB of RAM but usually have 16-64GB industrial grade MicroSD storage. Such devices are really common. You might have seen this device
Original version only transmitted to medical records systems but more and more medical devices are being asked to print for security reasons. (Neither Russia nor North Korea can hack a piece of paper.) Original version of that only had 512MB, I was on the team that created it.
These tiny battery powered systems need the ability to chunk a file N-bytes at a time because they do not have enough physical RAM to load the file even if the entire application is removed.
Even live power systems when you get into mobile or other cellular network transfers in rural America (or any other rural situation) generally can't maintain a connection for a large packet. The connection could have trouble and come back with lots of small packets, but one big one will be a problem.
Thanks for all the assistance and any feedback.
Beta Was this translation helpful? Give feedback.
All reactions