Code Monkey home page Code Monkey logo

Comments (3)

hiroi-sora avatar hiroi-sora commented on June 27, 2024 1

I apologize for the imperfections in our English documentation. In the future, we will continue to focus on providing convenience for users of multiple languages.

Below is the solution to your request:

Objective: Use CLI to add a PDF document task and generate a double-layer searchable PDF.

This task is not within the preset quick commands, so it is relatively cumbersome and requires multiple consecutive commands to achieve.

Procedure:

  1. (Optional) If the Batch Documents OCR tab is not currently open, open it:

    • 1.1. Query all current page templates:
    ./umi-ocr --all_pages
    • 1.2. It is known that the template_index of the BatchDOC tab is 3. Create this tab:
    ./umi-ocr --add_page 3
    • 1.3. Check if the BatchDOC module already exists:
    ./umi-ocr --all_modules
    • If BatchDOC_1 is found in Qml modules, then it is correct.
  2. Input the paths of multiple documents into the software:

    • Suppose you want to add the following files:
    C:\Users\My\Desktop\111.epub
    C:\Users\My\Desktop\222.pdf
    • Use the following command to input the document paths (the \ in the path needs to be changed to /):
    ./umi-ocr --call_qml BatchDOC --func addDocs '[\"C:/Users/My/Desktop/111.epub\",\"C:/Users/My/Desktop/222.pdf\"]'
    • Note that the format of the addDocs parameter is: '[\"document path\",\"document path\"...]'. Also, backticks \ cannot be used in the path; / must be used instead.
  3. Start the task:

    ./umi-ocr --call_qml BatchDOC --func docStart
    • Currently, it is not possible to change the file type to be saved via CLI (the default is layered.pdf Double-layer Searchable Document). To add other save types, you must check them in the software interface.

from umi-ocr.

alysonhower avatar alysonhower commented on June 27, 2024
./umi-ocr --call_qml BatchDOC --func docStart

Thank you for the quick response and detailed step-by-step instructions! Problem solved! With your help I was able to process the documents despite having experienced some difficulties when using a more recent version of PowerShell (version 7.4.2); so to make it work I have to run the commands using Windows PowerShell version 5.1.22621.2506 (the default version preinstalled on Windows 11). If you are curious, please see how I proceeded below:

  1. Initially, when running the commands as directed using PowerShell version 7.4.2, only the following commands appear to execute correctly: ".\Umi-OCR.exe --all_pages" and ".\Umi-OCR.exe --add_page 3". The above commands launch the application and open the Batch Documents OCR page respectively.

  2. After running the previous commands using PowerShell version 7.4.2 the following commands DO NOT run or DO NOT appear to run: ".\Umi-OCR.exe --call_qml BatchDOC --func addDocs '["C:/Users /account/Downloads/example.pdf"]'" and ".\Umi-OCR.exe --call_qml BatchDOC --func docStart". Although they do not execute effectively the message 'Calling "docStart" in main thread.' is returned as if something where happening, but I can't see any CPU stress or memory usage and no document is created.

After failing to execute several attempts using the previous commands, I realized I was using the Windows Terminal which in turn was launching PowerShell (version 7.4.2); So, I tried launching the same commands in the same order however this time using Windows PowerShell version 5.1.22621.2506 and luckily everything worked correctly!

Thank you for your help! You're doing an awesome job and making my life easier so please wait for me to buy you some coffees or provide you with any help here if you need! Much love and affection from your friend in Brazil

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on June 27, 2024

commands DO NOT run or DO NOT appear to run

This issue is most likely caused by incorrect parsing of double quotes " by Windows PowerShell. Additionally, the parsing rules differ between PowerShell and Terminal, resulting in different formats for the paths array that we need to input:

  • In PowerShell, the outermost layer of the array should be enclosed in single quotes ', and there must be a space before each double quote. That is: addDocs '[■\"path_1\",■\"path_2\",■\"path_3\"]' (replace with a space ).
  • In Terminal, the outermost layer of the array should be enclosed in double quotes ". That is: addDocs "[\"path_1\",\"path_2\",\"path_3\"]".

The above commands have been tested and work on the latest Windows 11. There may be slight differences in other versions of the system.

Microsoft make something as simple as quoting strings a convoluted mess. 😂

from umi-ocr.

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.