Solved

VB.Net Using Printform Component with PDF Writer

Posted on 2014-12-29
3
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 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