-
April 12th, 2014, 06:19 AM
#1
About Setting Print Options ..
Hi ..
I am using PDF Creator printer to print my files. I have set it as default printer.
It displays two dialogs .. "Printer Setup Dialog" and "Dialog asking filename and other details to save to file".
I want to avoid these two dialogs. But EndDoc calls the other dialog by default.
How to do this ?
pl guide ..
-
April 13th, 2014, 02:29 PM
#2
Re: About Setting Print Options ..
Originally Posted by new_2012
pl guide ..
pl post code using code tags.
-
April 14th, 2014, 12:47 AM
#3
Re: About Setting Print Options ..
Arjay Sir ,
Code:
void CftsexofflineviewerView::PrintData()
{
// TODO: Add your command handler code here
CftsexofflineviewerDoc *pDoc = GetDocument();
ASSERT_VALID(pDoc);
CDC dc;
CPrintDialog dlg(FALSE);
CPrintInfo pi;
dlg.GetDefaults();
dc.Attach(dlg.GetPrinterDC());
DOCINFO di;
::ZeroMemory(&di, sizeof(DOCINFO));
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = _T("TRY");
pDoc->TagPrintTubesFlag = 1;
m_nMaxPages = pDoc->TagPrintTubeCount;
if (!(OnPreparePrinting(&pi))) return; // Here Standard Print Setup Dialog (By DoPreparePrinting(pInfo) call. )
OnBeginPrinting(&dc, &pi);
dc.StartDoc(&di);
OnPrint(&dc, &pi);
dc.EndDoc(); // Here PDF Printer Save File Dialog function
OnEndPrinting(&dc,&pi);
}
I need to avoid both of the standard Print dialog boxes. I want to give File name and Path to PDF Creator Printer to save the data .
I have set PDF Creator Printer as default and have set the resolution , paper size etc.
I have read about setting PDF Creator printer but could not understand how to do that.
Last edited by new_2012; April 14th, 2014 at 03:10 AM.
Reason: to give proper code tags
-
April 14th, 2014, 03:05 AM
#4
Re: About Setting Print Options ..
First, please, edit your post to correct the closing Code tag. It must be a slash, not a backslash there.
Second, did you try to set the lpszOutput member of DOCINFO struct?
Victor Nijegorodov
-
April 14th, 2014, 03:11 AM
#5
Re: About Setting Print Options ..
Thank u VictorN sir .. I will try and will be back ..
I have corrected my Code Tag ..
-
April 14th, 2014, 03:50 AM
#6
Re: About Setting Print Options ..
VictorN Sir , I tried lpszOutput member of DOCINFO struct .. I filled it with required output file name . It created a file but that file was not in PDF format. PDF reader failed to open it. What additional settings I will need ? Pl guide
-
April 14th, 2014, 04:02 AM
#7
Re: About Setting Print Options ..
Originally Posted by new_2012
... It created a file but that file was not in PDF format. PDF reader failed to open it. What additional settings I will need ? Pl guide
I would begin with the reading the documentation about DOCINFO struct.
Victor Nijegorodov
-
April 14th, 2014, 04:55 AM
#8
Re: About Setting Print Options ..
I read the documentation ... pl give any clue ..
there is no INI file for PDF creator printer ..
-
April 14th, 2014, 05:47 AM
#9
Re: About Setting Print Options ..
What .ini do you mean? MSDN article DOCINFO doesn't mention any ini!
Perhaps you owuld need to specify lpszDatatype member of DOCINFO?
And sorry, I never tried to print into .pdf file, so cannot help you more.
Victor Nijegorodov
-
April 14th, 2014, 06:41 AM
#10
Re: About Setting Print Options ..
Thank you victorN sir ...
Before asking the clue , I had tried with lpszDatatype ..
Then I read articles on printing to fixed file .. and tried for .INI settings ..
I will work more on this .. Thankx a lott again
-
April 14th, 2014, 12:20 PM
#11
Re: About Setting Print Options ..
I use Win2PDF and it allows me to set a file name/location/quality before I print to Win2PDF, no dialogs pop up and nothing to output before saving as a PDF file...
I have been using this print driver since about 2006 with great success, but it's not free but close and worth every dollar.
Just a user, not connected with them in any other way.
http://www.win2pdf.com
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
April 15th, 2014, 02:20 AM
#12
Re: About Setting Print Options ..
Thank you vanaj sir .. I will definately try ..
-
April 15th, 2014, 06:59 AM
#13
Re: About Setting Print Options ..
Thank u Vanaj sir , VictorN sir and all of you ..
for win2pdf printer I was able to set lpszDatatype in printer setup
and then for DocInfo in my prog ..
All this worked well ..
-
April 15th, 2014, 12:33 PM
#14
Re: About Setting Print Options ..
Originally Posted by new_2012
Thank u Vanaj sir , VictorN sir and all of you ..
for win2pdf printer I was able to set lpszDatatype in printer setup
and then for DocInfo in my prog ..
All this worked well ..
Glad to help, their support is also great and quick also if needed.
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|