Hi all,
I want export pdf on my hybrid’s app (android/web app)
The export pdf on web app is ok, but not on android capacitor app.
I read the doc, but many examples are with pdfmake, not html2pdf.js.
Here my function for create a pdf in my component Vue.js :
egs2pdf () {
this.$store.dispatch('setLoading', true, { root: true })
let egs2PdfComponent = document.getElementById('egs2PdfComponent')
this.opt.filename = this.patient.patientId
if (!Capacitor.isNativePlatform()) {
html2pdf().set(this.opt).from(egs2PdfComponent).output(`${this.patient.patientId +'.pdf'}`, 'D')
} else {
console.log("isNative")
/*
const writeSecretFile = async () => {
await Filesystem.writeFile({
path: 'secrets/text.txt',
data: "This is a test",
directory: Directory.Documents,
encoding: Encoding.UTF8,
});
};
*/
}
Thank you for help
1 post - 1 participant