Kalamalka Kid Asked: 2020-07-26 11:30:51 +0800 CST2020-07-26 11:30:51 +0800 CST 2020-07-26 11:30:51 +0800 CST 如何将 RTF 文件转换为 PDF 772 希望将简单的 RTF 文件转换为 PDF。 没有第三方软件有没有办法做到这一点? windows pdf 4 个回答 Voted Best Answer RedGrittyBrick 2020-07-26T11:38:10+08:002020-07-26T11:38:10+08:00 我会在 Windows-Wordpad 中打开 RTF 并使用“打印为 PDF 文件”打印机驱动程序打印为 PDF。 这将创建一个 PDF 文件而不进行任何实际打印 Reddy Lutonadio 2020-07-26T11:45:33+08:002020-07-26T11:45:33+08:00 如果您的 PC 上安装了 MS Word,您可以使用它将 rtf 文件保存为 pdf,使用“另存为”然后选择 PDF。将基于 rtf 文档创建一个 pdf 文档。 Kalamalka Kid 2020-07-26T12:43:35+08:002020-07-26T12:43:35+08:00 感谢帮助这个答案出现的用户RedGrittyBrik 。我要花点时间让这个答案对用户更友好一点。 因此,为了轻松地将 RTF 文件转换为 PDF,我们只需在 Windows-Wordpad 中打开文件,然后单击左上角文件菜单中的打印选项: 接下来,选择“打印到文件”选项,然后选择“Microsoft 打印到 PDF”(您可能必须使用滚动条导航到左侧)注意:这实际上不需要打印机。它只是要保存一个文件。 点击对话框底部的“应用”,然后点击“打印”。将弹出另一个窗口,询问您要将文件保存在哪里,同时为您提供重命名选项。 Wasif 2020-08-22T08:54:48+08:002020-08-22T08:54:48+08:00 只是为了分享,我制作了一个 powershell 脚本,它将安装右键单击上下文菜单以将文档(.doc、.docx、.rtf、.odt、.pdf)转换为一键转换为其他格式。(需要基于 Microsoft Office MSI 的安装,2007+,也适用于非激活版本)。执行脚本并单击安装以获取它们。然后右键单击 RTF 文档,将鼠标悬停在底部的转换为上,然后单击 PDF。它将出现在当前位置。使用 MS Office 2013 和 2007 进行测试: # Word2AnyInstall.ps1 #This script will install context menus on .DOC,.DOCX,.RTF,.PDF,.HTM,.HTML,.ODT,.XML,.XPS files to convert them to different # format using MS Word # Right-click any file in these extensions and you will get a menu abiove "Properties" use it # An MSI-based (not Click-To-Run) installation of MS Office is required, will work for Office 2007+ versions and even # Unactivated versions will work too # While conversion, just make sure that MS Word is not Open and please don't occupy C:\bin directory where files will be kept $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) if( -not ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) { Write-Host "Running Admin Shell, Please wait....." Start-Sleep -Seconds 1 Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`"" -Verb RunAs Exit 0 } function Install { If (!(Test-Path C:\bin)){ New-Item C:\bin -Type Directory } @' Param( [System.IO.Fileinfo]$Source, [String]$Format ) $arrFileExt = @{ "doc" = 0 "docx" = 0 "htm" = 8 "html" = 8 "odt" = 23 "pdf" = 17 "rtf" = 6 "txt" = 4 "xml" = 19 "xps" = 18 } $myFileType = $arrFileExt."$Format" $myFileName = $Source.Basename $myFileExt = "." + $Format $toSave = Split-Path "$Source" $myOutputFile = $toSave + "\" + $myFileName + $myFileExt $objWord = New-Object -COMObject "Word.Application" $objWord.Visible = $False $objWord.Documents.Open([string]$Source) | Out-Null $objDoc = $objWord.ActiveDocument $objDoc.SaveAs("$myOutputFile",$myFileType) | Out-Null $objDoc.Close() | Out-Null '@ | Set-Content C:\bin\Word2Any.ps1 @' Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo] "MUIVerb"="Convert To" "Position"="Bottom" "SubCommands"="" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell] [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\001DOC] "MUIverb"="Word document 1997-2003 (DOC)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\001DOC\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\002DOCX] "MUIVerb"="Word document 2007-2019 (DOCX)" "Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\002DOCX\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\003PDF] "MUIVerb"="Portable Document Format (PDF)" "Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\003PDF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\004RTF] "MUIVerb"="Rich Text Format (RTF)" "Icon"="shell32.dll,1" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\004RTF\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\005ODT] "MUIVerb"="Open Document Text (ODT)" "Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\005ODT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\006TXT] "MUIVerb"="Plain Text File (TXT)" "Icon"="shell32.dll,70" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\006TXT\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\007HTM] "MUIVerb"="HTML webpage (HTM)" "Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\ 65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\ 00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\ 35,00,00,00 [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\007HTM\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\008HTML] "MUIverb"="HTML webpage ()HTML)" "Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\008HTML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\009XML] "MUIVerb"="XML File (XML)" "Icon"="ieframe.dll,2" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\009XML\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\"" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\010XPS] "MUIVerb"="XPS File (XPS)" "Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2" [HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\010XPS\command] @="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\"" '@ | Set-Content C:\bin\wordsav.reg regedit.exe /s C:\bin\wordsav.reg } function Uninstall { @' Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo] [-HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo] [-HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo] [-HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo] [-HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo] [-HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo] '@ | Set-Content uninstall.reg regedit /s uninstall.reg Remove-Item C:\bin\Word2Any.ps1 Remove-Item C:\bin\wordsav.reg Remove-Item C:\bin } [Console]::WindowWidth = 192 [Console]::Title = "Word2AnyInstall" @' ################################################################################################################################################################ Word2AnyInstall.ps1 This script will install context menus on .DOC,.DOCX,.RTF,.PDF,.HTM,.HTML,.ODT,.XML,.XPS files to convert them to different format using MS Word Right-click any file in these extensions and you will get a menu abiove "Properties" use it An MSI-based (not Click-To-Run) installation of MS Office is required, will work for Office 2007+ versions and even Unactivated versions will work too While conversion, just make sure that MS Word is not Open and please don't occupy C:\bin directory where files will be kept ################################################################################################################################################################ '@ $msg = @' [1] Install [2] Repair [3] Uninstall '@ choice /c 123 /n /m $msg switch ($LastExitCode) { 1 {Install} 2 {Install} 3 {Uninstall} } Write-Host "`nDone!" Read-Host
我会在 Windows-Wordpad 中打开 RTF 并使用“打印为 PDF 文件”打印机驱动程序打印为 PDF。
这将创建一个 PDF 文件而不进行任何实际打印
如果您的 PC 上安装了 MS Word,您可以使用它将 rtf 文件保存为 pdf,使用“另存为”然后选择 PDF。将基于 rtf 文档创建一个 pdf 文档。
感谢帮助这个答案出现的用户RedGrittyBrik 。我要花点时间让这个答案对用户更友好一点。
因此,为了轻松地将 RTF 文件转换为 PDF,我们只需在 Windows-Wordpad 中打开文件,然后单击左上角文件菜单中的打印选项:
接下来,选择“打印到文件”选项,然后选择“Microsoft 打印到 PDF”(您可能必须使用滚动条导航到左侧)注意:这实际上不需要打印机。它只是要保存一个文件。
点击对话框底部的“应用”,然后点击“打印”。将弹出另一个窗口,询问您要将文件保存在哪里,同时为您提供重命名选项。
只是为了分享,我制作了一个 powershell 脚本,它将安装右键单击上下文菜单以将文档(.doc、.docx、.rtf、.odt、.pdf)转换为一键转换为其他格式。(需要基于 Microsoft Office MSI 的安装,2007+,也适用于非激活版本)。执行脚本并单击安装以获取它们。然后右键单击 RTF 文档,将鼠标悬停在底部的转换为上,然后单击 PDF。它将出现在当前位置。使用 MS Office 2013 和 2007 进行测试: