简体   繁体   中英

Print PDF on web using flutter/dart/javascript

I'm using Flutter for web to create an application to fill in forms. I'm trying to make it so no information is ever saved to disk, only ever stored in memory.

I can't seem to find a good solution to print a PDF from byte array in javascript, so that I can call it from Dart/Flutter.

I've taken a look at https://plnkr.co/edit/tv3Cma?p=preview but the problem is that it doesn't work in chrome anymore.

var dataURI = "data:application/pdf;base64," +base64EncodedPDF;
window.open(dataURI);

Any other potential solutions I could try?

PDF.js is an open-source JavaScript library that allows you to parse and render PDF files right inside your web pages. Here tutorial available for pdf render in web page https://code.tutsplus.com/tutorials/how-to-create-a-pdf-viewer-in-javascript--cms-32505

Have you tried dart-pdf ?

Here is demo page demo dart-pdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM