简单的实用程序,用于将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,我会喜欢一些额外的测试。