cpdf_reader_widget_controller.dart 894 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  3. *
  4. * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  5. * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  6. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  7. * This notice may not be removed from this file.
  8. *
  9. */
  10. import 'package:flutter/services.dart';
  11. class CPDFReaderWidgetController {
  12. late MethodChannel _channel;
  13. CPDFReaderWidgetController(int id) {
  14. _channel = MethodChannel('com.compdfkit.flutter.ui.pdfviewer.$id');
  15. _channel.setMethodCallHandler((call) async {
  16. });
  17. }
  18. /// Save document
  19. /// Return value: **true** if the save is successful,
  20. /// **false** if the save fails.
  21. Future<bool> save() async {
  22. return await _channel.invokeMethod('save');
  23. }
  24. }