New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

print-html-block

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-html-block

Print Html Block

2.0.0
latest
Source
npm
Version published
Weekly downloads
19
-5%
Maintainers
1
Weekly downloads
 
Created
Source

Print Html Block

Usage

  • Install plugin
npm install print-html-block
  • Create html tags
<section id="section1">Print Me!</section>
<section id="section2">Don't print me.</section>
<button onclick="print()">Print</button>
  • Import plugin in your .js file
import printHtmlBlock from 'print-html-block';

function print() {
  const selector = '#section1';
  const options = {
    importStyle: true
  };

  printHtmlBlock(selector, options);
};
  • Finish. Click by "Print" button

Default options

NameDefailtDescription
debugfalseshow the iframe for debugging
importCSStrueimport parent page css
importStylefalseimport style tags
printContainertrueprint outer container/$.selector
loadCSS''path to additional css file - use an array [] for multiple
pageTitle''add title to print page
removeInlinefalseremove inline styles from print elements
removeInlineSelector'*'custom selectors to filter inline styles. removeInline must be true
printDelay333variable print delay
headernullprefix to html
footernullpostfix to html
basefalsepreserve the BASE tag or accept a string for the URL
formValuestruepreserve input/form values
canvasfalsecopy canvas content
doctypeString''enter a different doctype for older markup
removeScriptsfalseremove script tags from print content
copyTagClassesfalsecopy classes from the html & body tag
beforePrintEventnullcallback function for printEvent in iframe
beforePrintnullfunction called before iframe is filled
afterPrintnullfunction called before iframe is removed

Keywords

web

FAQs

Package last updated on 25 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts