Focal Point
auto print in Web Focus

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7001044842

September 24, 2007, 03:25 PM
Prasanna
auto print in Web Focus
Hi,

I need to auto print the pdf files depending upon the selection on the html file .Once the parameters are entered in the html,the fex file get executed and the pdf files are generated. Our current situation is the user needs to open the pdf manually and get it printed.

But the user needs to auto print the pdf files without manually opening it.I have tried the following options to do this:

The following is an example of the code:

-FILEDEF TEST1 DISK C:\WORK\TEST1.PDF
-RUN

SET PRINTPLUS=ON
SET STYLEMODE=PAGED

TABLE FILE CAR
PRINT
MODEL
BODYTYPE
SEATS
BY CAR
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS TEST1 FORMAT WP
END
RUN


I have tried the following:

DOS PRINT /D:\\Device C:\WORK\TEST1.PDF also I have tried using DOS COPY .when I executed the fex I’m getting the error message as 0 number of records in table. It’s possible for me to manually open the pdf and see the content but it’s not possible to auto print it.
I have tried the PS Format too but I got the error message as 0 PS file saved. Any suggestion for this issue is highly appreciated. I’m using Web focus Developer Studio version: 7.1.7

Thanks
Prasanna
September 24, 2007, 03:35 PM
cmallain
Hmmm...I really don't think that this is possible? It is my understanding that when FOCUS passes the control over to "3rd party" PDF or Excel, the control is in the hands of that software. I guess the real question would be can you get ANY PDF to print automatically? Maybe if you search PDF's website? Is there an autoprint in Javascript?

Not to be a do-gooder or get on a soap box of any kind, why would a user want to do this? It could potentially be an awful waste of paper/trees.

Good luck,
Carol


------------------------------------------
last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
September 24, 2007, 03:50 PM
Francis Mariani
WebFOCUS
quote:
passes the control over to "3rd party"
when you're using PCHOLD. When you're using HOLD, the file is created in the designated location on the server and the program continues, so, you should theoretically be able to automatically print the PDF file. Dn't forget that this is happening on the server, so the printer must be addressable by the server.

Your example shows FILEDEF is PDF, but the format is WP - it should be PDF.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 24, 2007, 04:31 PM
N.Selph
Usually if you want to "auto-print", you use format PS, not PDF. It behaves almost the same, but can be printed via an operating system command (at least in Unix and Windows).


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
September 25, 2007, 12:16 PM
Darin Lee
PDF and Postscript(PS) are their own "languages" (sorry couldn't think of a better term). If you open a PDF document in a text editor, you can see that it contains more than just what you see on the report. If it contains images, embedded fonts, lines, etc., those are all written into the document. So naming the file with a .PDF and holding format WP is like calling an elephant a duck. You can call it whatever you want but it's still an elephant.
That being said, here's a couple suggestions. As mentioned, if you want the output to be sent directly to a printer, hold format PS, then use a system command like lineprint to print it natively(lpr -S printer IP -P printer queue/DEFAULT filename).
You could also set up FEX that could be scheduled dynamically in ReportCaster and use RC's printer distribution functionality. Note that both of these require that the printer must be postscript-capable. More and more business-class printers these days come with the functionality built in, but many require an additional module or do not have this functionality at all.
Last, most printers, by theirselves, do not understand what a PDF document is. If you use a DOS print command, you just get a bunch of text. It must be manually opened and printed from an application like Adobe Reader. However, many printers now have multiple queue functionality and are smart enough to pick up a document in a specified queue and handle it differently than other queues. This gives it the ability to pick up a document sent to a "PDF" queue render its image in a PDf document, and then print it. We're probably talking $$$ here if you don't currently have that functionality.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 25, 2007, 02:08 PM
Sayed
Prasanna,

Your issue might be on the DOS PRINT command. Were you able to do a DOS PRINT outside of WebFOCUS? This can be tricky if your are using a TCP/IP Printer. http://8help.osu.edu/3274.html


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE