Powershell Script to Convert .jpg to .pdf using Adobe Acrobat Pro
Copy link to clipboard
Copied
I require assistance, I have a powershell script that will batch convert multiple .RTF documents to .PDF documents, using Microsoft Word, however, now I wish to modify this script to batch convert .jpg to .pdf and since Word is not best suited for this. Is their a way I could change my script to do the .jpg to .pdf conversion using Adobe or some other application, please?
#Change the path
$path = "C:\jpeg\"
$word_app = New-Object -ComObject Word.Application
#Convert .rtf to .pdf
Get-ChildItem -Path $path -Filter *.rtf? -Recurse | ForEach-Object {
$document = $word_app.Documents.Open($_.FullName)
$pdf_filename = "C:\pdf\$($_.BaseName).pdf"
$document.SaveAs([ref] $pdf_filename, [ref] 17)
$document.Close()
}
$word_app.Quit()
Have something to add?

