Blazor Server Application window.print page orientation problem

Cenk 1,036 Reputation points
2022-09-01T09:38:37.75+00:00

Hello,

I am working on a Blazor Server Application, depending on a business rule I need to print one dialog/modal landscape orientation. When I click on print in the Firefox page, the page layout option appears on the print preview page.

236874-ff-stackoverflow.png

But interestingly when I try to print Blazor dialog/modal page, the layout option does not appear.

236895-ff-blazor-server-app.png

Here is CSS:

@media print {  
    body * {  
        visibility: hidden;  
    }  
    #printarea, #printarea * {  
        visibility: visible;  
    }  
    #printarea {  
        position: absolute;  
        left: 0;  
        top: 0;          
    }  

}  

Any ideas on how to fix this problem?

Thank you.

Developer technologies .NET Blazor
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.