huysentruitw / print-it

Windows service for printing PDF files to a local or network printer in the background
MIT License
84 stars 43 forks source link

While running as a console application printing works fine but while running as a windows service the PrintDocument.Print() method not working #13

Closed Vasanthvivi closed 2 years ago

Vasanthvivi commented 3 years ago

while running as console application it works fine but while running as windows service it is not working .... the PrintDocument.Print() method not working under windows service ,,, ran the windows service as LocalSystem ..... Here is my config Windows 8.1

huysentruitw commented 3 years ago

Does it work when you run the service under your user account f.e.? Did you install the printer using print-it API?

Vasanthvivi commented 3 years ago

Does it work when you run the service under your user account f.e.? Did you install the printer using print-it API?

Actually print it works fine, nowadays windows services running under kernel session, so it dont have a UI so when i try to print using MicrosoftPDF printer it wont work until we specify the appropriate extension and name of the document being printed , but it could able to print to connected printers, if we put settings of a page using algorithms ,

huysentruitw commented 2 years ago

Can you elaborate why you would print a PDF to a PDF file? The use-case for print-it is to print to real network printers.

Vasanthvivi commented 2 years ago

i just wanna make up my pdf such as using colors drawings,,, for testing purposes i have to use sample Microsoft PDF Printer, it pops up and asks to save in desired location,,, but services dont show UI

huysentruitw commented 2 years ago

If it's for testing, you could run the executable as console by passing --console as command-line argument. Make sure to stop the windows service first, otherwise the port will already be in use.

Vasanthvivi commented 2 years ago

yeah, in the port there is no problem,, in old windows we could show UI from the windows services, but now in latest version of windows kernel not allows to do that via services