powershell - Visual Studios PowerShell 将 PDF 转换为 TIF 文件夹路径需要双 \\
问题描述
将 my 转换.pdf
为 a时.tif
,我可以在正确的文件夹中获得输出的唯一方法是\\
手动输入 double 有没有一种方法可以将这些已经放入我选择的文件夹中
转换.pdf
为.tif
下面的代码 *这不是我的,只是为了适合我
#Path to your Ghostscript EXE
$tool = "C:\\Program Files\\gs\\gs9.52\\bin\\gswin64c.exe"
#Directory containing the PDF files that will be converted
$inputDir = $textbox2.Text
#Output path where the TIF files will be saved
$outputDir = $textbox3.Text
$pdfs = get-childitem $inputDir -recurse | where {$_.Extension -match "pdf"}
foreach($pdf in $pdfs)
{
$tif = $outputDir + $pdf.BaseName + ".tif"
if(test-path $tif)
{
$tif
}
else
{
'Processing ' + $pdf.Name
$param = "-sOutputFile=$tif"
& $tool -q -dNOPAUSE -sDEVICE=tiff24nc $param -r300 $pdf.FullName -c quit
}
}
}
如您所见,Tif 文件夹具有我需要的路径布局
解决方案
推荐阅读
- java - 尝试抓取相同的网址时,发布的职位数量不一致。可能会说 121 个工作,然后三秒钟后 300 个工作
- sql - 从 excel 中的列创建逗号分隔的字符串数组以用于 VBA sql 查询
- javascript - 使用钩子避免组件在状态更改时重新渲染
- excel - 我如何在 vb.net 中使用 for each 或 other 方法遍历两个列表
- wordpress - 从 Yoast SEO 插件生成的文章架构中删除 datePublished 和 dateModified
- runtime-error - 当我尝试使用节点 index.js 运行我的不和谐机器人时,我不断收到此错误
- c# - 在designer.cs c#中的初始化顺序
- java - Gradle Ktlint 插件在 Java 16 上失败
- typescript - TS2339:“Cypress 和 EventEmitter”类型上不存在属性“dayjs”
- c - C:是否使用转换为“外部”结构类型的指针访问嵌套结构的初始成员?