cancel
Showing results for 
Search instead for 
Did you mean: 

Custom action to get the list of printers configured on server.

Former Member
0 Kudos

Hi,

I created one custom action block.

Its purpose is to get list of printers configured on the server and then print the pdf

document through one of the printers.

The java code gives the list of printers when executed on eclipse.

However when the code is developed on the server, itu2019s not able to give the list of printers.

Below is the code snip, which does the lookup service.

PrintService aprintservice[] = PrintServiceLookup.lookupPrintServices(null, null);

for (int i = 0; i < aprintservice.length; i++)

{

ilog.info(aprintservice<i>.getName());

}

The above code doesnu2019t print any printers configured on the server.

Any suggestion / help will be highly appreciated.

Thanks,

Vishal Jadhav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Vishal, you need to realize that when running Eclipse, you're logged in to the operating system as a user, whereas when running within the MII server, you're likely logged in as the System Account or Network Account, and therefore probably do not have any printer(s) configured or associated with that account, or permission to access them.

Former Member
0 Kudos

I am using 11.5 . I logged in the system with user <XY>.

I configured some printers for user <XY>.

I also created a user <XY> with password same as system password in MII.

But when i accessed the action block through BLS i am getting

Not authorized to execute the transaction error.

One more thing i have xmii on the same system from where i am accessing it.

Thanks for quick response.

Former Member
0 Kudos

aprintservice<i>.getName() maybe? I know it worked in eclipse so maybe just a typo in the post.

As Rick pointed out, you have to configure the printers for the user the xMII service is running under. I think its most likely LocalSystem on windows.

The user you log onto xMII with makes no difference.

Former Member
0 Kudos

As I stated before, the custom action runs in the context of the server and it's credentials, not the client!!!

Former Member
0 Kudos

Hi,

I got your point that the custom action runs under the privilege of the user who has

installed the MII server.

So any mii user should get the list of printers configured on the system.

I installed xMII 11.5 server with my user id.

Also I configured some printers on same system.

But when I am trying to access that action using a trax , its not able to give me any printers configured.

Thanks for your quick help.

Former Member
0 Kudos

Not the necessarily user that installed xMII, the user the servlet exec runs under. Go to Services, find the ServletExec-xMII entry. Right click and select properties. Select the Log On tab. This tab will tell you the identity xMII 11.5 runs under.

Regards,

Christian

Former Member
0 Kudos

Hi,

we have developed a custom printing action for a customer. This action gets the printer name as parameter. Basically we did this with JDK 1.5 because of the better printer support. We therefore execute the code in JDK 1.5 tough invoked in 1.4. With this we can print any generated PDF to any network printer. Make shure the service runs with the appropriate user rights to see the printers.

Regards,

Matthias

Former Member
0 Kudos

No, NOT the user that installed MII. As I mentioned before, it runs as the Local System account.

That is very different than a user account!

0 Kudos

I will have to develop the same kind of custom block. For planification reasons could you tell me how long must be considered for development and industrialization of such an action block?

Thanks,

Aymeric