Previous Thread
Next Thread
Print Thread
Printing a PDF #1147 11 Aug 15 10:21 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Maybe a lazy asking this question before really thinking harder about it, but any way thought i'll ask you guys what do you think the best way is to print an existing PDF to a printer from ATE (thats located on the local PC's network).

They have technical drawing PDF's and want them printed along with a Madics/Ashell Report ive written.
(does not need to be embedded, just printed after the report)

Thanks.

Re: Printing a PDF #1148 11 Aug 15 11:00 AM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Generally the easiest way to print an existing PDF is by command one of the PDF viewers to do it for you. I haven't reviewed the command line printing capabilities of the Adobe Reader, but in the past, it was somewhat lacking.

The developers of the PDFX driver also provide a viewer which does have much better options for printing via command line...

PDFX Viewer command line options

I think you can download and user the viewer for free, although it is a bit confusing because they also have a PRO version which they sell. You can download it and experiment either way; if it appears to you that you need the PRO version, check with Ty as I think it is possible we can bundle that with the PDFX driver at minimal or even no charge. PDFX Viewer Download Page

If you don't think that using an external EXE to print the PDF is convenient, we can look into other avenues...

Re: Printing a PDF #1149 11 Aug 15 11:05 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thanks, I'll have a play with calling a PDFX command line tomorrow...

Re: Printing a PDF #1150 12 Aug 15 06:24 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Not sure how reliable this will be (and will get the customer to test it) but first off found using MX_SHELLEX and PRINT option opened the PDF and printed it to the local printer. (but will they want it to go to the local printer!)

Code
CALL FN'LAUNCH'LOCAL("c:\temp\STEVE.PDF",1)
Code
!==============================================================================
!{Launch an Application/File}					! [021]
!==============================================================================
FUNCTION FN'LAUNCH'LOCAL(FN'FILE AS S2048,FN'ACTION AS F6)
! IN:  Fullpath and file name of local PC file
! IN: 0=Open, 1=Print
! OUT: 0=OK, 1=Failed/Not found.
ON ERROR GOTO LOCAL'TRAP
MAP1 LOCAL'FOUND,F,6
MAP1 LOCAL'STATUS,F,6
MAP1 LOCAL'HOST'COMMAND,S,2048
MAP1 LOCAL'ACTION,S,0					! [059]
        IF FN'ACTION=1 THEN LOCAL'ACTION="PRINT"	! [059]
	XCALL EXISTL,FN'FILE,LOCAL'FOUND
	IF LOCAL'FOUND=0 THEN
	   XCALL MESAG,"File was not found on local PC/network server"+CHR(13)+FN'FILE,2
	   FN'LAUNCH'LOCAL=1
	  ELSE
	   LOCAL'HOST'COMMAND=""""+FN'FILE+""""
	   XCALL MIAMEX,MX_SHELLEX,LOCAL'STATUS,LOCAL'HOST'COMMAND,LOCAL'ACTION    ! [059]
	   IF LOCAL'STATUS<>0 THEN
	      XCALL MESAG,"Error "+STR(LOCAL'STATUS)+" launching file/application"+&
	                   CHR(13)+LOCAL'HOST'COMMAND,2
	   ENDIF
	   FN'LAUNCH'LOCAL=0
	ENDIF
	EXITFUNCTION
LOCAL'TRAP:
 	XCALL MESAG,"Warning: Error "+STR(ERR(0))+" in FN'LAUNCH'LOCAL",2
	RESUME ENDFUNCTION WITH_ERROR 99
ENDFUNCTION

Re: Printing a PDF #1151 12 Aug 15 07:39 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
btw, I could not find PDFXCview.exe (from the PDFX3SA_sm-3.6.0.130.exe install)
As you say maybe is part of the Pro, or should I brave installing the latest PDF-XChange Viewer?
http://www.tracker-software.com/product/pdf-xchange-viewer

Re: Printing a PDF #1152 12 Aug 15 07:56 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
I braved it, and the following bare bones Command line worked too.

Code
"C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe"/print:default=yes:showui=yes:printer="HP LaserJet 2200 Series PCL 5" "c:\temp\0086-0647_A .pdf"
So I have some options to think about.

Re: Printing a PDF #1153 12 Aug 15 08:03 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
or
"C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe" /printto "HP LaserJet 2200 Series PCL 5" "c:\temp\STEVE.pdf"

Re: Printing a PDF #1154 12 Aug 15 10:32 AM
Joined: Nov 2006
Posts: 2,223
S
Stephen Funkhouser Offline
Member
Offline
Member
S
Joined: Nov 2006
Posts: 2,223
We too need a solution for directly printing a PDF in Window's. As we're potentailly moving more customer servers to the cloud (ec2 and Google compute) we have to do all of our printing through ATE. We've solved everything except directly spooling a PDF.

In the past I considered using Foxit Reader for this because it has a usable command-line to directly print the file; which, is something Adobe reader doesn't offer. I considered embedding a portable app version under the %ATE% directory via some server-side mechanism to ensure it was there and updated. I'd have to figure out how to handle this for Window's A-Shell as well; which, is a more complicated problem to solve.

At the time, this wasn't a pressing need because we could specially handle spooling PDF files on the Linux server, but now as we move to the cloud we need to reconsider how to accomplish this in a easily maintainable and consistent manner.

There is a portable app version of the PDF-X Viewer .

I'm not sure if this is a big enough community need for Microsabio to be involved or not.


Stephen Funkhouser
Diversified Data Solutions
Re: Printing a PDF #1155 13 Aug 15 01:52 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Stephen ive come up with a couple of ways to get the PDF printed from a command line or ATE (maybe that was the east bit) but currently still need to play more to be able to control it bit more, Eg. print landscape or portrait and print the PDF fit-to-page etc.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3