Link to home
Get AccessLog in
Avatar of ColdBlueStehl
ColdBlueStehl

asked on

Visual Studio 2010 AxAcroPDF override print function

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.
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

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.
Avatar of ColdBlueStehl
ColdBlueStehl

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Avatar of hdhondt
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.