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
Solved

VB.Net Using Printform Component with PDF Writer

Posted on 2014-12-29
3
259 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Title # Comments Views Activity
Disable extension 8 48
cannot connect to sqlserver 8 34
Create a datatable in vb.net dynamically 1 22
VB.NET - Refactor Class per SOLID principles 2 16
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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