1.0.1 • Published 5 years ago
@fpcc/fv-flash-cards-pdf v1.0.1
Utility to create flash card pdf for printing or saving
This uses PDF Make under the hood
Example
import FVFlashCards from 'fv-flash-cards-pdf';
const Cards = {
title: 'ᒪᐢᑿᒋᐢ ᓀᐦᐃᔭᐍᐏᐣ / Maskwacis Cree',
cards: [
{
top: 'I love my brothers and sisters.',
bottom: 'ᓂᓵᑭᐦᐊᐘᐠ ᓃᑏᓴᓈᐠ / (ni)[sa](kiha)(wak) [niti](sa)[nak]'
}
]
}
const flashCardsPdf = FVFlashCards.CreateFlashCards(Cards);
Download the PDF
flashCardsPdf.download();
Open PDF
flashCardsPdf.open();
Open in same window
flashCardsPdf.open({}, window);
Get Base64 Encoded
flashCardsPdf.getBase64((data) => {
alert(data);
});
Creating Multiple Cards
import FVFlashCards from 'fv-flash-cards-pdf';
const Cards = {
title: 'ᒪᐢᑿᒋᐢ ᓀᐦᐃᔭᐍᐏᐣ / Maskwacis Cree',
cards: [
{
middle: 'I love my brothers and sisters.',
},
{
bottom: 'ᓂᓵᑭᐦᐊᐘᐠ ᓃᑏᓴᓈᐠ / (ni)[sa](kiha)(wak) [niti](sa)[nak]'
}
]
}
const flashCardsPdf = FVFlashCards.CreateFlashCards(Cards);
1.0.1
5 years ago