Giter Club home page Giter Club logo

Comments (14)

paulgessinger avatar paulgessinger commented on June 1, 2024 2

In principle, this could use the same code path as the current camera scanning functionality, creating a PDF on the phone and then uploading that to the server.

I'll look into it!

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024 1

@peterlang-p I think I got it. If the image is not already written to a temporary file (like when you share a screenshot), it's passed as a different data type. I'll add a workaround for the screenshot case, maybe that works for the LIDL app as well. Stay tuned.

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024 1

Ok @peterlang-p, I'll improve the error output next and see if we can sort out what's the issue here.

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

@peterlang-p this is now in build 61 on TestFlight. Could you check it out and let me know what you think? It should now be possible to:

  • Share photos from other apps via the share sheet
  • Select photos from the camera roll from the + button in the top right
  • Select photos from the files app from the + button in the top right
  • Import multiple inputs from files app and share sheet. If multiple images are given, they are always combined into a single PDF.

from swift-paperless.

peterlang-p avatar peterlang-p commented on June 1, 2024

Awesome, thank you @paulgessinger!

I just had a look and here are my findings:

  • sharing from fotos app works perfectly fine
  • sharing from mail app works perfectly fine
  • importing images via the + button in the paperless app works fine
    -> I noticed the selection of fotos seems not to be reset. When I reopen this dialog all previously selected images are still selected and I need to deselect them first in order to create a new upload
  • conversion of the image(s) to pdf is great, even if the file size is a bit large
  • sharing from the LIDL app, results in "invalidAttachment"

In regards to the LIDL "issue,":
It seems that when I click on the share option in the LIDL app, instead of directly accessing the share dialog, it scrolls down and takes a screenshot of the entire receipt. Following this, the share dialog finally appears. However, when attempting to share it to paperless from this point, I encounter the "invalidAttachment" error.

By first saving the screenshot to the camera roll and then importing it from there, I'm able to successfully share the receipt to paperless without any issues.

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

@peterlang-p could you share your logs from after the LIDL export fails with "invalidAttachment" (I need to improve the error output here in any case.)

from swift-paperless.

peterlang-p avatar peterlang-p commented on June 1, 2024

Certainly. However, unfortunately, there doesn't seem to be anything visible in the logs when I attempt to share from the LIDL app. Nevertheless, I'll send them to you via email.

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

@peterlang-p can you try build 65 on TestFlight?

from swift-paperless.

peterlang-p avatar peterlang-p commented on June 1, 2024

@peterlang-p can you try build 65 on TestFlight?

Just gave it a try and I'm afraid I still get the "invalidAttachment" error, when trying to share from the LIDL app. But I noticed that the share dialog in the LIDL app does not have a preview compared to "normal" screenshots. Maybe that helps.
IMG_8736
IMG_8739

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

@peterlang-p build 67 on TestFlight now has a view in case of invalidAttachment that allows you to export the logs from the correct process (i.e. the share extension). Could you give that a shot?

from swift-paperless.

peterlang-p avatar peterlang-p commented on June 1, 2024

Hey @paulgessinger
I just tested build 67 and I cannot reproduce the error anymore. Sharing directly from the Lidl app works perfectly now. I noticed it’s imported as a png now instead of pdf but that’s totally fine for me.
Thank you so much for adding that feature.
And let me know when I can help / test something more.

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

Awesome!

Indeed, I had to change the way incoming images are handled: I was converting them to a PDF right in the share extension before, but I realized that this causes the extension to go over the 120M memory limit imposed by the OS quite frequently. Instead, I'm now just POST'ing the incoming image to Paperless-ngx, which will create a PDF from it in the backend.

I believe in the end you should end up with a PDF in Paperless-ngx, right?

from swift-paperless.

peterlang-p avatar peterlang-p commented on June 1, 2024

IMG_8748

It seems to stay as a png in paperless as far as I can see, but maybe there’s a config in paperless for conversion that I might have missed.
For me png is totally fine for these receipts, tho 🎉

from swift-paperless.

paulgessinger avatar paulgessinger commented on June 1, 2024

@peterlang-p I think this is just the original file name though. The OCR result pretty much has to be stored in a PDF, and indeed in my testing I'm able to select text in the document view on the right on the web interface after the processing has been completed.

from swift-paperless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.