Solved

VB.Net Using Printform Component with PDF Writer

Posted on 2014-12-29
3
255 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit the loop 4 42
Run a batch file when a Crystal Report is opened 5 27
VB.Net - KeyPress Event 4 36
Expression Evaluater 3 25
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

773 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