Editor in a PDF

假装没事ソ 提交于 2020-08-09 13:54:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!