Cowcerts certificate viewer
This web component renders a digital certificate as specified per the Cowcerts standards for Education standard.
It uses the Andorran format as the view.
Usage
Simply include the cow-cert
element in your HTML
and use the certificate
attribute to specify the certificate to render.
<cow-cert certificate="{{myCertificate}}"></cow-cert>
You have to include the web components library and the JavaScript module that defines the custom element.
Also you will have to include some scripts to display the print button Look at the demo folder for more complete examples
Options
You can specify several options, not just the mandatory certificate
one.
Hide print button
You can hide the print button setting the noprint
attribute to true
<cow-cert noprint certificate="{{myCertificate}}"></cow-cert>
Autoprint
Using the autoprint
attribute, the print dialog will automatically appear
<cow-cert autoprint certificate="{{myCertificate}}"></cow-cert>
Development
Serving the certificate
To serve the certificate, use the start
npm script:
npm run start
A local server will be available on http://localhost:8081 with the web component rendered with a sample certificate
Automatically refreshing browser on changes
If you are serving the certificate via the npm run start
command, you can
also reload automatically the browser if any of the WebComponent sources or demo
files change.
npm run watch
Build
With rollup.js you can bundle everything in a module, just use the
build
npm script:
npm run build
The file demo/bundled.html contains a demo for the rendered version (the one compiled by rollup.js)
<> with