• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Powershell Script to Convert .jpg to .pdf using Adobe Acrobat Pro

Community Beginner ,
Nov 15, 2018 Nov 15, 2018

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()

TOPICS
Acrobat SDK and JavaScript

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation