Jump to content

Default printer - Help


Recommended Posts

Friends, I am breaking the cebça and can not understand what happens.

In unigui application, the printer returned as standard has nothing to do as it is.

For I added unigui application screens and vcl. The code to get the default printer is the same in both applications. And I'm doing the test on the server itself.




     if Printer.Printers.Count > 0 then

         Result := Printer.Printers[Printer.PrinterIndex];



     if Printer.Printers.Count > 0 then




What can it be?

The application is being executed on the machine where it installed the web server, and will be performed only at this station.



Link to comment
Share on other sites

Farshad, I have done the following: In this printer as the default, I granted access to IUSR (full). In the application folder, this too full. Debugging the plication, print normally, but when the ISAPI aplciação, does not print.

I'm not printing the client, I am directly on the machine where the server is installed, the printer is installed on it. The ISAPI application will only be used in this season, so it should not have any problem to use machine resources.


Always falls on the exception





           Report.AllowPrintToFile := false;

           Report.AllowPrintToArchive := false;

           Report.DeviceType := 'Printer';



        on e:exception do


             AddToLog('PrintReport: Erro ao imprimir: '+e.Message);


             Report.AllowPrintToFile := True;

             Report.DefaultFileDeviceType := 'PDF';

             Report.DeviceType := 'PDF';

             Report.TextFileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl);





Link to comment
Share on other sites

People I no longer know what to do. Makes 2 days I'm trying a solution to this problem. The application in standalone mode, prints normally. However ISAPI does not print anything.

Already granted permission where it could no longer know what to do.

For God's sake, it's just a simple application that should print a report on the machine which is installed IIS using the default printer that is there. Nothing else.

The IUSR user already has access to a printer, you have access the folder, the more it must have access to be able to print?


Gente eu já não sei mais o que fazer. Faz 2 dias que estou tentando uma solução para esse problema. A aplicação em modo standalone, imprime normalmente. Contudo em ISAPI não imprime nada.

Já concedi permissão onde poderia, já não sei mais o que fazer. 

Pelo amor de Deus, é apenas uma simples aplicação que deveria imprimir um relatório, na máquina onde esta instalado o IIS, utilizando a impressora padrão que encontra-se ali. Nada mais.

O usuário IUSR já tem acesso a impressora, tem acesso a pasta, a que mais ele deve ter acesso para poder imprimir?

Link to comment
Share on other sites

Is something wrong people!

I created an application to run the ISAPI.

I tested the performance in various ways, and simply ISAPI does not run.

It is not a question of security because all aobsolutamente all users are with permission on the folder where the application is being executed, and in IIS. I ask?


I can not run an application?

I can not print?


Please could someone give me a help towards.

What should I set this server?

The setting is within the standard of unigui documentation. What is missing then?


I am about to leave the ungui and move on to another solution.

simple things and is giving a huge headache, and there is no documentation, etc. I can guide.


And please, I am not wanting to print anything on the Web, just want to print a pdf document on a printer that is installed on the server. Nothing else


I thought it was something about the impression.

I created an application to run the report print, and no run.

Simple: the isapi application does not run.




    procedure PrintPDF;


        Report.AllowPrintToFile := True;

        Report.DefaultFileDeviceType := 'PDF';

        Report.DeviceType := 'PDF';

        Report.TextFileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl);



        if FileExists(Report.TextFileName) then


             AUrl :=  PathSistema+'wprint.exe "'+PrinterName+'|'+Report.TextFileName+'|'+IntToStr(Report.PrinterSetup.Copies)+'"';







Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...