We've got a vertical niche app running in VFP 7, and have coached the
clients through installing PDF995 as a printer driver and it is working
very well for them to pick manually from a REPORT FORM TO PRINT PROMPT
situation. Now, we'd like to be able to offer them the ability to print
to a PDF as part of a pre-report dialog.
Basically, the code is picking the PDF995 printer from the list in
APRINTERS() ('cause some workstations have 'PDF995' installed and some
'PDF995Share') and issuing a:
SET PRINTER TO NAME lcPrinter
In the Debug window we are seeing SET("PRINT",2), the windows default,
stay the same, and SET("PRINT",3), the VFP currently selected printer,
switch to the PDF995 printer. That command is followed by a REPORT FORM
TO PRINTER.
Sometimes, it generates the PDF. Sometimes it comes out the Windows
default printer.
We've tried throwing in various time delays (WAIT NOWINDOW TIMEOUT and
DOEVENTS()) with no change.
Reports are all stripped of printer information.
Ideas?
Ted Roche
Ted Roche & Associates, LLC
Author: jgunva - John C. Gunvaldson
Posted: 2005-04-11 17:29:08 Link
Is it the TAG fields of the report?
It's necessary most of the time if you want to print to various printers
(not always the same printer) to clear the printer information stored
the TAG TAG2 and EXPR fields of the report...
Time for a test?
John
San Diego, CA
Author: jgunva - John C. Gunvaldson
Posted: 2005-04-11 17:32:44 Link
Ooops,
Had to scroll down to see the "Reports are all stripped of printer
information." Well, that's not it.
John
--- StripMime Report -- processed MIME parts ---
multipart/mixed
text/plain (text body -- kept)
application/ms-tnef
---
Ted we are doing something very similar but not with the same printer
driver.
Here is some snips of our code.
(in the click of the pdf button)
lc_printer = Set('printer',2)
If Thisform.setprinter()
Report Form &lcReport &lcScope To File pdf\temp.ps Noconsole
Set Printer To (lc_printer)
...
Endif
(In the setprinter method on the print dialog form)
llSuccess=.t.
ON ERROR llSuccess=.f.
SET PRINTER TO NAME PDFPrinter
ON ERROR oError.Handle(ERROR(), PROGRAM(), LINENO())
IF !llSuccess
MESSAGEBOX("Could not find the PDF Printer")
ENDIF
RETURN llSuccess
We've never had a problem.
Hope this helps.
Regards
Chris.
-----Original Message-----
From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com] On
Behalf Of Ted Roche
Sent: 11 April 2005 23:20
To: profoxtech@leafe.com
Subject: SET PRINTER TO NAME... doesn't, sometimes?
We've got a vertical niche app running in VFP 7, and have coached the
clients through installing PDF995 as a printer driver and it is working
very well for them to pick manually from a REPORT FORM TO PRINT PROMPT
situation. Now, we'd like to be able to offer them the ability to print
to a PDF as part of a pre-report dialog.
Basically, the code is picking the PDF995 printer from the list in
APRINTERS() ('cause some workstations have 'PDF995' installed and some
'PDF995Share') and issuing a:
SET PRINTER TO NAME lcPrinter
In the Debug window we are seeing SET("PRINT",2), the windows default,
stay the same, and SET("PRINT",3), the VFP currently selected printer,
switch to the PDF995 printer. That command is followed by a REPORT FORM
TO PRINTER.
Sometimes, it generates the PDF. Sometimes it comes out the Windows
default printer.
We've tried throwing in various time delays (WAIT NOWINDOW TIMEOUT and
DOEVENTS()) with no change.
Reports are all stripped of printer information.
Ideas?
Ted Roche
Ted Roche & Associates, LLC
[excessive quoting removed by server]
Author: Peter Cushing
Posted: 2005-04-12 04:14:52 Link
Ted Roche wrote:
> In the Debug window we are seeing SET("PRINT",2), the windows default,
> stay the same, and SET("PRINT",3), the VFP currently selected printer,
> switch to the PDF995 printer. That command is followed by a REPORT
> FORM TO PRINTER.
>
> Sometimes, it generates the PDF. Sometimes it comes out the Windows
> default printer.
>
Hi Ted,
I checked out some PDF printer drivers a while ago, including Expert
PDF, PDF995, PDF redirect,Virtual PDF and Win2PDF and the only one that
seemed to work reliably for me was the virtualPDF. Been using that now
for over a year with no problems. Not sure if other people have had
other results with PDF995. Got my Virtual PDF from
http://www.go2pdf.com/index.html
Peter
Author: adam buckland
Posted: 2005-04-12 04:34:06 Link
Hi Ted / Peter
I have had no problems with print2pdf as was recommended on this very
list.
To avoid the sort of problems picking printers I just have a print to
PDF entry on the menus.
-----Original Message-----
From: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] On
Behalf Of Peter Cushing
Sent: 12 April 2005 09:15
To: ProFox Email List
Subject: Re: SET PRINTER TO NAME... doesn't, sometimes?
Ted Roche wrote:
> In the Debug window we are seeing SET("PRINT",2), the windows default,
> stay the same, and SET("PRINT",3), the VFP currently selected printer,
> switch to the PDF995 printer. That command is followed by a REPORT
> FORM TO PRINTER.
>
> Sometimes, it generates the PDF. Sometimes it comes out the Windows
> default printer.
>
Hi Ted,
I checked out some PDF printer drivers a while ago, including Expert
PDF, PDF995, PDF redirect,Virtual PDF and Win2PDF and the only one that
seemed to work reliably for me was the virtualPDF. Been using that now
for over a year with no problems. Not sure if other people have had
other results with PDF995. Got my Virtual PDF from
http://www.go2pdf.com/index.html
Peter
[excessive quoting removed by server]
Ted,
I have been using "CutePdf Writer" printer driver with success
(www.cutepdf.com) I just verified the web site and they now have a pdf form
filler to fill in pdf files and print. They also have an SDK for $249, but
the pdf writer driver is free.
CutePdf Form Filer
Features Highlight
Save the data that you enter into a PDF form, fill it in offline, and later
print or submit your form.
Send a completed PDF form or just the form data as an e-mail attachment.
Export form data to a separate FDF, XFDF (XML-based FDF) or XML file.
Import form data from a FDF, XFDF or XML file.
Flatten PDF form to stamp content directly into the PDF document.
Add security (40-bit & 128-bit) to your PDF documents to prevent anyone from
changing it or altering the information.
$29.95
Alan Bain
For those tuning in late to the thread, a recap of the situation, and
some new symptoms:
Our clients (several) have purchased and deployed the PDF995 Suite. It
is a very nice solution to some complex problems, and we plan to stick
with it. Thanks for all of the alternate suggestions, but most were
considered and rejected. We are using some INI file programming in
other parts of the application, to produce uneditable, 128-bit
encrypted PDFs with great success, even over Terminal Services.
This app is running in VFP7 and using the Mere Mortals framework. Using
code based on that framework, the report requestor dialog has been
modified to give them a "Save to PDF" feature along with Print,
Preview, Export to Excel, Export to HTML, and a few others.
When the client selects the PDF output, just before issuing the REPORT
FORM command, we use the SET PRINTER TO NAME command to switch the
current VFP printer to PDF995. We've commented out the code that resets
the printer back to the originally selected one, and we do see the
PDF995 printer selected as SET("PRINT",3) at the end of the run. We've
also added various timeouts, as mentioned in the OP, below, with no
change.
Sometimes we get a PDF, sometimes it prints out on the (Windows
default) laser printer. It's not every-other-time, sometimes a batch
prints okay, sometimes the first one fails. No pattern discerned yet.
NEW INFORMATION: when we copy-and-paste the routine that issues SET
PRINTER from the code running before the report and add it to the
Report's Data Environment Init(), the report prints out PDFs, every
time (in the first several dozen tests, at least). Go figure. We'd
prefer not to have to copy-and-paste this code into dozens of reports,
but you do what you have to do to get the job done.
Insights, inquiries and comments welcomed.
On Apr 11, 2005, at 6:20 PM, Ted Roche wrote:
> We've got a vertical niche app running in VFP 7, and have coached the
> clients through installing PDF995 as a printer driver and it is
> working very well for them to pick manually from a REPORT FORM TO
> PRINT PROMPT situation. Now, we'd like to be able to offer them the
> ability to print to a PDF as part of a pre-report dialog.
>
> Basically, the code is picking the PDF995 printer from the list in
> APRINTERS() ('cause some workstations have 'PDF995' installed and some
> 'PDF995Share') and issuing a:
>
> SET PRINTER TO NAME lcPrinter
>
> In the Debug window we are seeing SET("PRINT",2), the windows default,
> stay the same, and SET("PRINT",3), the VFP currently selected printer,
> switch to the PDF995 printer. That command is followed by a REPORT
> FORM TO PRINTER.
>
> Sometimes, it generates the PDF. Sometimes it comes out the Windows
> default printer.
>
> We've tried throwing in various time delays (WAIT NOWINDOW TIMEOUT and
> DOEVENTS()) with no change.
>
> Reports are all stripped of printer information.
Ted Roche
Ted Roche & Associates, LLC
Author: Richard Kaye
Posted: 2005-04-12 09:48:37 Link
While I'm sure you're not going to use that VB approach you mentioned
<vbg>, I'll say this out loud anyway. Write yourself a nice little util
program to iterate through your reports folder and hack the FRXs by
adding the code you need. I've done this in the past to update labels,
change fonts, change paper size from A4 to letter, etc.
Ted Roche wrote:
> We'd prefer not to have to copy-and-paste this code into dozens of
> reports, but you do what you have to do to get the job done.
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
Author: Mcdaniel, Kristyne
Posted: 2005-04-12 16:03:33 Link
Ted,
I can recall a problem with Set Printer To Name with certain operating
systems. Sometimes they'd behave slightly differently and I had a hack
in place to handle each system differently.
Is there any pattern with the operating system on the machines that are
sending out this print file? If so, I can post my hack in the event that
it might help you.
Kris
Chance favors the prepared mind -- Louis Pasteur