Link to home
Start Free TrialLog in
Avatar of Sohela
Sohela

asked on

Save file without displaying the save dialog/prompt

Hello,
I am printing a file in pdf format using printdlg function but i want to save the file at the specified location without dispalying the save dialog / prompt. In the doc info structure it is taking only the name not the path even though i am specifying the path.It is a win32 appliccation.
di.lpszDocName = "C:\\Printing.pdf";
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sohela
Sohela

ASKER

Hi,
This is my printdlg structure
         PRINTDLG pd = {0};                        //  Reset on declare
        pd.lStructSize = sizeof (pd);
       pd.Flags = PD_RETURNDEFAULT | PD_PRINTTOFILE | PD_RETURNDC;

       DOCINFO di = {0};
       di.cbSize = sizeof (di);
       di.lpszDocName = "C:\\Printing.pdf";
       StartDoc (pd.hDC, &di);
        StartPage (pd.hDC);

As you mentioned i used it but it is giving another prompt/dialog and if i give path name or file it is not getting saved.I dont want any prompt/dialog it should directly print at the required path is there any function for that. I attaching the file like when the prompt is displayed.
output.JPG