When clicking the print button there is no printing action

Stimulsoft Reports.AVALONIA discussion
Post Reply
JardelRogerioLemos
Posts: 4
Joined: Sat Aug 02, 2025 12:23 am

When clicking the print button there is no printing action

Post by JardelRogerioLemos »

Using the demo project, I found that the print option is not running.
Max Shamanov
Posts: 999
Joined: Tue Sep 07, 2021 10:11 am

Re: When clicking the print button there is no printing action

Post by Max Shamanov »

Hello,

Please read the following article about printing in Avalonia:
https://www.stimulsoft.com/en/blog/arti ... s-avalonia

Thank you.
JardelRogerioLemos
Posts: 4
Joined: Sat Aug 02, 2025 12:23 am

Re: When clicking the print button there is no printing action

Post by JardelRogerioLemos »

Important!

Keep in mind a particular characteristic of Windows OS: after printing, the document itself is closed in the application, but the application may remain open. This behavior can’t be influenced from our side.

I need to print directly (Windows) to a local or network printer where I have the printer name, and this must be done silently. Could you help me?
Max Shamanov
Posts: 999
Joined: Tue Sep 07, 2021 10:11 am

Re: When clicking the print button there is no printing action

Post by Max Shamanov »

Hello,

Unfortunately, as we mentioned earlier in the article, Avalonia does not have a direct print of the report.
As an option, you can export the report to PDF and then print the exported file from the command line.

Thank you.
JardelRogerioLemos
Posts: 4
Joined: Sat Aug 02, 2025 12:23 am

Re: When clicking the print button there is no printing action

Post by JardelRogerioLemos »

Could you help me with printing via the command line where I don't use the application?
Max Shamanov
Posts: 999
Joined: Tue Sep 07, 2021 10:11 am

Re: When clicking the print button there is no printing action

Post by Max Shamanov »

Hello,

You can try to use one of these methods:

1. Using Command Line with SumatraPDF (free, portable)
One of the simplest and most reliable methods.
Download SumatraPDF (a portable version is available).
Print command:

cmd

Code: Select all

SumatraPDF.exe -print-to "PrinterName" "path\to\file.pdf"
Example:
cmd

Code: Select all

SumatraPDF.exe -print-to "HP LaserJet P1005" "C:\docs\example.pdf"
You can also use -print-to-default to send it to the default printer.

2. Using PowerShell
If Adobe Reader (or a similar program) is installed, you can invoke it via PowerShell:

powershell

Code: Select all

Start-Process -FilePath "C:\docs\example.pdf" -Verb PrintTo -ArgumentList '"PrinterName"'
Note: This only works if the PDF reader supports the PrintTo verb. Adobe Reader usually does.

3. Using the Print utility with a virtual PDF printer
If you want to send a PDF to a virtual printer (like Microsoft Print to PDF), you can try:

cmd

Code: Select all

print /D:"\\PrinterName" "C:\docs\example.pdf"
However, print only works with plain text files — not PDF. So this method is generally not recommended for PDFs.

Thank you.
JardelRogerioLemos
Posts: 4
Joined: Sat Aug 02, 2025 12:23 am

Re: When clicking the print button there is no printing action

Post by JardelRogerioLemos »

Thanks!
Max Shamanov
Posts: 999
Joined: Tue Sep 07, 2021 10:11 am

Re: When clicking the print button there is no printing action

Post by Max Shamanov »

Hello.

We are always glad to help you.
Let us know if you need our help.

Thank you.
Post Reply