Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Programming
 EXP Systems Forum : PDF reDirect : Programming
Topic: service Post Reply Post New Topic
Author Message
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Topic: service
    Posted: 30 Nov 12 at 6:32AM
Hi
I tried to use the component (2.26) to print several pdf's in a service (unattended). While the component does not give any error, there is no pdf printed. Is it not possible to print in unattended mode? (because I already tried several other component, including the one from adobe that give the same negative result)
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 01 Dec 12 at 8:55AM
Hi,

   I would recommend that you go into PDF reDirect Pro >> Preferences >> General >> Debug >> Select (check) the "Generate Log Files". Then, try to create (print) the PDF files unattended. Later, go back into the preferences and take a look at the logs to see if an error code was generated.

   In the logs, the first two letters of each line are from each individual program. You will want to look at the output from "AX" (ie the ActiveX component).

   Please note that v2.5.2 is the latest version, and I do not support the older versions. If it is feasible for you to upgrade, then I would consider it (especially since it is free).

   Cheers!

Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 01 Dec 12 at 7:41PM
looks like the logfile of pdfredirect does not log anything
 
337,573707,"AX",16,"***************************************"
337,573717,"AX",17,"   AN UNEXPECTED ERROR HAS OCCURED in ChangeSettings"
337,573727,"AX",18,"***************************************"
337,573736,"AX",19,"   - DLL Error Number =  5 - Toegang geweigerd. "
337,573746,"AX",20,"End ChangeSettings"
337,581681,"AX",0,""
337,581690,"AX",1,""
337,581700,"AX",2,"------------------------------------------------------------"
337,581710,"AX",3,"START LOGGING: 2-12-2012 2:00:29"
337,866134,"AX",0,""
337,866144,"AX",1,""
337,866153,"AX",2,"------------------------------------------------------------"
337,866163,"AX",3,"START LOGGING: 2-12-2012 2:05:13"
337,866175,"AX",4,"Start EnumForms"
337,866189,"AX",5,"Number of Forms Found: 313"
337,866199,"AX",6,"No. of Forms Found: 0"
337,883340,"AX",0,""
337,883350,"AX",1,""
337,883360,"AX",2,"------------------------------------------------------------"
337,883370,"AX",3,"START LOGGING: 2-12-2012 2:05:30"
337,883388,"AX",4,"Start MyPdfrPrinterExists"
337,883397,"AX",5,"Start EnumeratePrinters"
337,883411,"AX",6,"End EnumeratePrinters"
337,883421,"AX",7,"Completed MyPdfrPrinterExists"
337,982041,"AX",0,""
337,982059,"AX",1,""
337,982069,"AX",2,"------------------------------------------------------------"
337,982078,"AX",3,"START LOGGING: 2-12-2012 2:07:09"
337,982182,"AX",0,""
337,982192,"AX",1,""
337,982202,"AX",2,"------------------------------------------------------------"
337,982212,"AX",3,"START LOGGING: 2-12-2012 2:07:09"
337,982222,"AX",4,"Start GetPrinterInfo2"
337,982232,"AX",5,"Open Printer BatchPrinter..."
337,982245,"AX",6,"...Return = 1"
337,982255,"AX",7,"pNeeded = 1664"
337,982266,"AX",8,"Recover Printer Info"
337,982276,"AX",9,"End GetPrinterInfo2"
337,982286,"AX",10,"Aborted GetPrinterInfo2 = 1"
337,982369,"AX",0,""
337,982379,"AX",1,""
337,982389,"AX",2,"------------------------------------------------------------"
337,982399,"AX",3,"START LOGGING: 2-12-2012 2:07:09"
337,982407,"AX",4,"Start SetPrinterInfo2"
337,982415,"AX",5,"Open Printer BatchPrinter..."
337,982426,"AX",6,"...Return = 1"
337,982433,"AX",7,"Set Printer Info...BatchPrinter"
337,1030854,"AX",0,""
337,1030863,"AX",1,""
337,1030871,"AX",2,"------------------------------------------------------------"
337,1030879,"AX",3,"START LOGGING: 2-12-2012 2:07:58"
337,1030889,"AX",4,"Start EnumForms"
337,1030901,"AX",5,"Number of Forms Found: 313"
337,1030909,"AX",6,"No. of Forms Found: 0"
337,1034974,"AX",0,""
337,1034982,"AX",1,""
337,1034990,"AX",2,"------------------------------------------------------------"
337,1035008,"AX",3,"START LOGGING: 2-12-2012 2:08:02"
337,1035030,"AX",4,"Start ShowPrinterProperties"
337,1035038,"AX",5,"fill the PRINTER_INFO_2 struct"
337,1035061,"AX",6,"MyPrinterDefaults.DesiredAccess = PRINTER_ACCESS_USE"
337,1035069,"AX",7,"OpenPrinterW"
337,1035081,"AX",8,"pNeeded9 = 1092"
337,1035090,"AX",9,"GetPrinter = 1"
337,1035098,"AX",10,"Matching Printer Not Found."
337,1035112,"AX",11,"Doc Prop pNeeded = 1024"
337,1035120,"AX",12,"SetValue = 1"
337,1049989,"AX",13,"AdvancedDocumentProperties = 1"
337,1050013,"AX",14,"***************************************"
337,1050025,"AX",15,"   AN UNEXPECTED ERROR HAS OCCURED in ChangeSettings"
337,1050033,"AX",16,"***************************************"
337,1050044,"AX",17,"   - DLL Error Number =  5 - Toegang geweigerd. "
337,1050053,"AX",18,"End ChangeSettings"
337,1065409,"AX",0,""
337,1065430,"AX",1,""
337,1065438,"AX",2,"------------------------------------------------------------"
337,1065446,"AX",3,"START LOGGING: 2-12-2012 2:08:32"
337,1070010,"AX",0,""
337,1070018,"AX",1,""
337,1070026,"AX",2,"------------------------------------------------------------"
337,1070034,"AX",3,"START LOGGING: 2-12-2012 2:08:37"
337,477676,"AX",0,""
337,477684,"AX",1,""
337,477693,"AX",2,"------------------------------------------------------------"
337,477701,"AX",3,"START LOGGING: 2-12-2012 2:19:06"
337,142648,"AX",0,""
337,142677,"AX",1,""
337,142749,"AX",2,"------------------------------------------------------------"
337,142781,"AX",3,"START LOGGING: 2-12-2012 2:28:29"
337,620415,"AX",0,""
337,620453,"AX",1,""
337,620499,"AX",2,"------------------------------------------------------------"
337,620515,"AX",3,"START LOGGING: 2-12-2012 2:36:26"
 
where the START LOGGING is it should log something
 
in my own logfile it seems it cannot create the object
 
 
  AddLog ("Voor creeren van pdfO")
                        Set pdfO = New PDF_reDirect_v25002.Batch_RC_AXD
                   
                        AddLog ("Na creeren van pdfO")
                        If pdfO.LastErrorNumber <> 0 Then
                       
                            AddLog "PrintUtil kon niet gecreëerd worden! " & Format(Date, "dd-mm-yyyy nn:nn") & pdfO.LastErrorDescription & "  Error Number =" & Str$(pdfO.LastErrorNumber) & " DLL Error Number =" & Str$(pdfO.ErrorLastDLL)
                        End If
                        If Err.Number <> 0 Then
                           AddLog "Error na Utility_Open_PDF leeg " & Err.Description & "  " & Err.Number
                            Err.Clear
                        End If
it logs: "Voor creeren van pdfO" (before creating the object), but never ("Na creeren van pdfO" (after creating). So it must crash in the meantime??
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 02 Dec 12 at 11:07PM
Hi,

   Did you also install PDF reDirect v2.5.2, or just the ActiveX component? They both have to be installed to work properly, and PDF reDirect must be in "Professional" mode, and must be registered, or at least, the free trial not expired.

   Please take another look. If you are still having difficulty, send me the entire log by e-mail to exp -at- exp-systems -dot- com.

   Thanks,


  
Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 03 Dec 12 at 6:09AM
Michel,
I installed all PDF reDirect v2.5.2. And of course registered the dll (otherwise i could not create the object in my code). Pdf redirect was in professional mode (at least I think so). The trial hasnt expired yet! I will send you the complete log file, but there isn't any more (interesting) text than this...
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 03 Dec 12 at 6:33PM
Hi,

   I haven't looked at the log yet, but in the mean time, have you tried running the sample code, for example, either the Excel or the Word ones?

   That will give us an immediate feedback on whether the problem is with the component, or the calling code.

   Also, does PDF reDirect Pro work OK?

   Cheers!

Michel

Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 05 Dec 12 at 7:13PM
The sample code works perfectly Michel. The component in my own dll also works perfectly, but NOT when it runs as a service. As far as I can tell the dll (my own) has all the needed permissions and the (NT-)service runs under my own administrator NT account.
As it runs as a service my dll cannot create the object (it logs until your component has to be created and has to do its job). So what could be the cause that the object cannot be created when it runs as a service while it CAN create the object while not running as a service (but directly under my account).
 
By the way: the part of your log-file that causes a 'permission denied' is NOT the log when running my service. It's when I changed some settings in the GUI, but your told me that wasn't necessary at all. It does not log anything when running the services. I is because the object is never created, so it cannot log I suppose... :-(
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 05 Dec 12 at 11:06PM
Hi,

   It might be because the system account that you are using does not have permission to run ActiveX component. What you could try is to run your service in the security context of a specific user account that is different from the logged-on user or the default computer account. Alternatively, check to see if the user or system account used has the permission to run ActiveX components.

Finally, you may want to make sure that PDF reDirect Pro is registered for the system user (if that is the account that your service is using).

   Please keep in mind that I have never programmed a service, so I am not too familiar of the associated nuances, so my response is a bit of a shot in the dark.

   Cheers!


Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 06 Dec 12 at 7:00PM
Michel,
I told you that the service runs under my own account, so that is not the problem ;-). That means the same account I use to test the dll (and where it works).
So it MUST be something in the context of your dll that cannot be done in a service? Starting up a form? Or do you use AcroReader?
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 08 Dec 12 at 12:33PM
Sorry for the slow response. I am programming my own Windows Service using VS2010 to see if I can duplicate your results. More later...

Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 08 Dec 12 at 3:55PM
thanks,
would like to hear the results....
 
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 10 Dec 12 at 11:41PM
Hi,

   Is your server running as a 32 or 64 bit OS? (our ActiveX component is only 32 bit)

   Thanks!

Michel
Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 13 Dec 12 at 4:24AM
Hi michel,
sorry did not get this post.
The problem is on 64  bit system,
IP IP Logged
hjmcorver
Newbie
Newbie
Avatar

Joined: 29 Nov 12
Location: Netherlands
Posts: 8
Quote hjmcorver Replybullet Posted: 13 Dec 12 at 7:00PM
any result yet?
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 13 Dec 12 at 11:30PM
Hi,

  It definitely will not work in 64 bit mode. Your best bet would be to create a 64 bit service that, in turn, calls a 32 bit executable which calls the ActiveX component (which is also a 32 bit component).

   Sorry for the workaround. I have reprogrammed the Printer Port Monitor as a 64 bit component, but I have not done it for the component yet.

   Cheers!

Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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