2023年10月18日 星期三

只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD

系列文章:
01.python 不管何時何地,只要點兩下,資料夾內的所有pdf都會合併成一個pdf
https://skjhcreator.blogspot.com/2022/06/pythonpdfpdf.html
02.python 只要點兩下,分別對各資料夾內的pdf合併,合併後的檔名要讓人知道來自哪個資料夾 
https://skjhcreator.blogspot.com/2022/06/python-pdf.html
03. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF
03.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
04.只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為PDF的檔名
04.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
05.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
05.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
06.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD 
06.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
07.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
07.https://skjhcreator.blogspot.com/2024/09/word-word-pdf.html
08.只要點兩下,就可以將資料夾input內的所有Word通通轉成一個PDF
08.https://skjhcreator.blogspot.com/2025/07/inputwordpdf.html
09.只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF
09.https://skjhcreator.blogspot.com/2025/09/pdfpdf.html
10.只要點兩下,就能將input資料夾內所有PDF進行容量壓縮
10.https://skjhcreator.blogspot.com/2026/04/inputpdf.html

        By simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents, which will be located in the output folder.


        根據上篇只要點兩下,就能將放進input的一堆PDF轉成各自的WORD,發現產出的WORD會跟執行程式PDFTOWORD.exe混在一起。當轉換的檔案多了,恐怕要用人工去一一核對,造成不便。如果產出的產出的WORD會集中在一個output資料夾,只要移動output資料即可。
 
        According to the previous article, by simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents. However, it was found that the generated Word documents are mixed with the execution program PDFTOWORD.exe. When there are multiple converted files, it might be inconvenient to manually check each one. To address this issue, if the generated Word documents are centralized in an output folder, you can simply move the output folder.

下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):
 


以下是開發過程與原始碼 (Development process and code):
 
安裝pdf2docx套件(Install the pdf2docx suite)
指令(command):pip install pdf2docx
 
程式名稱(Program name):PdfToWord01.py
程式內容(Code):
#請安裝套件 pdf2docx
#指令 pip install pdf2docx
from pdf2docx import Converter
import os

#取得當前目錄
Path = os.getcwd()
#取得input路徑
InputPath = Path+'\\input\\'
#取得input資料夾下的目錄或檔案
dirs = os.listdir(InputPath)
#檢查目錄是否存在
if os.path.exists(Path+'\\output'):
    #印出output資料夾存在
    print(Path+'\\output'+' exists!')
else:
    #建立output資料夾
    os.makedirs(Path+'\\output')

if dirs != []:
    for dir in dirs:
        fileName,fileExt = dir.split('.')
        if fileExt.lower() == 'pdf':
            PdfCvWord = Converter(InputPath+dir)
            PdfCvWord.convert(Path+'\\output\\'+fileName+'.docx')
            PdfCvWord.close()
else:
    print('Input is empty!!')



2023年10月17日 星期二

只要點兩下,就能將放進input的一堆PDF轉成各自的WORD

系列文章:
01.python 不管何時何地,只要點兩下,資料夾內的所有pdf都會合併成一個pdf
https://skjhcreator.blogspot.com/2022/06/pythonpdfpdf.html
02.python 只要點兩下,分別對各資料夾內的pdf合併,合併後的檔名要讓人知道來自哪個資料夾 
https://skjhcreator.blogspot.com/2022/06/python-pdf.html
03. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF
03.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
04.只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為PDF的檔名
04.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
05.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
05.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
06.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD 
06.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
07.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
07.https://skjhcreator.blogspot.com/2024/09/word-word-pdf.html
08.只要點兩下,就可以將資料夾input內的所有Word通通轉成一個PDF
08.https://skjhcreator.blogspot.com/2025/07/inputwordpdf.html
09.只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF
09.https://skjhcreator.blogspot.com/2025/09/pdfpdf.html
10.只要點兩下,就能將input資料夾內所有PDF進行容量壓縮
10.https://skjhcreator.blogspot.com/2026/04/inputpdf.html

With just a double-click, you can convert a bunch of PDF files placed in the "input" folder into their respective Word documents.

        最近遇到了問題,希望能將一堆PDF轉成各自的WORD,然後再進行編輯。目前市面上有類似的網站,可以提供PDF轉WORD。偏偏有些機密的PDF就不適合放到那些網站進行轉檔,怕洩密。若要不洩密,仍要轉檔成WORD,則需要購買版權。剛好,Python 就有PDF轉成DOCX的套件。但是需要填入檔名,一個一個地轉。因此,希望能夠有一種程式,只要將一堆的PDF放進INPUT資料夾,接著點兩下,相對應的WORD就會出現。

 Recently, I encountered a problem and I hope to be able to convert a bunch of PDF files into individual Word documents for editing. Currently, there are similar websites available in the market that offer PDF to Word conversion. However, some confidential PDF files are not suitable for uploading to those websites for conversion due to security concerns. If I want to convert them to Word without compromising security, I would need to purchase a license. Luckily, there is a Python package available for converting PDF to DOCX. However, it requires filling in the file name and converting them one by one. Therefore, I would like to have a program where I can simply place a bunch of PDF files in the input folder, double-click, and the corresponding Word documents will be generated.

 

下載檔案解壓密碼:demo1234

Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):
 

 
以下是開發過程與原始碼 (Development process and code):
 
安裝pdf2docx套件(Install the pdf2docx suite)
指令(command):pip install pdf2docx
 
程式名稱(Program name):PdfToWord.py
程式內容(Code):

#請安裝套件 pdf2docx
#指令 pip install pdf2docx
from pdf2docx import Converter
import os

#取得當前目錄
Path = os.getcwd()
#取得input路徑
InputPath = Path+'\\input\\'
#取得input資料夾下的目錄或檔案
dirs = os.listdir(InputPath)

if dirs != []:
    for dir in dirs:
        fileName,fileExt = dir.split('.')
        if fileExt.lower() == 'pdf':
            PdfCvWord = Converter(InputPath+dir)
            PdfCvWord.convert(Path+'\\'+fileName+'.docx')
            PdfCvWord.close()
else:
    print('Input is empty!!')

 
 
資料來源:


2023年9月21日 星期四

解決phpmyadmin出現的警告訊息Warning in ./libraries/sql.lib.php#613

       最近在xubuntu 18.04 LTS 安裝 apache2、php 7.2、phpmyadmin與 MariaDB。當我進入phpmyadmin,出現這樣的錯誤訊息:

Warning in ./libraries/sql.lib.php#613
 count(): Parameter must be an array or an object that implements Countable

解決方式:

1.備份sql.lib.php

$sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak 

2.編輯sql.lib.php

$sudo geany /usr/share/phpmyadmin/libraries/sql.lib.php 

3.將 (count($analyzed_sql_results['select_expr'] == 1) 改為((count($analyzed_sql_results['select_expr']) == 1),實際上只是要新增個括號 )

4.儲存



資料來源:

1.Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

2023年8月24日 星期四

Windows 10 x64 版本1809 LTSC 不能從Miscrosoft store 下載 HEIF extensions 模組的替代方案

       由於Windows 10 x64 版本1809 LTSC 電腦想要觀看蘋果手機的照片,但是照片副檔名卻是HEIC。找谷歌大神求助,發現都要從Miscrosoft store 下載 HEIF extensions 模組。由於某些原因,現在的Windows 10 x64 版本1809 LTSC 電腦無法從Miscrosoft store 下載 HEIF extensions 模組。換言之,現在的Windows 10 x64 版本1809 LTSC 電腦不能看蘋果手機的照片。那我要如何解決這個問題?

        再次找谷歌大神求助,發現資料來源1.1. Windows直接開啟瀏覽HEIF(.heic)格式的照片檔、轉檔JPEG-CopyTrans HEIC for Windows。其中的Windows HEIC照片檢視器,可以免費下載後安裝。安裝完畢後,就可以觀看蘋果手機的照片

資料來源:

2023年6月21日 星期三

只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為PDF的檔名

系列文章:
01.python 不管何時何地,只要點兩下,資料夾內的所有pdf都會合併成一個pdf
https://skjhcreator.blogspot.com/2022/06/pythonpdfpdf.html
02.python 只要點兩下,分別對各資料夾內的pdf合併,合併後的檔名要讓人知道來自哪個資料夾 
https://skjhcreator.blogspot.com/2022/06/python-pdf.html
03. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF
03.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
04.只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為PDF的檔名
04.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
05.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
05.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
06.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD 
06.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
07.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
07.https://skjhcreator.blogspot.com/2024/09/word-word-pdf.html
08.只要點兩下,就可以將資料夾input內的所有Word通通轉成一個PDF
08.https://skjhcreator.blogspot.com/2025/07/inputwordpdf.html
09.只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF
09.https://skjhcreator.blogspot.com/2025/09/pdfpdf.html
10.只要點兩下,就能將input資料夾內所有PDF進行容量壓縮
10.https://skjhcreator.blogspot.com/2026/04/inputpdf.html

 
        Just two clicks and you can convert a bunch of JPGs into a single PDF, with the PDF file named after the folder where the JPGs are located. 

       現在遇到一個問題,這個問題是要將一堆的JPG轉成一個PDF,並且這個PDF的檔名為一堆JPG所在的資料夾名稱。
       I am currently facing an issue where I need to convert a bunch of JPGs into a single PDF, and the PDF file should be named after the folder where the JPGs are located.
 
       在資料來源1.Convert Images to PDF using Python,發現程式碼如下:
       In data source 1, "Convert Images to PDF using Python," I found the following code:
from PIL import Image

image_1 = Image.open(r'path where the image is stored\file name.png')
im_1 = image_1.convert('RGB')
im_1.save(r'path where the pdf will be stored\new file name.pdf')

所以我需要安裝套件 Pillow、jpg檔案位置。
So I need to install the Pillow package and provide the location of the JPG files. 
                     下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):

以下是開發過程與原始碼 (Development process and code):
安裝Pillow套件(Install the Pillow suite)      
安裝套件指令(command):pip install Pillow
 
       程式名稱(Program name):jpg2pdf.py
       程式內容(Code):
from PIL import Image
import os

#取得當前目錄
Path = os.getcwd()
#取得input路徑
InputPath = Path+'\\input\\'
#取得input資料夾下的目錄或檔案
dirs = os.listdir(InputPath)
# 建立字典與串列
pdfname = dict()
pdfadds = []
jpglist = []
#逐一檢查input資料夾下的目錄或檔案
for dir in dirs:
    #print(dir)
    #目錄的處理
    if os.path.isdir(InputPath+'\\'+dir+'\\'):
        pdfadds = os.listdir(InputPath+'\\'+dir)
        pdfname[dir] = pdfadds
    #檔案的處理    
    elif os.path.isfile(InputPath+'\\'+dir):
        #檢查檔案副檔名為jpg
        if dir.split('.')[1] == 'jpg':
            jpglist.append(dir)
# 目錄-> jpglist        
pdfname['input'] = jpglist            

#jpg 轉 pdf
for key in pdfname.keys():
    TempIm_list = []
    Tempk = 0
    TempPdfName = str(key+'.pdf')
    for i in pdfname[key]:
        if key != 'input':
            # 處理放在資料夾內的jpg
            ImagePath = InputPath+'\\'+key+'\\'+i
        elif key == 'input':
            # 處理放在input 的jpg
            ImagePath = InputPath+'\\'+i
        Tempk = Tempk + 1
        if Tempk == 1:
            TempImage_1 = Image.open(ImagePath)
            TempIm_1 = TempImage_1.convert('RGB')
        else:
            TempImage = Image.open(ImagePath)
            TempIm= TempImage.convert('RGB')
            TempIm_list.append(TempIm)
    TempIm_1.save(TempPdfName,save_all=True,append_images=TempIm_list)

       
資料來源:
4.




2023年5月31日 星期三

只要點兩下,就能將一堆的Doc與Docx 轉成 PDF

系列文章:
01.python 不管何時何地,只要點兩下,資料夾內的所有pdf都會合併成一個pdf
https://skjhcreator.blogspot.com/2022/06/pythonpdfpdf.html
02.python 只要點兩下,分別對各資料夾內的pdf合併,合併後的檔名要讓人知道來自哪個資料夾 
https://skjhcreator.blogspot.com/2022/06/python-pdf.html
03. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF
03.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
04.只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為PDF的檔名
04.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
05.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
05.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
06.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD 
06.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
07.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
07.https://skjhcreator.blogspot.com/2024/09/word-word-pdf.html
08.只要點兩下,就可以將資料夾input內的所有Word通通轉成一個PDF
08.https://skjhcreator.blogspot.com/2025/07/inputwordpdf.html
09.只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF
09.https://skjhcreator.blogspot.com/2025/09/pdfpdf.html
10.只要點兩下,就能將input資料夾內所有PDF進行容量壓縮
10.https://skjhcreator.blogspot.com/2026/04/inputpdf.html

Just two clicks and you can convert a bunch of Doc and Docx files into PDF format.
 
        最近遇到一個問題,想要把一堆的Word 轉成PDF。當然可以用手動的方式,一個個用Word打開,另存新檔,然後另存成PDF。可是這樣很麻煩,要是有100多個以上的Doc與Docx,然後要一一打開後再另存成PDF。有沒有更快的方法!!只要讓我點兩下滑鼠,不管有多少個Doc與Docx就能自動轉換成PDF?
 
        I recently encountered a problem where I wanted to convert a bunch of Word files into PDFs. Of course, I could do it manually by opening each file in Word, saving it as a new file, and then saving it as a PDF. But that's very tedious, especially if there are more than 100 Doc and Docx files that need to be converted. Is there a faster way? Ideally, I would like to be able to convert all of the files to PDF with just two clicks of the mouse, regardless of how many Doc and Docx files there are.
                     下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):

安裝pywin32套件(Install the pywin32 suite)
指令(command):pip install pywin32

程式名稱(Program name):Word2Pdf.py
程式內容(Code):
# pip install pywin32
import glob
import os
from win32com import client

path=os.getcwd()
os.chdir(path+'\\input\\')
word = client.Dispatch("Word.Application")

for i in glob.glob('*.doc'):
    print("Convert "+path+'\\input\\'+i+" to PDF!")
    doc = word.Documents.Open(path+'\\input\\'+i)
    doc.SaveAs("{}.pdf".format(path+'\\output\\'+i[:-4]),17)
    print("{}.pdf".format(path+'\\output\\'+i[:-4])+" OK!")
    doc.Close()
for i in glob.glob('*.docx'):
    print("Convert "+path+'\\input\\'+i+" to PDF!")
    docx = word.Documents.Open(path+'\\input\\'+i)
    docx.SaveAs("{}.pdf".format(path+'\\output\\'+i[:-5]),17)
    print("{}.pdf".format(path+'\\output\\'+i[:-5])+" OK!")
    docx.Close()

word.Quit()


資料來源:

2023年4月18日 星期二

只要點兩下,免傳輸線,就能讓學生透過QRcode來傳送IPAD或平板內的檔案


        由於教育部生生有平板計畫,讓每一位學生都能透過IPAD或平板來進行學習。但是在電腦教室內,希望學生能夠將檔案傳到教師電腦。除了傳輸線、隨身碟等這一類的工具,一部一部將檔案傳到老師機。還有其他辦法讓學生將檔案傳到學校老師的電腦裡嗎?要用行動載具來進行教學。若沒有傳輸線,但有區域無線網路與筆電。我該如何將載具內檔案傳送到我的筆電內?
 

只要如上圖布置硬體,下載檔案,解壓縮下載檔案,對著Open.bat點兩下。就能產生QRcode接下來用行動載具拍下此QRcode,就能連接到筆電的HFS。
                     下載檔案解壓密碼:demo1234
使用教學:

        
      以下是程式碼:
目的:只要點兩下,就能產生本機IP的QRcode
程式名稱:IpQRcode.py
程式內容:
import socket
import qrcode

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
print('http://'+ip)
img = qrcode.make('http://'+ip)
img.show()
s.close()

目的:只要點兩下,直接開啟hfs.exe與IpQRCode.exe
程式名稱:Open.bat
程式內容:

@echo off
start %~dp0\IpQRcode\hfs.exe %~dp0\IpQRcode\1.vfs
start %~dp0\IpQRcode\IpQRCode.exe

 

資料來源:

3.HFS 

只要點兩下,就能將input資料夾內所有m4a 轉檔為 mp3

         最近需要將m4a檔案轉檔為mp3,所以寫python程式來處理。希望將很多的m4a放進input資料夾內,只要點兩下滑鼠就能將這些m4a 通通轉檔為 mp3。          Recently, I needed to convert M4A files in...