jschildgen / scan_and_mark

0 stars 1 forks source link

import from multiple PDFs #1

Open timobaumann opened 2 months ago

timobaumann commented 2 months ago

Our scanner can't do 300 pages, therefore I scanned in three batches. It would be nice if one could import from multiple PDFs consecutively. The import button is still available after importing but when I pressed it again I got:

Create file 242/242: /home/timo/bin/scan_and_mark/11/22.jpg (0.0?)
org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
    at org.sqlite.core.DB.newSQLException(DB.java:1135)
    at org.sqlite.core.DB.newSQLException(DB.java:1146)
    at org.sqlite.core.DB.execute(DB.java:941)
    at org.sqlite.core.DB.executeUpdate(DB.java:1010)
    at org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$executeLargeUpdate$2(JDBC3PreparedStatement.java:117)
    at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:429)
    at org.sqlite.jdbc3.JDBC3PreparedStatement.executeLargeUpdate(JDBC3PreparedStatement.java:116)
    at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:98)
    at org.example.DB.persist(DB.java:124)
    at org.example.PDFTools.splitPDF(PDFTools.java:42)
    at org.example.Controller.lambda$importPDF$16(Controller.java:504)
    at java.base/java.lang.Thread.run(Thread.java:840)
Create file 1/198: /home/timo/bin/scan_and_mark/1/1.jpg (0.0?)

I believe this is an error? The program should know that it had already created 11 exams and shouldn't overwrite previous files.

jschildgen commented 2 months ago

Currently, it is not possible to import multiple PDFs. I also scan into multiple PDF files, but after that, I create a all-in-one PDF with a merge tool. Then, I import that big file.

I'll keep the status of this ticket open, then we can implement the feature that supports importing multiple PDF files.

timobaumann commented 2 months ago

at that stage one might include simple rotation, etc. operations. our scanner scans best when pages are rotated 180°...