You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@bcyesil/capacitor-plugin-printer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bcyesil/capacitor-plugin-printer

Capacitor plugin for printing HTML format value iOS/Android apps.


Version published
Maintainers
1
Created

Readme

Source

capacitor-plugin-printer

Capacitor plugin for printing HTML format value iOS/Android apps.

Capacitor VersionPlugin Version
v5.xv0.0.3
v6.xv0.0.4
Printer.print({ content: '<b>Lorem ipsum...</b>'})

screenshoots

Supported Platforms

  • Android 5.1+
  • iOS 13+

Supported Contents

  • HTML (can use CSS inline styling)
  • Text
  • Image(as HTML)

Install

Important:

Make sure you are using the correct version

Capacitor VersionPlugin Version
v5.xv0.0.3
v6.xv0.0.4
npm install @bcyesil/capacitor-plugin-printer
npx cap sync

Usage

import { Printer } from '@bcyesil/capacitor-plugin-printer';

.
.
.

Printer.print({ content: 'Lorem ipsum...', name: 'lorem-filename', orientation: 'landscape' })

Examples

Text:

 Printer.print({ content: 'Lorem ipsum...'})

HTML:

 Printer.print({ content: '<h1>Lorem</h1>'})

Suggestion for multiple lines:

    let contentTest: string = "";

    contentTest += '<li style="color:green">Tea</li>'
    contentTest += '<li style="font-size:50px">Coffee</li>'
    contentTest += '<img src="https://picsum.photos/200">'

    Printer.print({ content: contentTest })

Images with HTML:

 Printer.print({ content: '<img src="base64/url/path">'})

with inline CSS:

 Printer.print({ content: '<b style="color:red">Lorem ipsum</b>'})

API

  • print(...)
  • Interfaces

print(...)

print(printOptions: PrintOptions) => Promise<void>
ParamType
printOptionsPrintOptions

Interfaces

PrintOptions
PropTypeDescriptionDefaultSince
contentstringHTML content for print.0.0.1
namestringName of the print of the document.iOS=YourAppName/Android=Document+CurrentTimestamp0.0.1
orientationstringOrientation of the printing page. "portrait" or "landscape""portrait"0.0.1

Keywords

FAQs

Package last updated on 08 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc