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.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2117
Printed Date: 25 May 2019 at 4:12pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


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)
  $page.GetSize
  $jso.console.Show
  $jso.console.Clear
  $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
Eryk



Replies:
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 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net