Set_Printer("INIT") Statement (OpenInsight 32-bit Specific)
At 28 OCT 2004 12:56:20PM Casey Greenwood wrote:
I working utilizing PDF's for my reporting in my current system. I have run across a problem I'm wondering if anyone has an answer to. I would like to export a file to pdf to be saved in a specific location as well as print the file at the same time. Currently I can set the Set_Printer("INIT") statement to Preview and it will save the file to the location. If I set the same statement to Print, the file is not saved. This happens even though I am setting the Export Format in both statements to PDF.
Is is possible to do both – Save the file to a specific location while it Prints???
Here's an example of my code:
* PDF ACTION IS DEFINED EARLIER BUT BASICALLY ASKS * USER WHETHER THEY WISH TO PREVIEW OR PRINT
FILENAME=TEXT TEST PRINT':@FM:
:@FM: 6 :@FM: 'C:\REGFILE.PDF' MARGINS=0.4:@fm:1.5:@fm:0.4:@fm:0.6 IF pdf_action=PREVIEW' THEN * THIS STATEMENT SETS THE FILE TO SPECIFIC LOCATION stat_init=Set_Printer("INIT", FILENAME,
, MARGINS, 0,5:@VM:@VM:1) END ELSE *** THIS STATEMENT PRINTS THE FILE DIRECTLY BUT DOESN'T SAVE IT stat_init=Set_Printer("INIT", FILENAME,
, MARGINS, 0) END Any help would be appreciated. Casey Greenwood </QUOTE> —- === At 28 OCT 2004 02:29PM Don Miller wrote: === <QUOTE>I don't think that OIPI will do both at once. I had a similar problem a while back. I saved the file as a PDF and then launched Adobe Reader. I know it takes twice as long as what you'd like, but I don't think the output stream can be directed to two different logical devices at the same time. Don Miller </QUOTE> —- === At 28 OCT 2004 04:03PM Casey Greenwood wrote: === <QUOTE>Thanks Don, I kind of figured that was the problem. I launch Adobe too with the preview but was hoping to save them the step of having to hit print in Adobe. I may just have to try to create the same PDF twice in a couple of my reports, one that will save to a file, the other that will print, but it's going to be a lot of redundant code. Casey </QUOTE> —- === At 30 OCT 2004 02:22AM Barry Stevens wrote: === <QUOTE>In your code, after the file is created by oipi do: Cmd="C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" /p /h ':quote(Path:FileName) utility("RUNWIN",Cmd) </QUOTE> —- === At 30 OCT 2004 03:52AM Bob Silverstein wrote: === <QUOTE>Here is my approach to a slightly different task. I save the file as a PDF but preview it before printing. Here is my code. PARAM1=' PARAM2=' PARAM5=' PARAM1=6 FILE=:\AREV3A\DSR'S\20": DATE-2, 2 : '\': DATE1, 3 : '\DSR ' : FMT(DATE(), 'DH') : '.PDF' PARAM1=DRIVE : FILE PARAM2=DSR for ' : FMT(DATE(), 'DH') PARAM5=3 PARAM5=0 PARAM5=0 PARAM5=0 PARAM5=0 PARAM5=7 PARAM5=-1 A=SET_PRINTER('INIT', PARAM1, PARAM2,,
, PARAM5) Sometimes, I email the PDF and found out that the third-party PDF generator creates a PDF that AOL and some other ISP's trash. This does not happen with the Acrobat PDF-Writer. </QUOTE> View this thread on the forum...