Home > Blockchain >  How to skip choosing folder in microsoft pdf printer?
How to skip choosing folder in microsoft pdf printer?

Time:09-17

I use MFC and understand how skip configuration menu (set pInfo->m_bDirect to false). But I want set folder and filename programmatically without special dialog. If it is impossible, can you advice me pdf printer with this functionality(may be changing configuration file for this goal)

CodePudding user response:

One question at a time, has limitations so here goes.

Q.) I want set folder and filename programmatically without special dialog.

A.) If you look at the output port of a recent windows installation of Microsoft Print To PDF

(https://img.codepudding.com/202109/3f31342283504b58ad47ceed94748ab3.png)

You may note it is set to PORTPROMP: and that is exactly what causes the request for a filename.

You might note lower down, I have several ports set to a filename, and the fourth one down is called "My Print to PDF"

enter image description here

So very last century methodology; when I print with a *duplicate printer but give it a different name I can use different page ratios etc., without altering the built in standard one. The output for a file will naturally be built:-

Exactly in one repeatable location, that I can file monitor and rename it, based on the source calling the print sequence, such that if it is my current default printer I can right click files to print to a known \folder\file.pdf

Your next question will be how to change the target location and that is done behind the scenes when using apps such as WordPad Command Line printing where we can specify the port name on the command line.

Some users will use a Port Redirection Monitor (Do NOT use RedMon as unsupported in Win 10, consider Multi Port Redirector)

Other Users will interact with the duplicate named printer directly via PrintUI where you can alter output port, rotation or paper format etc.

And for your usage you could try one of these for hints, with your newly defined PDF printer:-

Microsoft Web Browser ActiveX control - printing to a specified (non default) printer

Programmatically set filename and path in Microsoft Print to PDF printer

  • Related