Programmatically set Print Driver settings
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Programmatically set Print Driver settings
Hi,
I'm trying to use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file to a folder, without any user intervention.
Essentially, I want to programmatically set the Print Driver settings to suppress the Save As dialog and specify a PDF filename/location, and save to the file without the user being aware that this has occurred (for storage in a Document Management System)
I will also print a hardcopy for the user, at the same time using a different print driver.
After printing the hardcopy, I programmatically set the printer to be the PDF printer and call the Quick Report "Print" method.
As I am not using the PDF Xchange APIs such as PXC_WriteDocumentExA to create the PDF file, I was hoping that by programmatically changing the Print Driver settings each time I print a report, I could then control how the file is saved?
Is this possible, and is there any example code I could use?
Thanks,
Mike
I'm trying to use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file to a folder, without any user intervention.
Essentially, I want to programmatically set the Print Driver settings to suppress the Save As dialog and specify a PDF filename/location, and save to the file without the user being aware that this has occurred (for storage in a Document Management System)
I will also print a hardcopy for the user, at the same time using a different print driver.
After printing the hardcopy, I programmatically set the printer to be the PDF printer and call the Quick Report "Print" method.
As I am not using the PDF Xchange APIs such as PXC_WriteDocumentExA to create the PDF file, I was hoping that by programmatically changing the Print Driver settings each time I print a report, I could then control how the file is saved?
Is this possible, and is there any example code I could use?
Thanks,
Mike
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike,
What you need is the PDF-XChange Drivers API SDK, this allows you to do all you need and an ActiveX is available.
Eval download
https://www.pdf-xchange.com/PDFX4API.zip
There is not currently a Delphi example as there was in V3 - but if you have problems please let me know and I will try and arrange for one - or if you get so far and post what you have it will be quicker to get this debugged and checked.
Hope that helps
What you need is the PDF-XChange Drivers API SDK, this allows you to do all you need and an ActiveX is available.
Eval download
https://www.pdf-xchange.com/PDFX4API.zip
There is not currently a Delphi example as there was in V3 - but if you have problems please let me know and I will try and arrange for one - or if you get so far and post what you have it will be quicker to get this debugged and checked.
Hope that helps
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Thanks for the quick reply!
I should have been more specific - the version I have is "PDF-XChange 4 PRO SDK", which I believe is the appropriate version to do this?
I downloaded it yesterday, so am just starting to make sense of it all ...
If you are able to arrange for a simple Delphi example, that would help me a lot. Failing that, any pseudo code would give me a good start.
Many thanks,
Mike
I should have been more specific - the version I have is "PDF-XChange 4 PRO SDK", which I believe is the appropriate version to do this?
I downloaded it yesterday, so am just starting to make sense of it all ...
If you are able to arrange for a simple Delphi example, that would help me a lot. Failing that, any pseudo code would give me a good start.
Many thanks,
Mike
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike,
I wil request this - in the meantime - the help file you need is PDFX4DRV_API.chm or PDFX4DRV_API.PDF - there is also a VB example which may or may not be of help.
I wil request this - in the meantime - the help file you need is PDFX4DRV_API.chm or PDFX4DRV_API.PDF - there is also a VB example which may or may not be of help.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Deployment questions
Hi,
I have managed to get my application printing a Delphi Quickreport as a PDF saved silently to a file with the code below -
var
iPXCC: IPXCControlEx;
iPXCP: OleVariant;
begin
iPXCC := CoCPXCControlEx.Create;
try
Key := '...';
DevCode := '...';
iPXCP := iPXCC.Get_Printer('', 'PDF-XChange 4.0', Key, DevCode);
iPXCP.Option['Saver.ShowProgress'] := 0;
iPXCP.Option['Save.SaveType'] := 'Save';
iPXCP.Option['Save.ShowSaveDialog'] := 0;
iPXCP.Option['Save.File'] := 'C:\'
iPXCP.Option['Save.WhenExists'] := 'AutoNumber';
iPXCP.Option['Save.RunApp'] := 0;
... Print QuickReport ...
finally
iPXCC := nil;
end;
end;
... but by using just this code alone, I am unsure how or what I need to deploy to the users machines?
I'm assuming the following, but would appreciate some specific details, please -
1. Print Driver installation - How?
2. PDF Saver exe - presumably saved in my application's exe folder? Registered somehow? (what about the drvui40.dll, dinfo.dsf and titrules.js - do these need deploying?).
3. Some PDF Xchange DLLs? - which ones, Registered somehow?
Thanks in advance,
Mike
I have managed to get my application printing a Delphi Quickreport as a PDF saved silently to a file with the code below -
var
iPXCC: IPXCControlEx;
iPXCP: OleVariant;
begin
iPXCC := CoCPXCControlEx.Create;
try
Key := '...';
DevCode := '...';
iPXCP := iPXCC.Get_Printer('', 'PDF-XChange 4.0', Key, DevCode);
iPXCP.Option['Saver.ShowProgress'] := 0;
iPXCP.Option['Save.SaveType'] := 'Save';
iPXCP.Option['Save.ShowSaveDialog'] := 0;
iPXCP.Option['Save.File'] := 'C:\'
iPXCP.Option['Save.WhenExists'] := 'AutoNumber';
iPXCP.Option['Save.RunApp'] := 0;
... Print QuickReport ...
finally
iPXCC := nil;
end;
end;
... but by using just this code alone, I am unsure how or what I need to deploy to the users machines?
I'm assuming the following, but would appreciate some specific details, please -
1. Print Driver installation - How?
2. PDF Saver exe - presumably saved in my application's exe folder? Registered somehow? (what about the drvui40.dll, dinfo.dsf and titrules.js - do these need deploying?).
3. Some PDF Xchange DLLs? - which ones, Registered somehow?
Thanks in advance,
Mike
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi,
pleased you got there.
We provide (and require) that you use the PDF-XChange Drivers SDK end user distribution installer - this installs all you need if you are just using the print driver and not our library DLL functions (other than your own application) and ensures it is installed correctly for the correct OS (32/64 bit etc) - as with any device driver it does require Admin rights on installation - but not to use. It can also be called from your own app's installer and run silently with ceratain install switches allow such as whether to reboot (required on an update) and where to install etc.
This is the distribution file you would include and use :
https://www.pdf-xchange.com/PDFX4SA_sm.zip
Hope that helps.
pleased you got there.
We provide (and require) that you use the PDF-XChange Drivers SDK end user distribution installer - this installs all you need if you are just using the print driver and not our library DLL functions (other than your own application) and ensures it is installed correctly for the correct OS (32/64 bit etc) - as with any device driver it does require Admin rights on installation - but not to use. It can also be called from your own app's installer and run silently with ceratain install switches allow such as whether to reboot (required on an update) and where to install etc.
This is the distribution file you would include and use :
https://www.pdf-xchange.com/PDFX4SA_sm.zip
Hope that helps.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Also - a little late perhaps - but maybe interesting as a comparison, a Delphio example.
Thanks.
Thanks.
- Attachments
-
- DriverAPI.zip
- Delphi Example
- (272.83 KiB) Downloaded 221 times
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Thanks for the deployment exe and the Delphi example.
I've not changed my code from the example I've given earlier above, but after running the exe - https://www.pdf-xchange.com/PDFX4SA_sm.zip on a clean pc, I get a "Class not registered" error when I call the ActiveX object.
Do I need to also manually register some DLLs (if so, which ones?), or is there a different deployment exe I should be using instead?
As I say, the ONLY code I have written to interface with your PDF print driver is shown above (obviously after importing the PDF-XChange V4.0 Type Library into Delphi to enable the ActiveX OleServer control to be called), so hopefully this will be enough to determine what/how I need to deploy ... ?
Thanks,
Mike
I've not changed my code from the example I've given earlier above, but after running the exe - https://www.pdf-xchange.com/PDFX4SA_sm.zip on a clean pc, I get a "Class not registered" error when I call the ActiveX object.
Do I need to also manually register some DLLs (if so, which ones?), or is there a different deployment exe I should be using instead?
As I say, the ONLY code I have written to interface with your PDF print driver is shown above (obviously after importing the PDF-XChange V4.0 Type Library into Delphi to enable the ActiveX OleServer control to be called), so hopefully this will be enough to determine what/how I need to deploy ... ?
Thanks,
Mike
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike
Please run "pdfSaver4.exe /RegServer"
This should really I believe be part of the automated install and I have asked our dev team to modify the install accordingly.
thanks
Please run "pdfSaver4.exe /RegServer"
This should really I believe be part of the automated install and I have asked our dev team to modify the install accordingly.
thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Thanks for this, it did the trick.
As far as incorporating the PDF Saver registration into the automated installation executable - could I be notified when this is done, and is this likely to be within a few weeks time?
I would rather deploy one executable to install / register the software, than having to register PDF Saver separately.
Thanks again for your help.
Mike
As far as incorporating the PDF Saver registration into the automated installation executable - could I be notified when this is done, and is this likely to be within a few weeks time?
I would rather deploy one executable to install / register the software, than having to register PDF Saver separately.
Thanks again for your help.
Mike
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike,
for sure I will let you know and I will do my utmost to have this posted early next week.
many thanks.
for sure I will let you know and I will do my utmost to have this posted early next week.
many thanks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Hi,
I've ran this install against against a PC that previously had version 3 installed (not sure if that is relevent), but there was an error during the installation (see attachment).
I'm assuming this is an oversight when updating the installer to use the latest version of PDFSaver - could you please arrange for the installer to be updated?
Thanks,
Mike
I've ran this install against against a PC that previously had version 3 installed (not sure if that is relevent), but there was an error during the installation (see attachment).
I'm assuming this is an oversight when updating the installer to use the latest version of PDFSaver - could you please arrange for the installer to be updated?
Thanks,
Mike
- Attachments
-
- PDFXchange_install_error.zip
- Install error message
- (12.02 KiB) Downloaded 213 times
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike,
please advise what OS this is and at what point in the install this happens - I cannot reproduce this problem here when running.
thanks
please advise what OS this is and at what point in the install this happens - I cannot reproduce this problem here when running.
thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
We are using XP SP2.
I've attached a screenshot showing the other trial versions (v3) that are present on this pc.
Thanks,
Mike
I've attached a screenshot showing the other trial versions (v3) that are present on this pc.
Thanks,
Mike
- Attachments
-
- PDFXChange_Installation.zip
- PDF Installation
- (53.3 KiB) Downloaded 216 times
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Hi Mike,
could you please download and test the file below and advise if this resolves for you :
https://www.pdf-xchange.com/PDFX4SA_sm_Test.zip
Thanks
could you please download and test the file below and advise if this resolves for you :
https://www.pdf-xchange.com/PDFX4SA_sm_Test.zip
Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Excellent - thanks Mike.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com