manuc66 / node-hp-scan-to

Allow to send scan from device to computer for some HP All-in-One Printers - Scan to computer
https://manuc66.github.io/node-hp-scan-to/
MIT License
141 stars 23 forks source link

Multi-page Scan #927

Open bouyssic opened 4 days ago

bouyssic commented 4 days ago

Hello!

Just installed this and it's working like a charm. I'll add my printer on the other thread for others to see.

That being said, and I don't know if at all possible, could it be possible to scan several pages in one file?

I don't know if there is a built-in mechanic to do so on the code you reverse engineered.

Another option would be to set a configurable timeout. All scan actions < timeout, would go to the same temp file. If timeout is reached after the last scan, save the temp file to the target Directory and resume waiting

Let me know what you think.

Thanks again

manuc66 commented 4 days ago

Hello,

Some devices support multi-page scanning, and even some with trays support dual-face scanning. Based on my reverse engineering, the printer sends one scan after another. The node-hp-scan-to software recognizes that it's a multi-page scan and waits for the device to signal the end of the scan. Depending on the selected target, node-hp-scan-to may combine all received images into a PDF.

Therefore, the device does not assemble a single document; instead, the software on the computer (in this case, node-hp-scan-to) performs this task.

Technically speaking, node-hp-scan-to includes a PDF generator library that can assemble multiple images into one document (as seen in the current paperless pull request).

It is indeed possible to implement a toggle that would add a timeout delay, allowing the software to wait a bit longer after each received image before releasing all scans in a row. However, this implementation is not trivial and would require reworking some parts of the code.

bouyssic commented 3 days ago

Hello @manuc66 ,

First of all, thanks a lot for the quick and complete answer. Much appreciated.

I understand the situation, then that means my Envy 4521 doesn't support multi-scan, as I don't seem to have an option to do so. It's a shame.

I understand if this implementation is too complex or not worth investment. I'll have to handle the merging on my part when necessary.

Feel free to close it if you wish

Cheers