Normal Topic FinishDocument() Preview? (Read 1309 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
FinishDocument() Preview?
Jan 3rd, 2010 at 1:49am
Print Post Print Post  
Is there a print preview command to use in place of FinishDocument()?  Or, is there a way to preview a document rather than having to send it directly to the printer when using the PrintString family of commands?

Thanks
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FinishDocument() Preview?
Reply #1 - Jan 3rd, 2010 at 12:24pm
Print Post Print Post  
You can set your default printer to print to a "PDF Printer" or the "Microsoft XPS Document Writer". Both of these will create a file that you can view with a PDF Reader or with the Microsoft XPS Viewer.

Most Windows systems have the Microsoft XPS Document Writer, but if not, you can download and install either .Net Framework 3.0 or the XPS Essential Pack from Microsoft, which will install it.

There are many free PDF creators. I happen to use PDF995. The free version is ad supported, but I use the paid version which works very well.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: FinishDocument() Preview?
Reply #2 - Jan 3rd, 2010 at 3:50pm
Print Post Print Post  
Thank you Carl,

I first had been trying to print an invoice from the Sesame Seasons Sample Invoice via the Print Invoice button.  That didn't work using the Microsoft XPS Viewer so I dowloaded and installed PDF995. That didn't work either, both docs ended up being stuck in the print Que.  

So I wondered if there was something wrong with the Sesame Seasons Sample Invoice.  I placed a command button on the Invoice form and programmed the list browser example; (NewPage(850, 1100) ,PrintString("Wild Bill Halpern", 100, 200, 0, "BArial", 33, 0),  FinishPage() into it.  This time it worked great with both programs.  So I'm assuming that there may be something amiss with the Sesame Seasons Sample Invoice.  

Any idea as to what modification the print invoice programming may need in the Sesame Seasons Sample?  I'd like to use this as a starting point for learning the code to build a new doc.

Thank you again for your help.

Brandon

  
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: FinishDocument() Preview?
Reply #3 - Jan 3rd, 2010 at 3:57pm
Print Post Print Post  
Scratch the last question, everything is working fine.

While trying to figure out how to get the invoice to print preview I had commented out FinishDocument() in the Print Invoice programming.  Changed it back and it's working great. 

Brandon
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FinishDocument() Preview?
Reply #4 - Jan 3rd, 2010 at 11:14pm
Print Post Print Post  
Glad you remembered that you changed the code. There is no way I would have guessed that you commented out the FinishDocument() line.   Wink

I think you will find printing to a PDF is of great value -- at least for saving the cost of ink & paper, if nothing else. The only time it doesn't suffice, is when you are printing to a pre-printed form of some kind that requires very precise placement of the data.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: FinishDocument() Preview?
Reply #5 - Jan 6th, 2010 at 1:05pm
Print Post Print Post  
Just an update Carl,

The reason I had commented out FinishDocument() was that I was trying to find a way to get the System Print Dialog to open so that a printer could be selected, although not aware at the time that I was going to have to print to a PDF printer.  What I’ve now stumbled on is AlternateDefaultPrinter().  So I start the code with AlternateDefaultPrinter("Microsoft XPS Document Writer") and follow FinishDocument() with RestoreDefaultPrinter().  This works nicely.

So, thanks again for your help.

Brandon
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FinishDocument() Preview?
Reply #6 - Jan 6th, 2010 at 9:03pm
Print Post Print Post  
You're welcome.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged