Print Page | Close Window

Powershell & Acrobat Professional

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: PDF Developers
Forum Description: This conference is for PDF developers.
Printed Date: 13 Dec 2019 at 10:24pm
Software Version: Web Wiz Forums 11.10 -

Topic: Powershell & Acrobat Professional
Posted By: ErVoRe
Subject: Powershell & Acrobat Professional
Date Posted: 20 Jan 2017 at 8:23am
Acrobat Professional can be automated using the JSObject. I played a little bit around and some things also are working.
$TestPDF = "C:\Powershell\PDF\FirstTest.pdf"
$PDF = New-Object -ComObject AcroExch.App
$AVDoc = New-Object -ComObject AcroExch.AVDoc
$PDFDoc = New-Object -ComObject AcroExch.PDDoc
if ( $PDFDoc.Open($TestPDF) ) {
  $jso = $PDFDoc.GetJSObject
  $page = $PDFDoc.AcquirePage(0)
  $jso.console.println("Hello, Acrobat!")
  $PDF.Show # Does not work .... ---

I have however installed Acrobat Reader further to Acrobat Professional. Maybe that Powershell uses the dll from Reader instead of Professional ?
Loading explicitely the dll does not work, when I try:

Add-Type -Path 'C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.dll'

I get the error message:
Add-Type : Could not load file or assembly 'file:///C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.dll' or one of its dependencies.
 The module was expected to contain an assembly manifest.

Any Idea ?

Thank you very much

Posted By: gkaiseril
Date Posted: 29 Jan 2017 at 7:40pm
Have you looked at the Acrobat SDK material. It is freely downloadable through the Adobe Acrobat Developer Center. The documentation has examples using various programming languages but not command line or Power Script code.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -