Solved

VB.Net Using Printform Component with PDF Writer

Posted on 2014-12-29
3
260 Views
Last Modified: 2015-01-08
Please can someone help with this stupid and annoying problem.

I am using the Printform Component to print a copy of the current form to the default printer which is CutePDF.
All works perfectly except that when the CutePDF Printer Dialog Box comes up it stays behind the form I am printing, so the user cannot see it unless they click the mouse.   Same thing happens if I print preview or direct to the printer.
I don't actually need the dialog box, but cant stop it in CutePDF

I have tried programmatically clicking the mouse (crashed the system), "Finding" the CutePDF box (didn't work), I've run out of ideas

Can someone help please?

Many Thanks
0
Comment
Question by:PNRT
3 Comments
 
LVL 40
ID: 40522613
PrintForm probably forces the form to stay at the top so that it can grab the bitmap.

The CutePDF dialog usually shows after the data has been sent to the virtual printer, so you might be able to work something by hiding or minimizing your form after the print command has been sent. Maybe wait a second or two, with the help of a timer or a Threading.Sleep before doing so.
0
 
LVL 2

Author Comment

by:PNRT
ID: 40523234
Hi, you're right that's exactly what happens.  But with Preview for instance, the preview dialog box stays in control until you click print.  There is no way to capture that click so there is no way to get the CutePDF dialog box to show,
I've been trying a solution where I get the handle of the CutePDF dialog box and use a timer to bring it forward with  
 SetForegroundWindow.     This doesn't work either and produces weird behaviour in the timer that wont disable and I suspect again that it is because the Printform component won't relinquish command until after the print
Thanks for the help
0
 
LVL 1

Accepted Solution

by:
Niladrisekhar Dey earned 500 total points
ID: 40525578
Use Microsoft Report and export it as PDF without having any dependency on PDF Printer.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question