my911

Automate Adobe Acrobat

8 posts in this topic

I am BRAND new to Autoit......in fact, experiencing install problems....that is a whole different can of worms.

But I have several thousand PDF files,

I can manually use keyboard and mouse to open each file and "Optimize" it ( Acrobat internal function to compress by 5x+/-)

Then save the file with a modified name = original name &"O"

I'm hoping to develop an Autoit script to loop through each file in a folder and Optimize it/save it

Has anybody done it already?

 

 

 

 

Share this post


Link to post
Share on other sites



@my911, Please check the forum purpose before posting as you made this post in the Examples forum and it is clearly a support request.
Moved.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

As much as I am for scripting all things possible, sometimes the manual route is just easier if you are only doing it once. In the optimization wizard in Acrobat there is an option to add multiple files. Click on Multiple files, Add Files, browse to the folder, CTRL+A, Open. Bob's your uncle, you're done.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

As much as I am for scripting all things possible, sometimes the manual route is just easier if you are only doing it once. In the optimization wizard in Acrobat there is an option to add multiple files. Click on Multiple files, Add Files, browse to the folder, CTRL+A, Open. Bob's your uncle, you're done.

Thanks for the reply. The situation involves optimizing about 30-50 files each month; recurring.

My version of Adobe Acrobat (9.5) has an Optimize command with a number of parameters

 

but no provision for addressing multiple files,

There is a cryptic provision for doing Java Scripts, but I prefer to learn something with wider utlilty.

 

Unfortunately I am having install problems with Autoit.....the notice about a new command in the right-click NEW submenu doea not show up. I was expecting some sort of IDE with editor/step/run/etc.

My original post was in the Sample Code area thinking that someone might have already done it.

In the meantime I am limping along and trying to check out the command/syntax  and do some developmental coding.

All help will be appreciated.

 

Acrobat Optimize.docx

Acrobat 9_5 Javascript.docx

Edited by my911
to include pics

Share this post


Link to post
Share on other sites

@my911, Please check the forum purpose before posting as you made this post in the Examples forum and it is clearly a support request.
Moved.

Jos

Jos,

Thanks for the reply.

Scusi.

I tried examples in hopes that someone already did it.

 

Share this post


Link to post
Share on other sites

What did your search results turn up?

Nothing very useful so far.

My post was moved, and now I am trying to find it.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

What did your search results turn up?

I checked my "Activity" and found several posts, but mostly about Forum procedures.

The PDF automation is one thing.

Getting Autoit properly installed is more urgent.

I'll start a new topic here....Support

Thanks for the help.

Cancel the "new topic" comment.

I used a utility named rggeditfix...or something....and the mising command now shows.

So, I'm off to experiment and start building/joining scripts.

The only comment so far is that when I right click a new script to edit it, the display does not look like the image in the tutorial....no line numbers....no colors...etc

Maybe a matter of settings?

 

Acrobat Optimize.docx

Acrobat 9_5 Javascript.docx

Edited by my911

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Simpel
      By Simpel
      Hi,
      since some days I become this error message exiting my app:

      Eventviewer shows following data:
      Name der fehlerhaften Anwendung: autoit3.exe, Version: 3.3.14.2, Zeitstempel: 0x55fc1979 Name des fehlerhaften Moduls: ntdll.dll, Version: 6.1.7601.23864, Zeitstempel: 0x595fa490 Ausnahmecode: 0xc000000d Fehleroffset: 0x000987e0 I stripped my code from 1500 lines down to 70:
      #include <GUIConstants.au3> Global $g_sPathToPDF = ; path to some pdf file to show Opt("GUIOnEventMode", 1) ; default ist 0 ; 1 bedeutet, daß bei Klick direkt die darunterbeschriebene Funktion ausgeführt wird Global $g_hGUI_MAIN ; Haupt-GUI Global $g_hDummy_Main ; Dummy um Fokus in der Haupt-GUI unsichtbar zu setzen Global $g_hGUI_Pruefen ; GUI zum Prüfen aller PDF Global $g_hGUI_PDF ; GUI PDF-Ansicht der ausgewählten PDF Global $g_hPDF ; ActiveX control welches das PDF enthält Global $g_oAcrobatReader ; AcrobatReaderObjekt in dem die PDF gezeigt werden _GUI_Main() GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit_Main" , $g_hGUI_MAIN) While 1 Sleep(1) WEnd Exit Func _GUI_Main() ; GUI-MAIN $g_hGUI_MAIN = GUICreate("MAIN", 390, 390, 763, 372) GUISetFont(12) GUICtrlCreateButton("NEXT", 20, 20, 350, 55, $BS_DEFPUSHBUTTON) ; Default-Knopf GUICtrlSetOnEvent(-1, "_GUI_Pruefen") GUISetState(@SW_SHOW, $g_hGUI_MAIN) ; GUI anzeigen EndFunc Func _GUI_Pruefen() ; GUI zum Prüfen der PDF GUISetState(@SW_HIDE, $g_hGUI_MAIN) ; MAIN-GUI ausblenden Opt("GUIOnEventMode", 0) ; wieder auf Default gesetzt $g_hGUI_Pruefen = GUICreate("RIGHT", 490,950, 1057, 91, -1, $WS_EX_APPWINDOW, $g_hGUI_MAIN) _AcrobatShow($g_sPathToPDF, "", 367, 91, 674, 950, $g_hGUI_Pruefen) ; PDF-GUI erstellen GUISetState(@SW_SHOW, $g_hGUI_Pruefen) ; GUI-Prüfen anzeigen Local $msg While 1 $msg = GuiGetMsg() ; Aktion mit der GUI registrieren Switch $msg ; je nach Aktion mit der GUI Case $GUI_EVENT_CLOSE ; X gedrückt $g_oAcrobatReader = "" ; zerstöre das Objekt AcrobatReader GUIDelete($g_hGUI_PDF) ; lösche die GUI-PDF GUIDelete($g_hGUI_Pruefen) ; lösche die GUI-Prüfen Opt("GUIOnEventMode", 1) ; Default 0 GUISetState(@SW_SHOW, $g_hGUI_MAIN) ; MAIN-GUI wieder zeigen Return EndSwitch WEnd EndFunc Func _Exit_Main() ; ausführen, wenn die MAIN-GUI schließt ConsoleWrite("EXIT" & @CRLF) Exit EndFunc Func _AcrobatShow($sFile, $sTitle = "PDF ", $iLeft = 50, $iTop = 0, $iWidth = 1000, $iHeight = 700, $hWnd = "") ; GUI-PDF erstellen If FileExists($sFile) Then ; wenn das PDF existiert $g_oAcrobatReader = ObjCreate("AcroPDF.PDF.1") $g_oAcrobatReader.src = $sFile ; Quelle ist das File $g_oAcrobatReader.SetLayoutMode("SinglePage") ; default "SinglePage" $g_oAcrobatReader.SetPageMode("none") ; default "none" $g_oAcrobatReader.SetShowToolbar(0) ; Tool-Bar nicht zeigen 0 $g_oAcrobatReader.SetShowScrollbars(0) ; Scroll-Balken nicht zeigen 0 $g_oAcrobatReader.SetView("fit") ; "fit" falls wer eigene Einstellungen im Reader gespeichert hat $g_hGUI_PDF = GUICreate($sTitle, $iWidth, $iHeight, $iLeft, $iTop, -1, -1, $hWnd) ; GUI als Child zu GUI-PRUEFEN erstellen - es soll nicht aktiviert werden $g_hPDF = GUICtrlCreateObj($g_oAcrobatReader, 0, 0, $iWidth, $iHeight) ; Objekt für das PDF erstellen GUICtrlSetStyle($g_hPDF, $WS_VISIBLE) ; PDF anzeigen GUISetState(@SW_SHOW, $g_hGUI_PDF) ; GUI-PDF anzeigen Else MsgBox(0, 'ERROR', "No PDF found.") EndIf EndFunc Do following steps to prove:
      - start app
      - click "next" on main gui
      - wait minimum 5 seconds (until the arrows left and right on "gui left" disappear)
      - close gui left or right
      - close main gui
      - look on console written "EXIT" the last code line before exit
      - now windows error message above appears
      The funny thing is if I don't wait the 5 seconds (before the half transparent arrows disappear) closing the gui then I will get no win error message.
      If I comment _AcrobatShow() out then the error never appears. So it seemed to be an acrobat reader issue. Every week at work there are a lot of updates, but there is no chance to know which one. But since one update this error happens.
      Any solutions? Regards, Conrad
    • tarretarretarre
      By tarretarretarre
      Hey yaaal!!
       
      Lets say this is my code, (Semi-psudo)

      #include <common used libraries> #include <my own libraries> myown.au3 ->> func blabla_set($input) if (CheckForThings) then return seterror $blabla = $input endfunc   ;Main file local $blabla  blabla_set(24242 [/code]   1. Is there a way to make autoit do all checkings and then set my function "blabla_set" variables to Locla const? like c++ ifdef? 2. Is it possible to make autoit exctract the MyOwnFunctionCaller("Otherfunc") to the while loop after compiling? for example   [code] while 1    MyOwnFunctionCaller("Otherfunc") wend
       
      func OtherFunc()  own stuff own stuff own stuff endfunc

       
      becomes
       

      while 1  own stuff
      own stuff own stuff wend

       
       
      Thanks /t
    • corgano
      By corgano
      I'm not sure if this should be help and support, COM help, or chat, so I posted it here
      I've been dealing with Acrobat (8.1 Pro) using the COM interface and the acroexch.app object and it's javascript interface to do a variety of tasks with PDF's (take a large file, read the text of the pages, split it into separate files depending on results). It works pretty well, but Acrobat has been glitchy and slow and loves to mess up the pdf file. I'm vetting sick of having to rescan a batch because acrobat messed up the internal PDF structure
      Does anyone else know of some kind of free PDF tool that's usable from autoit? Somthing command line? OR even better, something with an OLE interface? Acrobat is really getting on my nerves
    • corgano
      By corgano
      How do I attach to the active acrobat window and get it's javascript object? I know how to do this when i know the filename:
      $oAcro = ObjCreate("acroexch.app") $oPDF = ObjCreate("AcroExch.PDDoc") $File = @ScriptDir&"\test.PDF" $oPDF.Open($File) $oJSpdf = $oPDF.getJSObject.app.opendoc($File) But how would i do this if I didn't know $File? If I wanted to connect to the Active window instead?