问题
I am trying to edit a pdf file. I am able to load the pdf file and view the same and now I am trying to edit the file using MS-paint kind of feature in it. The edit will be of manual
import 'package:flutter/material.dart';
import 'package:flutter_plugin_pdf_viewer/flutter_plugin_pdf_viewer.dart';
class Viewer extends StatefulWidget {
@override
_ViewerState createState() => _ViewerState();
}
class _ViewerState extends State<Viewer> {
String pdf = "files/view.pdf";
PDFDocument _doc;
bool _loading;
@override
void initState() {
_viewPdf();
super.initState();
}
_viewPdf() async {
setState(() {
_loading = true;
});
final doc = await PDFDocument.fromAsset(pdf);
setState(() {
_doc = doc;
_loading = false;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: _loading
? (Center(
child: CircularProgressIndicator(),
))
: PDFViewer(document: _doc),
),
);
}
}
Please help me with this
来源:https://stackoverflow.com/questions/63085686/editor-in-a-pdf