Skip to content

My Component Print PDF support color,flexbox and grid system because using window.print() and css print.

Notifications You must be signed in to change notification settings

binsarjr/svelte-printpdf

Repository files navigation

Svelte PrintPDF

Minimalistic Print PDF wrapped into svelte component, using window.print() and css print to support flexbox and grid layout.

Contributing

We open to any contribution you could to support this project, you could help us on page numbering feature or you could propose new features to include.

Features

= Full support on Flexbox, Grid Layout (Browser Support)

  • Could translate various CSS
  • Print specific element.only, read more on PrintPdf.svelte

Installation

// Yarn Installation
yarn install --dev svelte-printpdf

// or if you prefer NPM Installation
npm install --save-dev svelte-printpdf

Usage Sample

See demo

<script>
  import {PrintPdf, Page} from "svelte-printpdf"

  let print = false
</script>
<button on:click={() => { print = true }}>PRINT</button>
<PrintPdf bind:print={ print }>
  <Page>
      <h1 class="heading">Page One</h1>
  </Page>
  <Page>
      <h1 style="color: text-red">Page Two</h1>
  </Page>
</PrintPdf>

<style>
  .heading {
      color: text-blue;
  }
</style>

About

My Component Print PDF support color,flexbox and grid system because using window.print() and css print.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published