Solved

VB.Net Using Printform Component with PDF Writer

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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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 1

Author Comment

by:PNRT
Comment Utility
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
Comment Utility
Use Microsoft Report and export it as PDF without having any dependency on PDF Printer.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now