naohiro701 commited on
Commit
df26d41
·
verified ·
1 Parent(s): 423e0a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -21,8 +21,19 @@ if uploaded_file is not None:
21
  if st.button("変換開始"):
22
  try:
23
  with st.spinner("PDFを画像に変換中..."):
 
 
 
 
 
 
 
 
 
 
 
24
  # PDFを画像に変換
25
- images = convert_from_bytes(uploaded_file.read(), dpi=dpi)
26
 
27
  # ZIPファイルの作成
28
  zip_buffer = io.BytesIO()
 
21
  if st.button("変換開始"):
22
  try:
23
  with st.spinner("PDFを画像に変換中..."):
24
+ # Poppler のパスを指定(必要に応じて)
25
+ # 例: Windowsの場合 'C:\\poppler-xx\\bin'
26
+ # Mac/Linuxの場合通常は PATH に追加済み
27
+ poppler_path = None # 必要に応じて設定
28
+
29
+ # 例: Windowsの場合
30
+ # poppler_path = 'C:\\poppler-xx\\bin'
31
+
32
+ # 例: macOS/Linuxで Poppler が /usr/bin にある場合
33
+ # poppler_path = '/usr/bin'
34
+
35
  # PDFを画像に変換
36
+ images = convert_from_bytes(uploaded_file.read(), dpi=dpi, poppler_path=poppler_path)
37
 
38
  # ZIPファイルの作成
39
  zip_buffer = io.BytesIO()