Acrobat Reader command line problem
In windows xp professional I'm programatically creating a batch file and executing it (shell command in visual basic) to convert pdf files to Microsoft xps.
The batch command looks like this one:
"C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "D:\MyDir\Microsoft XPS Document\x.pdf" "Microsoft XPS Document Writer" /t "D:\MyDir\Microsoft XPS Document\x.xps".
When the user logged in on the machine is an administrator, acrobat reader does the operation silently. When a normal user (not belonging to administrators group) is logged in on the machine, acrobat reader opens the save as dialog window requiring user interaction.
The normal user has full control over the destination directory. I already tested giving the normal user full control over AcroRd32.exe and over cmd.exe with no success. I also tried in visual basic 2008 executing the command through System.Diagnostics.Process.Start with the exact same curious results.
Can someone help.
Thank you.
Hi.
I couldn't find a solution within Adobe for the problem I reported Oct 9, 2012, so I went to a fallback solution aimed to complete the needed stages. I'm posting here the visual basic 2008 code I wrote then. It is not a graceful solution and has some coarse code but was designed as part of an application that must keep processing files without user intervention. The procedure "followAcroRd32PDFtoXPS" must be called after the execution of a batch command like the described in the previous post:
Module fallback
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Integer, ByVal hwndChildAfter As Integer, ByVal lpszClass As String, ByVal lpszWindow As String) As Integer
Declare Function GetDlgCtrlID Lib "user32" (ByVal hDlg As Integer) As Integer
Declare Function SendDlgItemMessage Lib "user32" Alias "SendDlgItemMessageA" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Const WM_SETTEXT = &HC
Const BM_CLICK = &HF5
Function FileInUse(ByVal filepath As String) As Boolean
Dim f001 As Integer
If System.IO.File.Exists(filepath) Then
Try
f001 = FreeFile()
FileOpen(f001, filepath, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.LockReadWrite)
FileClose(f001)
Catch
Return True
End Try
End If
End Function
'outpfile <-- path to the XPS Document to be created
'starttime <-- system date and time when the batch command line was executed
Sub followAcroRd32PDFtoXPS(ByVal outpfile As String, ByVal starttime As System.DateTime)
Dim p As System.Diagnostics.Process, q As System.Diagnostics.Process, proc() As System.Diagnostics.Process
Dim i As Integer, j As Integer
Dim l As Long, memusage() As Long
Dim t000 As System.DateTime
Dim t999 As System.DateTime
Dim hwnd As Integer, lObjhWndTB As Integer, lObjhWndBu As Integer
Dim nIDDlgItem As Integer
Dim resu As Integer
dim maximumacrobatwaittime = 60 'seconds
dim memoryusageinactivity = 12 'seconds
dim acrord32pdftoxpstimelimit = 12 'seconds
'Identify necessary Adobe Reader process
t000 = DateTime.Now
Do
System.Threading.Thread.Sleep(1000)
i = 0
For Each p In System.Diagnostics.Process.GetProcesses
If LCase(p.ProcessName) = LCase("AcroRd32") Then
If Not p.StartTime < starttime Then
ReDim Preserve proc(i)
proc(i) = p
i = i + 1
End If
End If
Next
If i > 0 Then Exit Do
t999 = DateTime.Now
If DateDiff(DateInterval.Second, t000, t999) > maximumacrobatwaittime Then
Exit Sub
End If
Loop
'Identify necessary window
t000 = DateTime.Now
Do
System.Threading.Thread.Sleep(1000)
hwnd = FindWindow(vbNullString, "Save the file as")
If hwnd <> 0 Then
Exit Do
End If
t999 = DateTime.Now
If DateDiff(DateInterval.Second, t000, t999) > maximumacrobatwaittime Then
Exit Sub
End If
Loop
'Send click message to button save
t000 = DateTime.Now
Do
System.Threading.Thread.Sleep(1000)
lObjhWndTB = FindWindowEx(hwnd, 0, "ComboBoxEx32", "")
If Not lObjhWndTB = 0 Then
nIDDlgItem = GetDlgCtrlID(lObjhWndTB)
resu = SendDlgItemMessage(hwnd, nIDDlgItem, WM_SETTEXT, 0, outpfile)
If resu > 0 Then
lObjhWndBu = FindWindowEx(hwnd, 0, "Button", "&Save")
If Not lObjhWndBu = 0 Then
resu = PostMessage(lObjhWndBu, BM_CLICK, 0, 0)
If Not resu = 0 Then
Exit Do
End If
End If
End If
End If
t999 = DateTime.Now
If DateDiff(DateInterval.Second, t000, t999) > maximumacrobatwaittime Then
Exit Sub
End If
Loop
'Adobe Reader eventually will enter inactivity after printing to XPS Document
ReDim memusage(0)
Do
System.Threading.Thread.Sleep(1000)
ReDim Preserve memusage(UBound(memusage) + 1)
For Each p In proc
p.Refresh()
memusage(UBound(memusage)) = memusage(UBound(memusage)) + p.WorkingSet64
Next
If Not UBound(memusage) < memoryusageinactivity Then
j = 0
l = memusage(UBound(memusage))
For i = UBound(memusage) - 1 To UBound(memusage) - memoryusageinactivity + 1 Step -1
If l = memusage(i) Then j = j + 1
Next
Select Case j
Case memoryusageinactivity - 1
Exit Do
Case Else
End Select
End If
Loop
'Wait for the new XPS Document
t000 = DateTime.Now
Do
System.Threading.Thread.Sleep(1000)
Select Case My.Computer.FileSystem.FileExists(outpfile)
Case True
If Not FileInUse(outpfile) Then Exit Do
Case Else
End Select
t999 = DateTime.Now
If DateDiff(DateInterval.Second, t000, t999) > acrord32pdftoxpstimelimit Then
Exit Do
End If
Loop
'Kill Adobe Reader process
For Each p In proc
p.Refresh()
Try
p.Kill()
Catch ex As Exception
End Try
Next
'Kill eventual MS Windows error reporting system process
For Each p In System.Diagnostics.Process.GetProcesses
If LCase(p.ProcessName) = LCase("WerFault") Then
If LCase(p.MainWindowTitle) = LCase("Print driver host for 32bit applications") Then
For Each q In System.Diagnostics.Process.GetProcesses
If LCase(q.ProcessName) = LCase("splwow64") Then
Try
q.Kill()
Catch ex As Exception
End Try
End If
Next
Try
p.Kill()
Catch ex As Exception
End Try
End If
End If
Next
End Sub
End Module
Similar Messages
-
Acrobat reader command line switch - password
Hello everybody,
I am a developer for macromedia director applications.
I need to open a password protected PDF-file from within a
director-projector-application with any suitable
xtra-extension (not the
problem discussed here!).
all I would need is the complete command line for acrobat
reader to do
this.
A complete list of command line switches for Acrobat Reader
would be helpful
in respect to further needs.
where can i get this.
By the way, the solution for Windows and Mac OS would be
welcome. Are they
the same?
Thanks
Peter GrambitterHello everybody,
I am a developer for macromedia director applications.
I need to open a password protected PDF-file from within a
director-projector-application with any suitable
xtra-extension (not the
problem discussed here!).
all I would need is the complete command line for acrobat
reader to do
this.
A complete list of command line switches for Acrobat Reader
would be helpful
in respect to further needs.
where can i get this.
By the way, the solution for Windows and Mac OS would be
welcome. Are they
the same?
Thanks
Peter Grambitter -
Compare two pdf files using adobe acrobat through command line
Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
If command line option is not available in acrobat, then is it feasible to make use of acrobat javascript API to do this task?
Any kind of help will be greatly.Command-line: Not possible.
JavaScript: Possible, but very limited. Basically the only thing you can do is simulate clicking the Compare Documents button. The rest has to be done manually.
However, it *might* be possible to automate this process a bit more using a plugin. Ask over at the Acrobat SDK forum for more information... -
Why might the javac.exe, java.exe, and javaw.exe command lines not stay open? When I open these files, the command line flashes open and immediately disappears.
I tried opening these files using "Run as..." and unchecking the "Protect my computer from unauthorized program activity" option (as my first guess was and still is that I am running into some kind of Windows security settings problem), but this seemed to have no effect.
I am using Windows XP Professional with all updates as of 06-21-2007.You always want to run executables like that and things like .bat files from a command window. To open a command window, follow jverd's post, reply #2.
-
Solaris 10 x86 cdrw trouble. Gnome and command line problems writing.
I'm experiencing general weirdness trying to write CD's and DVD's using a new internal DVD-RW device -- It's a Sony NEC AD 7220 A CD / DVD RW drive on a Solaris 10 x86 AMD system. I have searched far and wide for other threads of similar instances but no one has posted an issue like the one I'm having.
I have a Sony Optiarc AD 7220 A CD-RW on a x86 AMD Athalon 1.6 ghz based server with 2 GB RAM.
The DVD-RW drive gets detected by BIOS (Phoenix TrustedCore 2.3) and reads disks fine. I installed Solaris 10.08 from DVD using this DVD-RW drive.
However, trying to write to new blank media does not work properly, (effectively at all).
I've tried different brands of brands of blank CD's and CD-R and CD+R (have not tried using CD-RW disks yet). Ditto with DVD's - tried DVD-R and DVD+R's.
1. Inside the Solaris 10 GUI (Gnome, a.k.a. Java Desktop), when I put in a blank CD-R, a dialog box "Format Media...?" pops up. If I click "Ok" it formats the blank CD and closes the session, CD has been written to and is ruined.
2. I open a terminal window, as root, and put in a blank CD. "mkisofs r /home/foo 2>/dev/null | cdrw i p 1" will write a directory tree OK, but if I go back into gnome GUI and open and close the CD tray, again, up pops the "Format Media..." dialog box instead of the CD appearing on the desktop. If I restart vold (svcadm restart volfs) then open and close the CD tray, voila, the contents appear on desktop as CD icon.
3. When I try to write to a DVD-R: "cdrw -i /local/iso_image" It always fails with: Write Track 1....Failed. after a few minutes. It did in fact write part of the .iso but bails out with a failure.
I've tried various other write commands (specifying the device ID, speed, so on and so forth) and command line switch options (following the rules of course) and it seems to me to be more than a syntax / media issue. However if it is I would like to know. I did see a similar CDRW device on the HCL for OpenSolaris with a 'reported to work' rating. That was for a Optiarc AD-5200A, which is going away thus my company has chosen to use the AD 7220A in speciality racks we build and deliver to the U.S. Navy.
I really need to get a handle on this CD-RW device issue and decide if a different brand / model is what it's going to take to solve this and move on to producing and delivering these systems in working conditions.Sony systems are often very particular about what CD's and DVD's they'll take. I have several Sony systems that I use for video work and they'll read almost anything but they'll only write to DVD RW. They also don't like cheap brand CD's and DVD's. Be sure to try both CD RW and DVD RW before doing anything else. Because of the requirement for DVD RW, they won't take fast speed (16x) DVD's, just 4x. If all of this turns out to be the case, you may want to go with a different manufacturer for the drive, DVD +RW 4x aren't always easy to find in the store.
-
Adobe Acrobat Reader 8 printing problems.
I am currently using Adobe Acrobat Reader 8 with the following information ,and I have problems printing in system configurations (I have an old Brother HL-1060 Laser printer)....
When I use the following defaultprinting preferences, the pages come out blank when printing riffmci.pdf (That can be found on the net):
- Resolution 600dpi
- 1200x600dpi Support: Off.
When I set the resolution to 1200dpi and 1200x600dpi Support to on the printing completes successfully. Is this a known issue with Adobe Acrobat Reader printing engine??
Technical
=========
Available Physical Memory: 148108 KB
Available Virtual Memory: 1954156 KB
BIOS Version: Award Medallion BIOS v6.0
Default Browser: D:\Program Files\Internet Explorer\iexplore.exe
Version: 6.00.2800.1106
Creation Date: 2002/08/29
Creation Time: 06:14:40
Default Mail: Mozilla Thunderbird
D:\Program Files\Mozilla Thunderbird\mozMapi32.dll
Version: 0.8
Creation Date: 2007/01/07
Creation Time: 14:31:35
Graphics Card: ASUS V9400-X V62.11
Version: 6.14.10.6211
Check: Not Supported
Installed Acrobat:
Installed Acrobat: D:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe
Version: 8.1.0.2007051100
Creation Date: 2007/05/11
Creation Time: 03:06:38
Locale: French (Canada)
Monitor:
Name: ASUS V9400-X V62.11
Resolution: 800 x 600 x 60
Bits per pixel: 32
OS Manufacturer: Microsoft Corporation
OS Name: Microsoft Windows 2000 Professional
OS Version: 5.0.2195 Service Pack 4
Page File Space: 1537052 KB
Processor: x86 Family 6 Model 8 Stepping 1 AuthenticAMD ~1813 Mhz
System Name: HOLMES
Temporary Directory: U:\temp\carl\
Time Zone: Eastern Standard Time
Total Physical Memory: 1048032 KB
Total Virtual Memory: 2097024 KB
User Name: carl
Windows Directory: D:\WINNT
Installed plug-ins:
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\Accessibility.api
Version: 8.1.0.2007051100
Creation Date: 2007/05/11
Creation Time: 02:37:28
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\AcroForm.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:36:16
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\Annots.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:34:34
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\Checkers.api
Version: 8.1.0.2007051100
Creation Date: 2007/05/11
Creation Time: 02:37:42
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\DVA.api
Version: 8.0.0.2006102300
Creation Date: 2006/10/23
Creation Time: 01:10:52
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\DigSig.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:35:06
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\EScript.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:36:58
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\EWH32.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:35:48
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\HLS.api
Version: 8.0.0.2006102300
Creation Date: 2006/10/23
Creation Time: 01:10:22
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\IA32.api
Version: 8.1.3.2008101500
Creation Date: 2008/10/15
Creation Time: 00:35:22
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\ImageViewer.API
Version: 8.0.0.2006102300
Creation Date: 2006/10/23
Creation Time: 01:10:36
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\MakeAccessible.api
Version: 8.1.0.2007051100
Creation Date: 2007/05/11
Creation Time: 02:38:36
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\Multimedia.api
Version: 8.1.0.2007051100
Creation Date: 2007/05/11
Creation Time: 02:39:30
D:\Program Files\Adobe\Reader 8.0\Reader\plug_ins\PDDom.api
Version: 8.0.0.2006102300
Creation Date: 2006/10/23
CrI have the same problem!
Adobe Reader 8.1.2
Please help -
Hi there!
I've a very big problem displaying reports output (PDF).
If in acrobat reader settings web integration is checked the IE show me 1 blank page or ask me to download the activex for this file (PDF). If in acrobat reader the web integration in unchecked IE ask me if i'd like to open or save the file and it works correctly...I've allready deinstalled IE + Acrobat - Rebooted - reinstalled IE 5.0 + Acroba Reader 4.05 but the same problem has occurred.....
Pls help me at soon at possible
Tnx a lot
Marco
nullI have the same problem so I upgraded to IE 5.5 and Acrobat 5.0 now it works fine.
Cheers
Rao -
Read command line arguments with an ActiveX step
Hi
I would like to read the command line parameters from TestStand startup. I did find an ActiveX resulting in a Object Reference (See Locals.CommandsRef). How do I use this reference to really get the arguments and their count? See also screenshot.
Solved!
Go to Solution.
Attachments:
Screenshot.jpg 160 KBHi Paulus,
Via this link, you find an forumthread that describes the same issue. testStand does not support this, but there is a workaround. Attached you find the code.
The attachment includes a LV vi with the command line. If you doen't use Labview, here is the command line:
C:\Program Files (x86)\National Instruments\TestStand 2012\Bin\SeqEdit.exe /goto "Parameter1 = test" /runEntryPoint "Test UUTs" D:\Testsequence.seq
Regards,
Bas
Attachments:
Command line TestStand.zip 10 KB -
Hi i am new to java practicing since 3 weeks now. i am using blueJ iam liking it but the problem i am facing is i can't pass command line parametres to String args through BlueJ .After right clicking on Main program (in Insert Sort) it asks for arguments when i pass the arguments that is
4 3 2 0 1 it says :- "}" expected or ";" expected and same program if i run thru command line passing parametres it works fine. The thing is i want to use debug features of Bluej which i can't using command prompt
please help me outthanks for your quick response.
i am new to this stuff. are u telling me that
java VectorTest one two
will return as 0 even though there are 2
arguments for the args array.
if so what do i do.create a new class to accept the
arguments and add them to the vector?
No, if you put the command line as you describe, you should get args.length = 2, as you would expect.
BTW - the reason your square brackets are disappearing is because the forum uses square brackets for special formatting - which is a real pain. I think the following should work:
String nString = args;
[ / code]
But it doesn't exactly - the square brackets end up as angle brackets, as you can see - anyone help, please? Also, at the end of the code section, there shouldn't be spaces around the / - I just put them in to stop it acting like a real end of code section.
Also, notice that there's no need to putnString = new String(args);
you can use args directly.
Robin -
Dear All ,
I am using Read Current line sattement as follows .
read current line field value
t_type4-bukrs into t_temp-bukrs
t_type4-belnr into t_temp-belnr
t_type4-NETCODE into t_temp-NETCODE
t_type4-UMSKZ into t_temp-umskz
t_type4-waers into t_temp-WAERS .
t_type4-WRBTR into t_temp-WRBTR
t_type4-UKURS into t_temp-UKURS .
I have commented the marked line it works fine . But I want to read WRBTR and UKURS also but it gives short DUmp.
These fields are frim BSID table . PLease Help me .The problem surely lies in terms of variable definition... Change the defn of t_temp-wrbtr and ukurs to character...think it should work fine after that.
Regards
Anurag -
Adobe reader command line search
Hello everyone,
I am opening a PDF file using command line arguments and perform a search.
My command looks like this:
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /A search="word" "C:\File.pdf"
The command is working, but I have the issue that it looks like the search is only performing with option "Match whole words only".
Does anybody know if I can change this option for command line search to get all search results?
Thanks in advance.
Regards,
ajay311Does anyone have an idea?
Thanks! -
How to read the DOS command line by JAVA.
for example when i type on DOS DIR, want to save all output to Text file.
Thanks and best regardsI found somthing to help, but i need to make a process which let me to type a command into the Concole and the output will appeare like i am working with Dos Wndows ( Start--> Run--> cmd)
Thanks and best regards -
Acrobat Reader XI print Problem
After updateing to Acrobat Reader XI I can not print. error msg says "Document faild to print" then nexyt screen says " No pages were selected" many varied attempts no print remove XI reinstall X prints OK until auto upgrade to XI same problem
Windows 7, using Open Office, Firefox, Thunderbird, Brother MFC J475DW printer.
trying to print using the print function to the printer ( print file, or direct print ). Open office or windows print fine text and pictures. from other documents. -
Hi All
I have command line for mom agent but it have more than 200 characters.
How can i deploy through sccmUse a batch file instead, e.g. "install-mom.cmd" contains your very long command line.
Torsten Meringer | http://www.mssccmfaq.de -
Apple Cube OS9 command line problems.
I have a old Cube with a partioned HD with OS9.2 on one partition and OSX.2 on the other. Had been working fine with OS9, but tried to boot the OSX using "Start Disk" and it crashed giving me a command line. How can I reset the start disk to the OS9? Won't start from a CD for some reason and I can't seem to get it out of this loop.
This is what it gives me:
/etc.master.password: no such file or directory
sh-2.o5a# _
The only thing I can think of is to type "reboot" and it does...back to this command line. Not sure of what command I can use to get back to the original
OS9 boot. Any help would be appreciated. Trying to get this computer set up as a word processor for my daughter. Thanks in advance!!!Depress the Option key at startup and the OS 9 partition icon should be shown as a startup option. Click the icon and then the right arrow.
Cheers, Tom
Maybe you are looking for
-
How do you keep two (2) totally separate libraries on the same computer
I have had an iPod nano for a few years and have built up my own library. My son received an iPod touch for his birthday. How do I keep my music and his music totally separate? We are using the same PC (the same iTunes link). He has his own iTunes ac
-
Enet100 GPIB controller on 64 bit OS
After having to upgrade to the new LabView because of a bug and seeing how poor its performance is, I decided to give it the benifit of the doubt and got a brand new Core 2 3GHz PC w/ 8G of RAM. I figured the time I am wasting trying to use the new
-
Camcorders for Final Cut Studio what to look for?
Hi i am getting into motion graphics, green screening, and lots of effects. I have been trying to use my isight but it is so hard to key. I have a few question about camcorders as well. This is the only place i could think of to ask. Hears what i am
-
Vertical report cell with multiple values
I have a database table that looks something like this: Order_ID Product_Name .....1................X......... .....1................Y......... .....1................Z......... Right now, when I create a vertical report using one of the provided temp
-
16bit 24bit with M-audio fasttrack
I just bought an m-audio fast track pro audio interface and hooked it up to my macbook (10.5.8) iTunes plays through it without problems and Logic express can record etc etc and all seems to work. BUT only when I set the sample depth to 16bit, itunes