-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Proof images: allow users to upload PDFs #513
Comments
I gave it a try locally, it's already possible to send a PDF as a proof, which is correctly recognized as PDF by the backend ( $ http -vv -f POST http://127.0.0.1:8000/api/v1/proofs/upload Authorization:'Bearer raphael0202__U32031dfc-4aa1-42ba-9338-fa1007d2cbcd' file@'jzvj6BkWWT.webp;type=application/pdf' type=RECEIPT
HTTP/1.1 201 Created
Allow: POST
Connection: keep-alive
Content-Length: 398
Content-Type: application/json
Cross-Origin-Opener-Policy: same-origin
Date: Wed, 30 Oct 2024 17:13:53 GMT
Referrer-Policy: same-origin
Server: nginx/1.25.5
Vary: origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
{
"created": "2024-10-30T17:13:53.308943Z",
"currency": null,
"date": null,
"file_path": "0001/4pF30LqQob.pdf",
"id": 17,
"image_thumb_path": null,
"location": null,
"location_id": null,
"location_osm_id": null,
"location_osm_type": null,
"mimetype": "application/pdf",
"owner": "raphael0202",
"price_count": 0,
"receipt_price_count": null,
"receipt_price_total": null,
"type": "PRICE_TAG",
"updated": "2024-10-30T17:13:53.309166Z"
} We can either create an image from the PDF, or support PDF display for proofs on the front-end. |
mogrify ? |
https://levelup.gitconnected.com/4-python-libraries-to-convert-pdf-to-images-7a09eba83a09
Ideally 1 PDF --> 1 image (even if the PDF has multiple pages) |
Story
Some users receive their receipts through email, in a PDF format.
They currently need to take a screenshot of the receipt in order to upload it to Open Prices.
We could allow uploading PDFs instead, and transform them into images directly in the backend.
The text was updated successfully, but these errors were encountered: