簡單的實用程序,用於將Microsoft Word文檔'.doc',Microsoft Excel'.xls'和Microsoft PowerPoint .PPT文件轉換為任何其他支持的格式,例如.txt .csv .rtf .pdf。
也可以用於將.txt,.rtf,.csv轉換為.doc,.xls或.pdf格式。
可用於將舊的Word文檔轉換為最新格式。
必須在主機機上安裝Microsoft Word,Excel或PowerPoint。
從GitHub發行下載發布-https://github.com/tobya/docto/releases/更多信息,請訪問https://tobya.github.io/docto/
更多示例可用
從版本下載.exe https://github.com/tobya/docto/Releases
也可以通過巧克力安裝
巧克力安裝醫生
升級到最新版本
巧克力升級Docto
節點包裝器由@kerimg&@brrd創建
https://www.npmjs.com/package/node-docto
https://github.com/brrd/msoconvert
請記錄任何錯誤,功能或建議的問題。
將Microsoft Word文檔轉換為文本
docto -f C:DirectoryMyFile.doc -O "C:Output DirectoryMyTextFile.txt" -T wdFormatText
將Microsoft Excel文檔轉換為CSV文本
docto -XL -f C:DirectoryMyFile.xls -O "C:Output DirectoryMyTextFile.csv" -T xlCSV
將Microsoft Word文檔轉換為PDF(需要支持此功能的Microsoft Word版本)。
docto -f C:DirectoryMyFile.doc -O "C:Output DirectoryMyTextFile.pdf" -T wdFormatPDF
將目錄中的所有Microsoft Word文檔轉換為PDF
docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF -OX .pdf
轉換後刪除原始文件(-r)。
docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF -OX .pdf -R true
添加一個webhook在每個轉換(-w)上發射
docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF -OX .pdf -W https://toflidium.com/webhooks/docto/webhook_test.php
Webhook是一個可以在每個CONTRAMITION上調用的URL,以使您能夠在文件轉換時在外部進行重擊。當前https地址是實驗性的,因此如果您有任何問題,請記錄問題。
如果您在野外在某處使用Docto,請在此Wiki頁面中添加詳細信息
如果您需要在OneDrive / Office365 / Word 20xx上升級一堆文件以工作而無需轉換,則可以使用Docto。查看這個stackexchange問題
https://webapps.stackexchange.com/questions/74859/what format-does-word-online-use
Help
Docto Version:%s
Office Version : %s
Open Source: https://github.com/tobya/DocTo/
Description: DocTo converts Word Documents and Excel Spreadsheets to other formats.
Command Line Parameters:
Each Parameter should be followed by its value eg
-f "c:DocsMyDoc.doc"
Parameters markers are case insensitive.
-H This message
--HELP -?
-WD Use Word for Converstion (Default). Help '-h -wd'
--word
-XL Use Excel for Conversion. Help '-h -xl'
--excel
-PP Use Powerpoint for Conversion. help '-h -pp'
--powerpoint
-VS Use Visio for Conversion.
--visio
-F Input File or Directory
--inputfile
-FX Input file search for if -f is directory. Can use .rtf test*.txt etc
Default ".doc*" (will find ".docx" also)
--inputextension
-O Output File or Directory to place converted Docs
--outputfile
-OX Output Extension if -F is Directory. Please include '.' eg. '.pdf' .
If not provided, pulled from standard list.
--outputextension
-T Format(Type) to convert file to, either integer or wdSaveFormat constant.
Available from
https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.wdsaveformat
or https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.xlfileformat
or https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.saveas
See current List Below.
--format
-TF Force Format. -T value if an integer, is checked against current list
compiled in. It is not passed if unavailable. -TF will pass through value
without checking. Word will return an "EOleException Value out of range"
error if invalid. Use instead of -T.
--forceformat
-L Log Level Integer: 1 ERRORS 2 STANDARD 5 CHATTY 9 DEBUG 10 VERBOSE. Default: 2=STANDARD
--loglevel
-C Compatibility Mode Integer. Set to an INTEGER value from
https://msdn.microsoft.com/en-us/library/office/ff192388.aspx.
Set the compatibility mode when you want to convert documents to a later
version of word. See help '-h -c' for further info.
--compatibility
-E Encoding Integer: Sets codepage Encoding. See
https://msdn.microsoft.com/en-us/library/office/ff860880.aspx
for more details and values.
--encoding
-M Ignore all files in __MACOSX subdirectory if it exists. Default True.
--ignoremacos
-N Make list of files that take over n seconds to complete.
Use number of seconds over that conversion takes and add to list.
Outputs to filename 'docto.ignore.txt'
--listlongrunning
-NX Ignore any file listed in docto.ignore.txt, created by -N
--ignorelongrunninglist
-G Write Log to file in directory
--writelogfile
-GL Log File Name to Use. Default 'DocTo.Log';
--logfilename
-Q Quiet Mode: Nothing will be output to console. To see any errors you must
set -G or -GL. Equivalent to setting -L 0
--quiet
-R Remove Files after successful conversion: Default false; To use specify
value eg -R true
--deletefiles
-W Webhook: Url to call on events. See help '-H -HW' for more details.
--webhook
-X Halt on COM Error: Default True; If you have trouble with some files
not converting, set this to false to ignore errors and continue with
batch job.
--halterror
-V Show Versions. DocTo and Word/Excel/Powerpoint
Long Parameters:
--BookmarkSource
PDF conversions can take their bookmarks from
WordBookmarks, WordHeadings (default) or None
--DoNotOverwrite
--no-overwrite
Existing files are overridden by default, if you do not wish a file to be
over written use this option.
--no-subdirs Only convert specified directory. Do not recurse sub directories
--ExportMarkup Value for wdExportItem - default wdExportDocumentContent.
use wdExportDocumentWithMarkup to export all word comments with pdf
--no-IncludeDocProperties
--no-DocProp
Do not include Document Properties in the exported pdf file.
--PDF-OpenAfterExport
If you wish for a converted PDF to be opened after creation. No value req.
--PDF-FromPage
Save a range of pages to pdf. Integer/String. If integer --PDF-ToPage must also be set.
Other values wdExportCurrentPage, wdExportSelection
--PDF-ToPage
Save a range of pages to pdf. Integer. --PDF-FromPage must also be set.
--PDF-OptimizeFor
Set the pdf/xps to be optimized for print or screen.
Default ForPrint | ForOnScreen
--XPS-no-IRM
Do not copy IRM permissions to exported XPS document.
--PDF-No-DocStructureTags
Do not include DocStructureTags to help screen readers.
--PDF-no-BitmapMissingFonts
Do not bitmap missing fonts, fonts will be substituted.
--use-ISO190051
Create PDF to the ISO 19005-1 standard.
Experimental:
--skipdocswithtoc
EXPERIMENTAL. Will skip any docs that contain a TOC to prevent hanging.
Currently matches some false positives. Default False.
--stdout
Send file to Stdout after conversion. ( Does not work correctly for binary files)
ERROR CODES:
200 : Invalid File Format specified
201 : Insufficient Inputs. Minimum of Input File, Output File & Type
202 : Incorrect switches. Switch requires value
203 : Unknown switch in command
204 : Input File does not exist
205 : Invalid Parameter Value
220 : Word or COM Error
221 : Word not Installed
400 : Unknown Error
需要3個參數
採用一個值的參數具有一個空間使它們從值中分離出來。有些參數不需要值。所有參數都是案例不敏感的。
-f-輸入文件
您希望Docto打開的文件或文件夾。如果是文件夾,Docto將加載該目錄及其子目錄中的所有文件。如果您不希望從子目錄中加載文件,請參見--no-subdirs參數。
轉換將依次在每個文件上執行。
-o-輸出文件
您希望放置輸出文件的文件名或foldername。如果輸入是文件,但輸出是文件夾,則輸出文件的名稱與輸入相同,但具有新的擴展名。
-t-格式
指定要轉換為wdFormatPDF或wdFormatText等的格式。
查看可能的單詞格式和Excel格式。也可以使用整數值
-h, - 螺旋
顯示列出Docto和Office應用程序的所有參數和版本的幫助文本
-v- version
顯示Docto和Microsoft Office的版本字符串。
-wd -xl -pp -vs
該參數告訴Docto,您希望使用哪些應用程序加載並保存您的文檔,因為歷史原因Docto默認值為-WD,如果沒有價值,則在任何時候使用Docto時始終使用這些值之一是一種很好的習慣。
-fx -InputeXtension
默認情況下,Docto將使用標準應用程序擴展名加載目錄中的所有文件
例如。
如果您想轉換一組不同的文件集,例如 *.rtf或 *.txt,則可以在此處通過ext(例如.rtf指定它
-ox -ox -ofputextension
轉換上的輸出擴展是從標準列表中提取的,例如。如果轉換為wdformatpdf,則將使用Extension .pdf輸出文件。如果您想指定自己的擴展名(例如.pdfx ),則可以使用此參數。
-tf -forformat
如果-t是一個整數,如果它是在彙編Docto時無法可用的值,則會引起錯誤。如果使用-tf,它將在不檢查的情況下將-t的整數值傳遞給Office應用程序。
-l- loglevel
設置日誌輸出級別。 -l 10對於調試很有用。使用-l 0或-Q進行記錄。
####級別
-c-兼容
兼容模式整數。從MSDN列表中設置為整數值。
設置單詞版本的兼容模式該文檔應與之兼容。希望將舊文檔轉換為當前版本時,特別有用。可用於將舊的Word文檔轉換為與OneDrive兼容。
-e-編碼
設置CodePage編碼。有關更多詳細信息和值,請參見MSDN。
-n- listlongrunn
轉換時的某些文件會導致對話框彈出。這只能通過手動干預來解決。通過設置此參數,您至少可以記錄引起困難的文檔(到稱為docto.ignore.txt的文件),如果設置-NX ,則將跳過後續執行。
-nx-ignorelongrunninglist {no-value required}
將在與Docto.exe同一目錄中的docto.ignore.txt中列出的任何文件設置時。這允許忽略目錄結構中的麻煩文檔。
-g- -writelogfile [無需價值]
將日誌寫入文件以及stdout。默認情況下docto.log 。
-gl -logFilename {filename}
指定您希望將日誌文件寫入的文件名。
-Q- Quiet [無需價值]
沒有輸出對Stdout。包括錯誤在內的所有內容都會被撤消。與-G結合使用以確保您獲得錯誤。
-r -deletefiles {true | false}
如果您希望在轉換後刪除輸入文件,則可以將其設置為true。
-w -webhook
如果您希望在每次轉換或錯誤之後調用Web URL。 Webhook URL將在具有以下參數的以下事件上調用
文件轉換
錯誤
返回值已記錄在Docto Log中
-x -halterror {true | false}
當COM錯誤引起時,Docto將停止。如果您想忽略錯誤並繼續將此值設置為true。
- BookMarkSource {source}
PDF轉換可以從Wordbook標記,Wordheadings(默認)中獲取其書籤或無
- donotoverwrite -no-overwrite [無需值]
默認情況下,現有文件被覆蓋,如果您不希望文件過於書面使用此選項。
- 不提交
默認情況下,子目錄將轉換。用於僅轉換指定目錄。不要重複子目錄
- Exportmarkup
指定
使用wdexportdocumentwithmarkup用pdf導出所有單詞評論
-pdf-openafterexport
如果您希望在創建後打開轉換的PDF。無值req。
-PDF-FROMPAGE
-PDF-TOPAGE
僅轉換文檔中的某些頁面。
- 使用ISO190051
將PDF創建為ISO 19005-1標準,也稱為PDF-A或PDF存檔。
-m -ignoreMacos {true | false}
默認情況下,Docto忽略了MacOS創建的隱藏__MACOSX目錄中的任何文件。該目錄通常存在於系統之間共享的外部磁盤上。如果您想檢查此DIR設置此值。您必須指定值,例如-M false 。
該項目用Delphi編譯(我使用10.3,但應該與包括XE4和7在內的大多數版本進行編譯。該項目不會在Linux上編譯,因為它僅使用幾個Windows組件,例如COM和Word和Excel,但無論如何都沒有Linux版本,因此沒有意義。
Xlsto現在已納入Docto。以前,XLSTO是一種單獨的EXE,用於將XLS文件轉換為CSV或PDF。現在可以通過簡單地添加-XL標誌來使用主DocTo.exe完成。
我很高興接受任何人可能想提交的公關。如果涉及大量工作,請先開設一個問題,以確保努力不會浪費。
存儲庫中的主要分支名稱是DocTo
我已經開始在PHP中編寫功能測試,以檢查應用程序是否正確操縱文檔。如果您熟悉PHP Laravel和Pest,我會喜歡一些額外的測試。