Skip to content

foreheadSniffer/Angular-Print-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular-Print-Service

Lightweight angular module that allows you to print element on the page. No jQuery needed.

Demo

How to use

angular.module('app', ['angularPrint'])
.controller('exampleController', ['AngularPrint', function(AngularPrint) {
	AngularPrint(document.getElementById('printable'))
}])

Options

AngularPrint(element, options)

Service accepts options as additional second parameter

Option Value Details
debug true/false keep iframe after printing
importCSS true/false import parent page css
importStyle true/false import style tags
printContainer true/false print outer container/$.selector
loadCSS String of Array of strings load an additional css file
pageTitle String add title to print page
removeInline true/false remove all inline styles
printDelay Number, default: 333 variable print delay, ms
header String prefix to html
formValues true/false preserve input/form values
AngularPrint(document.getElementById('print'), {
      debug: true
      importCSS: true
      importStyle: true,
      loadCSS: "https://fonts.googleapis.com/css?family=PT+Serif",
      pageTitle: "Printing",
      removeInline: true,
      formValues: true
});