Skip to content

Commit d84c478

Browse files
committed
webservice: promote pages to primary option
1 parent 15a77c9 commit d84c478

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

misc/_webservice.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
import os
1616
import subprocess
1717
import sys
18-
import time
1918
from functools import partial
2019
from operator import getitem
2120
from pathlib import Path
22-
from shutil import which
2321
from tempfile import NamedTemporaryFile
2422

2523
import pikepdf
2624
import streamlit as st
27-
from streamlit.components.v1 import iframe
2825

2926
from ocrmypdf._defaults import DEFAULT_ROTATE_PAGES_THRESHOLD
3027

@@ -45,6 +42,10 @@ def get_host_url_with_port(port: int) -> str:
4542

4643
mode = 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+
4849
with 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

6768
with 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

Comments
 (0)