1515import os
1616import subprocess
1717import sys
18- import time
1918from functools import partial
2019from operator import getitem
2120from pathlib import Path
22- from shutil import which
2321from tempfile import NamedTemporaryFile
2422
2523import pikepdf
2624import streamlit as st
27- from streamlit .components .v1 import iframe
2825
2926from ocrmypdf ._defaults import DEFAULT_ROTATE_PAGES_THRESHOLD
3027
@@ -45,6 +42,10 @@ def get_host_url_with_port(port: int) -> str:
4542
4643mode = st .selectbox ("Mode" , options = ["normal" , "skip-text" , "force-ocr" , "redo-ocr" ])
4744
45+ pages = st .text_input (
46+ "Pages" , value = "" , help = "Comma-separated list of pages to process"
47+ )
48+
4849with st .expander ("Input options" ):
4950 invalidate_digital_signatures = st .checkbox (
5051 "Invalidate digital signatures" , value = False
@@ -66,11 +67,11 @@ def get_host_url_with_port(port: int) -> str:
6667
6768with st .expander ("Output options" ):
6869 output_type = st .selectbox (
69- "Output type" , options = ["pdfa" , "pdfa " , "pdfa-1" , "pdfa-2" , "pdfa-3" , "none" ]
70+ "Output type" , options = ["pdfa" , "pdf " , "pdfa-1" , "pdfa-2" , "pdfa-3" , "none" ]
7071 )
7172
7273 pdf_renderer = st .selectbox (
73- "PDF rendereer " , options = ["auto" , "hocr" , "hocrdebug" , "sandwich" ]
74+ "PDF renderer " , options = ["auto" , "hocr" , "hocrdebug" , "sandwich" ]
7475 )
7576
7677 optimize = st .selectbox ("Optimize" , options = ["0" , "1" , "2" , "3" ])
@@ -106,9 +107,6 @@ def get_host_url_with_port(port: int) -> str:
106107 value = os .cpu_count (),
107108 key = "threads" ,
108109 )
109- pages = st .text_input (
110- "Pages" , value = "" , help = "Comma-separated list of pages to process"
111- )
112110 max_image_mpixels = st .number_input (
113111 "Max image size" ,
114112 value = 250.0 ,
0 commit comments