Skip to content
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

ADF Seperation #1020

Closed
SnowJuli opened this issue Nov 15, 2024 · 6 comments
Closed

ADF Seperation #1020

SnowJuli opened this issue Nov 15, 2024 · 6 comments
Assignees

Comments

@SnowJuli
Copy link

Is your feature request related to a problem? Please describe.
I noticed that when scanning with my Officejet 3830, that when I use the ADF Scanning feature and it uploads the scan to paperless as one document. Which is very unfortunate when I fill up multiple pdfs as content from some random folder I have in my shelves :D

Describe the solution you'd like
An Environment Flag would be nice to automatically seperate the documents into multiple ones before uploading to paperless.

Describe alternatives you've considered
Exchanging the documents one-by-one is very annoying but a workaround.

Additional context
Is it even possible? Or is this an HP limitation?

@manuc66
Copy link
Owner

manuc66 commented Nov 15, 2024

Hi @SnowJuli

I understand your issue. The current behavior of node-hp-scan-to is indeed intended to closely resemble the original hp. For use cases that differ from yours, it can be convenient to have the option to compile multiple pages of the same topic into a single document.

This is not a limitation of the hp devices, as the PDF is not generated by the device itself, but rather by node-hp-scan-to. In reallity I see that I took a design decision to always send pdf to paperless and to always group the scan item into one single pdf.

I think it could be fixed by adding some additional conditional logic here:

displayJpegScan(scanJobContent);
if (scanConfig.paperlessConfig) {
const pdfFilePath = await mergeToPdf(
folder,
scanCount,
scanJobContent,
scanConfig.directoryConfig.filePattern,
scanDate,
!scanConfig.paperlessConfig.keepFiles,
);
if (pdfFilePath) {
await uploadToPaperless(pdfFilePath, scanConfig.paperlessConfig);
await fs.unlink(pdfFilePath);
console.log(
`Pdf document ${pdfFilePath} has removed from the filesystem`,
);
} else {
console.log(
.

It would then preserve the two possibilities:

  • sending all the document in the adf in one single document if you choose pdf as a target
  • sending all the codument in the adf in multiple pdf files if you choose image as a target

Best regards.

@SnowJuli
Copy link
Author

Hello @manuc66 and thanks for your fast reply!

Good to know that its not a HP Limitation and that it could be possible. I would really like some possibility in the future but don't feel pressured just because one person requested it :D
You are doing an amazing work but unfortunately I'm not really fluent in TypeScript so I would rely on other people who have more experience.

Anyways, thanks for your reply and I'll look forward to a change in the future.

manuc66 added a commit that referenced this issue Nov 16, 2024
The different configuration are not supported yet
@manuc66
Copy link
Owner

manuc66 commented Nov 18, 2024

@SnowJuli Are you able to give it a try ?

@SnowJuli
Copy link
Author

Sure, how can I test it?

@manuc66 manuc66 self-assigned this Nov 18, 2024
@manuc66
Copy link
Owner

manuc66 commented Nov 18, 2024

Just pull the new docker image

@manuc66 manuc66 assigned SnowJuli and unassigned SnowJuli and manuc66 Nov 19, 2024
@manuc66
Copy link
Owner

manuc66 commented Nov 22, 2024

I'm closing the issue, it should be fixed with latest docker image, if not working let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants