Error when printing from command line
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 19
- Joined: Tue Dec 15, 2009 12:50 am
Error when printing from command line
I have created a small VB.net program to do some automated printing using PDF-XChange Viewer. The program takes a list of PDF files to be printed & creates the arguments that get passed to PDF-XChange Viewer, which then silently prints the files. This process works great, except that after it has printed several thousand files it displays an error message that says:
"Couldn't acquire sufficient system-resources to open 'SomePdfFileName.pdf' document: TOO MANY USER/GDI objects are being used by other applications. Please close applications (or close open documents here) to release system resources, and try again..."
There are no other applications running on the PC, besides my little VB program. Are there any known issues with printing a large number of files from the command line that would be causing this error to occur? The only way to get it to print again is to restart the PC (it's running Windows 10 64bit). Then it will start printing again until it has printed several thousand files & then the error pops up again, like clockwork. Are there any settings in PDF-XChange viewer I should be looking at that might fix this for me? I would really like this process to work reliably for me, so any advice would be greatly appreciated. Thanks...
"Couldn't acquire sufficient system-resources to open 'SomePdfFileName.pdf' document: TOO MANY USER/GDI objects are being used by other applications. Please close applications (or close open documents here) to release system resources, and try again..."
There are no other applications running on the PC, besides my little VB program. Are there any known issues with printing a large number of files from the command line that would be causing this error to occur? The only way to get it to print again is to restart the PC (it's running Windows 10 64bit). Then it will start printing again until it has printed several thousand files & then the error pops up again, like clockwork. Are there any settings in PDF-XChange viewer I should be looking at that might fix this for me? I would really like this process to work reliably for me, so any advice would be greatly appreciated. Thanks...
-
- Site Admin
- Posts: 1645
- Joined: Thu Mar 27, 2014 6:14 pm
Re: Error when printing from command line
Hi nbrege,
It seems that you are running out of system memory. If possible, you may need to tell your VB program to release the memory sectors once they are no longer in use.
You could also try using the more advanced Editor to do this. You can download it here: https://www.pdf-xchange.com/PDFXVE6.zip
I hope this helps!
It seems that you are running out of system memory. If possible, you may need to tell your VB program to release the memory sectors once they are no longer in use.
You could also try using the more advanced Editor to do this. You can download it here: https://www.pdf-xchange.com/PDFXVE6.zip
I hope this 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.
Cheers,
Patrick Charest
Tracker Support North America
Thank you.
Cheers,
Patrick Charest
Tracker Support North America
-
- User
- Posts: 19
- Joined: Tue Dec 15, 2009 12:50 am
Re: Error when printing from command line
I thought that at first too, that the PC was running out of memory. But when I get the error, Windows Task Manager says that there is roughly as much free memory available as when I restart the PC, before doing any printing. So I dont believe that the VB program is holding on to memory.
-
- Site Admin
- Posts: 7370
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Error when printing from command line
Hi nbrege
this is more likely to be an issue related to handles than RAM. I exoect you have too many handles required to open multiple files.
The suggestion is to pass one file at a time and ensure it is closed before passing the next file. That should stop you keeping handles on objects that are not needed, freeing up more for your current process.
Related reading:
http://stackoverflow.com/questions/9514 ... s-too-many
https://blogs.msdn.microsoft.com/oldnew ... 0/?p=25963
Hope that helps
this is more likely to be an issue related to handles than RAM. I exoect you have too many handles required to open multiple files.
The suggestion is to pass one file at a time and ensure it is closed before passing the next file. That should stop you keeping handles on objects that are not needed, freeing up more for your current process.
Related reading:
http://stackoverflow.com/questions/9514 ... s-too-many
https://blogs.msdn.microsoft.com/oldnew ... 0/?p=25963
Hope that helps
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 19
- Joined: Tue Dec 15, 2009 12:50 am
Re: Error when printing from command line
My program does only pass 1 file at a time & I have a 1 second delay between files. As the program is running through the list I can see in Task Manager that each instance of the PDFXCview.exe process opens & closes as it prints the file, so I dont believe there is any buildup of handles. I just know that something is building up somewhere on the PC that is consuming resources and eventually causing the error. I just wish I knew how to find it...
-
- Site Admin
- Posts: 7370
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Error when printing from command line
HI nbrege
what does Process Explorer tell you? How many handles are you averaging per file?
https://technet.microsoft.com/en-us/sys ... lorer.aspx
what does Process Explorer tell you? How many handles are you averaging per file?
https://technet.microsoft.com/en-us/sys ... lorer.aspx
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 19
- Joined: Tue Dec 15, 2009 12:50 am
Re: Error when printing from command line
Just using the Windows Task Manager to monitor the handles, I see that each instance of the PDFXCview.exe process uses approximately 200-300 handles, which doesnt seem excessive to me.
-
- Site Admin
- Posts: 7370
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Error when printing from command line
Hi nbrege
I would agree - those numbers are very reasonable. They are not growing over time?
Do you find that you get through a certain number of documents before the error become apparent or does it happen from the first file to be printed?
I would agree - those numbers are very reasonable. They are not growing over time?
Do you find that you get through a certain number of documents before the error become apparent or does it happen from the first file to be printed?
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 19
- Joined: Tue Dec 15, 2009 12:50 am
Re: Error when printing from command line
Yes, it fails after it has printed several thousand files, like clockwork. Then I have to restart the PC & it will print again until it has printed several thousand files & then fails again.
I have pretty much concluded that it is PDF-XChange viewer that is causing the problem & not my VB app. I wrote a test app that opens & closes Notepad 10000 times in a row, using the same method I am using to call PDFXCview.exe, with no issues.
So it appears that PDF-XChange Viewer is holding on to resources even after it terminates.
I have pretty much concluded that it is PDF-XChange viewer that is causing the problem & not my VB app. I wrote a test app that opens & closes Notepad 10000 times in a row, using the same method I am using to call PDFXCview.exe, with no issues.
So it appears that PDF-XChange Viewer is holding on to resources even after it terminates.
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
Re: Error when printing from command line
Hi nbrege,
Thanks for the post - Please give the Editor a try, as the Viewer has been replaced by the Editor and was discontinued:
https://www.pdf-xchange.com/PDFXVE6.zip
Thanks,
Thanks for the post - Please give the Editor a try, as the Viewer has been replaced by the Editor and was discontinued:
https://www.pdf-xchange.com/PDFXVE6.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
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
-
- User
- Posts: 3
- Joined: Tue Apr 22, 2025 1:31 pm
Re: Error when printing from command line
I also encountered the same problem, when I used PDF-Xchange-Viewer to call the network printer to print, the window server ran for about 3 days and then there was an exception, using the task manager or GDIView tool and other observation data is relatively normal, have you solved this problem now, I am grateful
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 7370
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Error when printing from command line
Hi, zhubin
is this using the latest version? 10.5.2.395 as I write this.
is this using the latest version? 10.5.2.395 as I write this.
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 3
- Joined: Tue Apr 22, 2025 1:31 pm
Re: Error when printing from command line
I checked the official PDF XChange Viewer website and found that the last released version is 2.5.322.10, which is much different from the version number you mentioned. What I want to confirm is which version has solved this problem. If it is indeed a software issue, and if it can be resolved using PDF XChange Editor, please let me know the specific version. Thank you very muchPaul - PDF-XChange wrote: ↑Tue Apr 22, 2025 9:00 pm Hi, zhubin
is this using the latest version? 10.5.2.395 as I write this.
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Error when printing from command line
Hello zhubin,
Paul was most likely referring to the PDF-XChange Editor.
The Viewer has been discontinued for over 10 ears now, and has not see any new versions or updates in that time, so we can not really assist with issues with it at this point - as it is now much older than the current versions of Windows, and while it might still work - it was designed and developed at older times when technologies were different.
Can you please try the Editor instead of the Viewer (making sure you test with the current latest build 395) and let us know if you do have the same issue with it?
Kind regards,
Stefan
Paul was most likely referring to the PDF-XChange Editor.
The Viewer has been discontinued for over 10 ears now, and has not see any new versions or updates in that time, so we can not really assist with issues with it at this point - as it is now much older than the current versions of Windows, and while it might still work - it was designed and developed at older times when technologies were different.
Can you please try the Editor instead of the Viewer (making sure you test with the current latest build 395) and let us know if you do have the same issue with it?
Kind regards,
Stefan
-
- User
- Posts: 3
- Joined: Tue Apr 22, 2025 1:31 pm
Re: Error when printing from command line
Stefan - PDF-XChange wrote: ↑Wed Apr 23, 2025 9:11 am Hello zhubin,
Paul was most likely referring to the PDF-XChange Editor.
The Viewer has been discontinued for over 10 ears now, and has not see any new versions or updates in that time, so we can not really assist with issues with it at this point - as it is now much older than the current versions of Windows, and while it might still work - it was designed and developed at older times when technologies were different.
Can you please try the Editor instead of the Viewer (making sure you test with the current latest build 395) and let us know if you do have the same issue with it?
Kind regards,
Stefan
I can use PDF XChange Editor to observe for a period of time. Currently, I am using C # System DiagnosticsProcess starts the process and calls PDFXCview.exe to perform silent printing on the network printer. The printer is Zebra ZT231 (if switched, it will be changed to PDFXEdit.exe). During the process, it was found that the entire process takes about 4 seconds. Is there a better way to achieve silent printing? I think the SDK on the official website needs to be applied for. I don't know if it is helpful and how to apply for it
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11275
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Error when printing from command line
Hello, zhubin
The Drivers SDK would be something used to develop/control aspects of our printer programmatically, not to initiate printing, as it requires something else to send print data to it, which then generates a PDF document. If you need to open existing PDF files, and send them to another printer, than you would likely be looking at one of the Editor SDK's, if the End user product does not fit the needs.
With that said, I am unsure if this proposed use is even allowed under our EULA. To address both the potential of using the software in this way at all, and to check if an SDK would help or be necessary for you, you will want to email Sales@PDF-XChange.com.
In that email, please include a description of the intended process, citing that you are unsure if this is allowed under the EULA, and asking which SDK, if any would be necessary, or if the End user products are allowed to do this.
Kind regards,
The Drivers SDK would be something used to develop/control aspects of our printer programmatically, not to initiate printing, as it requires something else to send print data to it, which then generates a PDF document. If you need to open existing PDF files, and send them to another printer, than you would likely be looking at one of the Editor SDK's, if the End user product does not fit the needs.
With that said, I am unsure if this proposed use is even allowed under our EULA. To address both the potential of using the software in this way at all, and to check if an SDK would help or be necessary for you, you will want to email Sales@PDF-XChange.com.
In that email, please include a description of the intended process, citing that you are unsure if this is allowed under the EULA, and asking which SDK, if any would be necessary, or if the End user products are allowed to do this.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com