How to set the required paper size as default paper size in window.print() using jQuery Or AngularJS [Resolved]

Posted by Kasani007 under AngularJS on 10/13/2016 | Points: 10 | Views : 88 | Status : [Member] | Replies : 1
How to set the required paper size as default paper size in window.print() using jQuery Or AngularJS Or HTML


Posted by: Rajnilari2015 on: 10/13/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50


This can be done using CSS3 ( )

Try this (AngularJS)


<!DOCTYPE html>
<html >

<style type="text/css">
/* style sheet for "A4" printing */
@media print and (width: 21cm) and (height: 29.7cm) {
@page {
margin: 3cm;

/* style sheet for "letter" printing */
@media print and (width: 8.5in) and (height: 11in) {
@page {
margin: 1in;

/* A4 Landscape*/
@page {
size: A4 landscape;
margin: 10%;

<script src=""></script>
<script src="print.js"></script>

<body ng-app="printModule" ng-controller="printCtrl">

<div ng-init='printMe()'>

Microsoft Azure is a cloud computing platform and infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed data centers.

It provides both PaaS and IaaS services and supports many different programming languages, tools and frameworks, including both Microsoft-specific and third-party software and systems.

Azure was announced in October 2008 and released on 1 February 2010 as Windows Azure, before being renamed to Microsoft Azure on 25 March 2014.


Virtual machines, infrastructure as a service (IaaS) allowing users to launch general-purpose Microsoft Windows and Linux virtual machines, as well as preconfigured machine images for popular software packages.

App services, platform as a service (PaaS) environment letting developers easily publish and manage Web sites.

Websites, high density hosting of websites allows developers to build sites using ASP.NET, PHP, Node.js, or Python and can be deployed using FTP, Git, Mercurial or Team Foundation Server. This feature was announced in preview form in June 2012 at the Meet Microsoft Azure event.

Customers can create websites in PHP, ASP.NET, Node.js, or Python, or select from several open source applications from a gallery to deploy. This comprises one aspect of the platform as a service (PaaS) offerings for the Microsoft Azure Platform. It was renamed to Web Apps in April 2015.

WebJobs, applications that can be deployed to a Web App to implement background processing. That can be invoked on a schedule, on demand or can run continuously. The Blob, Table and Queue services can be used to communicate between Web Apps and Web Jobs and to provide state.


.module('printModule', [])
.controller('printCtrl', function ($scope) {

$scope.printMe = function(){
window.print(); }

Thanks & Regards,
RNA Team

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response