Active Topics Memberlist Search Help | |
Register Login |
Programming | |
EXP Systems Forum : PDF reDirect : Programming |
Topic: PDF File not created on WS2003 | |
Author | Message |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Topic: PDF File not created on WS2003 Posted: 21 Sep 07 at 9:03AM |
Hi,
I am using ActiveX and batch printer. Printing is activated from an Excel workbook which is activated from ASP.NET. When I print manually from Excel to the Batch PDF printer it works. When I print through ASP.NET the files are being sent to the printer (There is a standard WServer 2003 option to keep the documents after they have been printed, so I can see them sitting in the queue afterwards). But the files are not to be found on the specified location, nor anywhere else. I can also see in the Batchpdf.ini file that file and pathnames are set correctly. (I do this from VB)
A reason may be that ASP.NET runs under a system account. But if there is some file permission issue I would expect some error message somewhere. I turned on logging at the main window of PDF reDirect but to no avail. I also thought of copying all settings from the administrator location (\documents and settings .. administrator .. application data\ to the same location of 'default user', as the ASP.NET system account is not looking in the administrator account. Log files are not created for Batch PDF in either location. (They are for 'normal' PDF reDirect use).
Pleas advise me how to diagnose further ?
Some details:
Windows Server 2003 Excel 2003
PDF Redirect Pro 2.2.5
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 22 Sep 07 at 12:23PM |
Hi,
I am sorry to hear of the problem. Indeed trying to print from a "system" user account can be problematic, starting with the fact that this account does not have a desktop, so it is impossible to display any user feedback. My port monitor code is the first code that I run, and it runs under the System account which is where the print spooler code is located. Let me explain: 1. User prints something (USER) 2. Print Spooler manages the request (SYSTEM) 3. Print Spooler starts my Port Monitor Code (SYSTEM) 4. My Port Monitor determines the calling User request (SYSTEM) 5. My Port Monitor creates the output PS file (SYSTEM) 6. My Port Monitor starts the program "Capture.exe" as a User Task 7. My PDF Engine (Capture.exe) runs and creates the PDF (USER) So, as you can see, the way you are running it, my code probably trips at step #4 since there was no calling user. I will have to go look at my code to see how it fails (gracefully or if it gives up). I'll have to go take a look, but I am gone on a business trip, and not returning for the next 4 days (on Tuesday). The error logging in PDF reDirect starts at step #7 above. For further diagnosing, I will need to send you a customized version of the Port Monitor with the error logging turned on. Send me an e-mail to exp (at) exp-systems (dot) com and we'll then have a much better idea of what is going on. Cheers! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 23 Sep 07 at 8:21AM |
Hi Michel,
Thanks for responding on a saturday. Great support!
I will be waiting for your disgnostic version of port monitor. In the mean time, I could check something: where does the port monitor store the ps file ? I've had a couple of security issues regarding file access with this application, this could be just one more.
Kind regards
Marcel Payens
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 24 Sep 07 at 12:54AM |
Yes. The temporary postscript printer output file is written to the following folder on Windows 2000/XP:
C:/Documents and Settings/USERNAME/Application Data/PDF reDirect/Temp I hope that helps. |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 24 Sep 07 at 3:26AM |
Possibly that is where the problem is; There is no username, so for the system account the 'Default user' is used (it is also the location where the ini files are being read). If you create this name based on the actual username, it will fail for the system account. I will check tomorrow.
Rumoldus
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 26 Sep 07 at 1:06AM |
You can try copying the batch printer settings file from the original user's account to the Default User account as well: it may fix the System access problem too. The batch printer settings file is located here:
C:\Documents and Settings\USERNAME\Application Data\PDF reDirect\Batch_Printers Cheers! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 26 Sep 07 at 5:19AM |
I did that already last week (copying the settings) and so that was not a solution.
I changed the setup so that ASP.NET now runs in a separate application pool under a user account, with sufficient rights, but it still doesn't work from ASP.NET (it works manually under this account).
I also registered PDF Redirect under this account. What happens now is that no PDF is generated, but the PDF Redirect display pops up with the correct name set, but nothing in the merge list. When I press 'Save' I get an error message that there is nothing to save. I checked that under this user PDF Redirect settings exist (under C:\Docs & set...\application data\). But it surprises me that this window pops up at all, I am printing to the BatchPDF printer and the user is not going to want to walk to the server.
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 26 Sep 07 at 11:20PM |
... especially if the server is behind a lock door, or in a different country. I access my server remotely, and I hate it when I have to plug in a monitor to do low-level work. .
Anyway, I do have a WS2003 machine, and ASP.NET (though I rarely use ASP.NET), so I will do some testing tonight, and will get back to you, hopefully in a couple of hours. Cheers! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 27 Sep 07 at 12:40AM |
Hi!
I have done some investigation on "System" processes, and did some testing. I have found that the "Application Data" folder for the System is located here: C:\WINDOWS\system32\config\systemprofile\Application Data Therefore, please copy the Batch printer settings file to the following folder and let me know if that fixes the problem for you: C:\WINDOWS\system32\config\systemprofile\Application Data\PDF reDirect\Batch_Printers Hopefully that will fix everything for you when using the System process (unless there is something specific about ASP.NET, but I still need to investigate that). Cheers! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 30 Sep 07 at 6:00PM |
Hi Michel,
Thanks again for your support.
Tomorrow I will be at my client's location, and I will be able to test.
As I explained the 26th I am running now under a specially created user account and I would prefer to keep it that way (I can tune security better under this account). But is the fact that I get a pop-up explained with your last finding (I mean is it likely that copying the batch printer settings to this obscure location is also going to work for this user account ?)
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 30 Sep 07 at 11:19PM |
Hi,
If the user account exists in the normal "Documents and Settings" folder, that is where I would place the Batch Printer file (assuming the Batch Printer already exists of course). I would recommend you use the obscure location only if you are running the program from the "System" account. Good luck tomorrow! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 01 Oct 07 at 8:55AM |
Actually the batch printer file already existed for that user, with known result (No PDF). I re-tried this, after changing 'Default location' under the 'General' tab from 'Desktop' to an existing file location, No PDF. I noticed however that the Pop-up of PDF-Redirect no longer appears. I confirmed that under direct login with this account, printing from Excel to BATCHPDF, the PDF is generated. I
I also tried the systems account, after copying the PDF-settings folder to above mentioned location (C:\Windows\System32\etc. etc. It was noteworthy that a PDF Redirect folder existed, but not the BatchPDF subfolder. No luck, though. This resulted in an exception (ASP.NET level) that a printer with such a name did not exist. I couldn't find anything wrong there. The printer exists and is accessible to everybody.
In the case of the 'Normal' user account, no error occurs and also an entry in the Event log is made to indicate that a document is printed to BatchPDF. No errors to be found anywhere, just no PDF. If I leave all printed documents in the print Queue (a Windows printer option), I see all jobs with correct names, with status 'Printed'.
Where to go from now ? My client is getting slightly impatient.
As stated before, I would prefer to stay with the option of the normal user account, not the system account.
Regards
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 02 Oct 07 at 12:06AM |
Hi,
It sounds like you have checked everything that I would have recommended. I am surprised by all the trouble that you are getting. This is what I would do: from the user's normal account, I would delete the Batch printer, and re-install it using PDF reDirect Pro's Preferences >> Batch printer . Only try this if his account allows him to install printers though. Anyway, if you install the batch printer using his account, does the program work now? Other things to consider: is the uers's account mapped to a network drive? Some IT departments do that to ensure that the user's documents are on a network drive that is backed up regularly. If so, his "App data" folder may also be on a network drive, and not on the "C" drive. Really surprised by the ASP.NET throwing an exception, and that the printer is not available. Other things to check: 1. Please make sure that the Batch printer is not setup as a shared printer as that will cause the printer to not work properly. 2. Does the PDF reDirect printer work normally on the user's account? (if not, then we know that the problem is not specific to the batch printer). Best regards, |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 02 Oct 07 at 9:48AM |
No luck.
This is not surprising as I tested before using this account, printing from excel myself and then it works. It only doesn't work when printing from excel is activated from ASP.NET. (And that by itself DOES work on my development laptop, using PDF-redirect as well, and also I've seen that on this server it does send the document to the spooler).
The exception that I reported before was not created by PDF-redirect, sorry for the confusion.
Last week you suggested providing a test version of the port monitor, that would provide detailed error information (possibly to the Event logger ?). I see that as a last resort, is it feasible ? I need to get this working shortly and I don't want to turn to another solution.
Best regards
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 02 Oct 07 at 2:12PM |
Hi,
I will send you the customized port monitor which should give us the info we need. I should have thought about that yesterday: my mistake. Hoepfully we will make sense of what is going on. Thanks for your patience! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
rumoldus
Newbie Joined: 21 Sep 07 Posts: 15 |
Posted: 02 Oct 07 at 2:54PM |
Hi,
While testing on my laptop I found something unexpected.
In the function Batch_Printer_Load_Settings( printername as string) the printername is case sensitive. It will not be the current problem at the server (I know that there the name is all caps) but it may be confusing to other users.
Kind regards
|
|
IP Logged | |
Michel_K17
Moderator Group Forum Administrator Joined: 25 Jan 03 Posts: 1673 |
Posted: 02 Oct 07 at 10:30PM |
Hi Rumoldus,
Good catch! I will update the code in the next release and make it case insensitive. By the way, the port monitor with the error logging is on it's way: the e-mail and instructions are ready... Thanks! |
|
Michel Korwin-Szymanowski
EXP Systems LLC |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |