Problem printing a PDF from UV/Windows

130 views
Skip to first unread message

Scott Ballinger

unread,
May 1, 2013, 12:50:22 PM5/1/13
to mvd...@googlegroups.com
Hello all,

I am trying to print a PDF from inside UV/Windows. Here is what I've got:

  CMD = 'DOS /c "C:\PROGRAM FILES (X86)\ADOBE\READER 11.0\READER\ACRORD32.EXE" /T /N /S '
  CMD := 'P:\xxxxx\yyyyy.pdf \\servername\TOSHIBA4540'
  PRINT CMD
  EXECUTE CMD
   
When I run this from the DOS command prompt (minus the DOS /c part) it works fine. When I execute it from a UV BASIC program the session just hangs, and as an added insult seems to kill the UVTELNET service as well, requiring a system reboot (not cool!).

Perhaps I need another set of quotes around the C:\PROGRAM FILES... part?  However, because I have instigated two system reboots testing this so far, I am hesitant to keep trying various permutations- perhaps I will arrange to stop by the site some evening so that I can reboot as necessary without further pain.

I could utilize Accuterm to run down the path to Adobe Reader on the user's PC and then print from there, but then since I can't be sure of the printer name as installed on said PC I will probably need to use  the /P switch (which brings up the Adobe Print dialog) instead of /T (which just prints to the specified printer without prompting) and I was hoping to make it more automated then that. (There does not seem to be a way to tell Adobe to just print using the default printer.)

Suggestions welcome,
/Scott Ballinger
Pareto Corpration
Edmonds WA USA
206 713 6006

[Cross-posted to u2ug.org]

Rex Gozar

unread,
May 1, 2013, 2:23:52 PM5/1/13
to mvd...@googlegroups.com
UniVerse tends to eat your quote marks when you execute DOS commands
like that. It's better to write them into a BAT file and execute it.

rex

Kevin Powick

unread,
May 1, 2013, 2:30:50 PM5/1/13
to mvd...@googlegroups.com


On Wednesday, 1 May 2013 14:23:52 UTC-4, Rex Gozar wrote:
It's better to write them into a BAT file and execute it.


Agreed.  Though we don't use UV, we use the same concept with D3; have it write out a .bat file, then execute that.

--
Kevin Powick 

Scott Ballinger

unread,
May 1, 2013, 4:12:24 PM5/1/13
to mvd...@googlegroups.com
Ok, thanks Rex & Kevin.
I'll give that a try.
/Scott

Scott Ballinger

unread,
May 2, 2013, 4:03:42 PM5/2/13
to mvd...@googlegroups.com
Following up, it turns out that if you execute AcroRd32.exe with the /P (print) /S (suppress splash screen) and  /H (start minimized) switches you can print a PDF using the PC's default Windows printer without user input. I used the ATGETDIRLIST program from the Sample Pick/BASIC programs link on the Accuterm web site (asent.com) to poke around in c:\Program Files and resolve the full path to the installed version of the Adobe Reader executable, then use Accuterm to print the PDF locally. This works better than printing from the Windows server because the printer used is the user's default rather than the server's default.
/Scott
Reply all
Reply to author
Forward
0 new messages