OSS-DocumentScanner icon indicating copy to clipboard operation
OSS-DocumentScanner copied to clipboard

more exporting options(backup)

Open Bertklq1 opened this issue 1 year ago • 6 comments

An option to inclued scanned documents to backup while exporting app's settings.

Bertklq1 avatar May 15 '24 05:05 Bertklq1

@Bertklq1 good idea. it is something i want to do at one point.

farfromrefug avatar May 15 '24 11:05 farfromrefug

As a stopgap solution, it would be nice to have a script that can build the pdfs from the exported data on a PC.

This is what I use, but it does not add OCR'd text to the file.

import os
import json
from PIL import Image

for l in os.listdir("Scans"):
    obj = json.load(open(os.path.join("Scans", l, "data.json")))
    print("Building", obj["name"])
    pages = []
    for im in obj["pagesOrder"]:
        pages.append(Image.open(os.path.join("Scans",l,im,"image.jpg")))
    pdfpath = os.path.join("Scans_pdf", obj["name"]+".pdf")
    pages[0].save(pdfpath, "PDF", resolution=100, save_all=True, append_images=pages[1:])

DhruvaSambrani avatar May 15 '24 15:05 DhruvaSambrani

@DhruvaSambrani Why do you need that? I mean if you use the app on android you can export PDFs from there? In the future i will add a way to sync documents PFDs to a folder on the phone (might be android only). Though all those devs take time. So not sure when

farfromrefug avatar May 15 '24 19:05 farfromrefug

I am using the webdav backup more as a webdav sync option. The webdav also is synced to my laptop so that anytime i want to pull a specific document to share etc, its available on both my devices. However, the current webdav export only exports the images and metadata, not the pdf itself (I understand that you want to add it at a later time), so the easiest way currently is to run the script to build the pdfs on the laptop.

DhruvaSambrani avatar May 16 '24 11:05 DhruvaSambrani

@DhruvaSambrani i understand. Just know that some transformations are not directly applied on image (brightness, contrast, filters...) so your script also would not have it. Yes i intend to do it at one point. TBH it depends on the time/funding i get for that app. Right now it is pretty low and it is really hard to keep on working so much on this app while not bringing food to the table.

farfromrefug avatar May 16 '24 14:05 farfromrefug