Visual Studio 2010  AxAcroPDF override print function

ColdBlueStehl
ColdBlueStehl used Ask the Experts™
on
I am using the Adobe Reader COM component to display a PDF on a windows form. I want my users to be able to print the pdf by using the floating toolbar within this tool. The problem I am having is the paper size. In this instance, I need to print to legal size paper, not letter, which is the printer default. Is there a way to override the print setting to automatically print to legal paper? I don't need to send to another printer - the default printer has the ability to print to legal. I just don't want the user to have to remember to change the paper size every time they hit the print button.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
It's been years since I worked with the Adobe PDF tools through programming, and I do not have that old code anymore. So I cannot give you a complete answer, and it might not be good for more recent versions of the tools. But here is what we did in these days.

We found an entry somewhere in the Windows Registry that defined the default printer. We thus simply recorded that entry, changed it temporarily for the printer that we needed, and then reset the setting to its original value once the printing was done.

There was one drawback with that method. If you have long print jobs, it's possible that the user switch to another window from which he will also try to print, and he may not notice that the default printer has been changed. You thus might want to display a warning message while your printing job is going on.

Author

Commented:
Thanks for taking the time to comment, though your solution isn't quite what I'm looking for.

I don't need to change the default printer. The printer can print legal size sheets, but it's default paper size is set to letter.
What I do need is the ability to print to legal automatically, without user interaction.  

When you define your own print dialog in vb, you can make changes to the PrintDialog to define almost any setting you need. Is the print dialog used by this add-in exposed in the same way? If so, how do you gain access to it? If not, is there another way to accomplish what I need?
Top Expert 2015
Commented:
In my experience, the Adobe tools were very limited. That is why we had to resort to many little tricks here and there in order to to what we wanted.

For the paper size, we went for the same trick. We found and entry for Letter in the registry that was associated with a key for our printer, and switched it to Legal while we were printing some reports. However, I understand that not all printers record their settings in the registry.

But after lot of frustrations we ended up using a freeware that we found at ComponentSource. It was very easy to use and gave us more options than the Adobe PDF Writer that made us lose so much time. Unfortunately, I do not remember the name of the component, and anyway, it did not make it past Vista, so I cannot suggest it to you. You might give them a look however, they might have another one that comes free or cost very little.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial