Hi there, can anyone tell me if the following is possible?
We wish to be able to programmatically print multiple files while only raising one initial print dialog box. Currently we sort of acheive this by calling the PrintDocument() command for the first file, and then for subsequent files calling PrintDocument() with the PXCVA_Flags.PXCVA_NoUI flag. The main issue here is that any print settings set in the initial dialog are not persisted to the subsequent silent prints. Is there a way to invoke silent prints while persisting the print settings from the initial print that used the initial dialog?
Thanks in advance for any tips/assistance....
Printing multiple files with only one dialog
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 16
- Joined: Fri Jan 21, 2011 7:17 pm
-
- User
- Posts: 381
- Joined: Mon Jun 13, 2011 5:10 pm
Re: Printing multiple files with only one dialog
I will check to see whether it is possible to do this with one simple command (save all print settings), but in the meantime you can do it with GetProperty and SetProperty.
E.g.:
After opening the print dialogue and printing, save the setting for "Collate" with:
HRESULT hr = m_spView->GetProperty(CComBSTR("Print.Collate"),&m_collate,0);
And then before successive prints you can restore the setting (if needed) with SetProperty:
HRESULT hr = m_spView->SetProperty(CComBSTR(L"Print.Collate"), m_collate, 0);
See the manual section 2.2.2.14 "Print" for a list of print properties.
The above are C++ examples but you can do the equivalent in your language of choice.
E.g.:
After opening the print dialogue and printing, save the setting for "Collate" with:
HRESULT hr = m_spView->GetProperty(CComBSTR("Print.Collate"),&m_collate,0);
And then before successive prints you can restore the setting (if needed) with SetProperty:
HRESULT hr = m_spView->SetProperty(CComBSTR(L"Print.Collate"), m_collate, 0);
See the manual section 2.2.2.14 "Print" for a list of print properties.
The above are C++ examples but you can do the equivalent in your language of choice.
-
- User
- Posts: 16
- Joined: Fri Jan 21, 2011 7:17 pm
Re: Printing multiple files with only one dialog
This seems to work partially, however it does not seem to persist any changes made to the actual printer. Ie if you change any printer properties those only seem to affect the initial document being printed out when the print dialog opens initially.
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: Printing multiple files with only one dialog
Not all settings are stored by Print dialog (for example, paper size, collate option, duplex, orientation) are not stored.
PDF-XChange Co Ltd. (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 381
- Joined: Mon Jun 13, 2011 5:10 pm
Re: Printing multiple files with only one dialog
I believe printer properties are handled by the printer drivers, which we wouldn't have access to (other than our own PDF-XChange driver, via the API, of course)... and default printer is likewise a system setting (windows OS).JGForwick wrote:This seems to work partially, however it does not seem to persist any changes made to the actual printer. Ie if you change any printer properties those only seem to affect the initial document being printed out when the print dialog opens initially.
Am checking with a colleague to see if he knows of a way, though. So please bear with us.
-
- User
- Posts: 57
- Joined: Mon Aug 01, 2005 2:33 pm
Re: Printing multiple files with only one dialog
Hi,
very interesting posting but i did not find the answer on this:
Is there any simple command to save all print settings from the print dialog to a variable?
e.g.
Thanks,
Karl
very interesting posting but i did not find the answer on this:
Is there any simple command to save all print settings from the print dialog to a variable?
e.g.
Code: Select all
GetProperty("Print", oVariablePrintSettings)
Thanks,
Karl
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: Printing multiple files with only one dialog
Hi Karl,
NO simple/single line way to do this, but you should still be able to set all printer settings as needed:
Viewer v2.5 ActiveX SDK > Reference > Named Items > Objects > Print
Regards,
Stefan
NO simple/single line way to do this, but you should still be able to set all printer settings as needed:
Viewer v2.5 ActiveX SDK > Reference > Named Items > Objects > Print
Regards,
Stefan
-
- User
- Posts: 57
- Joined: Mon Aug 01, 2005 2:33 pm
Re: Printing multiple files with only one dialog
Hello Stefan,
I did it already with the printer settings from the Print-object but was curious if there was an easier solution.
Thank you for your anwer!
Best regards,
Karl
I did it already with the printer settings from the Print-object but was curious if there was an easier solution.
Thank you for your anwer!
Best regards,
Karl
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am