13 lines
693 B
PowerShell
13 lines
693 B
PowerShell
$rankingDoc = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '排行榜升级后端对接需求.docx'))
|
|
$rankingPdf = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../../.codex_tmp/ranking-v2/qa/docx-render/排行榜升级后端对接需求.pdf'))
|
|
New-Item -ItemType Directory -Force ([IO.Path]::GetDirectoryName($rankingPdf)) | Out-Null
|
|
$rankingWord = New-Object -ComObject Word.Application
|
|
$rankingWord.Visible = $false
|
|
$rankingWord.DisplayAlerts = 0
|
|
try {
|
|
$rankingDocument = $rankingWord.Documents.Open($rankingDoc, $false, $true)
|
|
$rankingDocument.ExportAsFixedFormat($rankingPdf, 17)
|
|
$rankingDocument.Close(0)
|
|
Write-Output $rankingPdf
|
|
} finally { $rankingWord.Quit() }
|