@@ -4,6 +4,7 @@ import 'dart:typed_data';
44// dart:io מגדיר Link משלו (קישור בקובץ־מערכת) שמתנגש ב-Link של הקישורים.
55import 'dart:io' hide Link;
66import 'dart:math' as math;
7+
78import 'package:collection/collection.dart' ;
89import 'package:file_picker/file_picker.dart' ;
910import 'package:otzaria/book_common/utils/link_anchor_markers.dart' ;
@@ -521,8 +522,10 @@ const int _pluginRawLinksMaxRecords = 10000;
521522/// מספר הפריטים המרבי בקריאת `library.getLinkContent` אחת.
522523const int _pluginLinkContentMaxItems = 25 ;
523524
524- typedef PluginRpcEventSink =
525- Future <void > Function (String topic, Map <String , dynamic > payload);
525+ typedef PluginRpcEventSink = Future <void > Function (
526+ String topic,
527+ Map <String , dynamic > payload,
528+ );
526529
527530class _PluginNetworkRequest {
528531 final Uri uri;
@@ -5000,7 +5003,7 @@ class PluginBridgeAdapter {
50005003 return printed ?? false ;
50015004 }
50025005
5003- /// קורא את קובץ ה- PDF לפני פתיחת מסך ההדפסה בחלון הבקשה.
5006+ /// פותח קובץ PDF במסך ההדפסה בחלון הבקשה.
50045007 Future <bool > _defaultPrintPluginFile (
50055008 File file, {
50065009 required String jobName,
@@ -5012,9 +5015,9 @@ class PluginBridgeAdapter {
50125015 if (context == null || ! context.mounted) {
50135016 throw Exception ('error.unavailable: No window to show the print screen' );
50145017 }
5015- final Uint8List bytes;
50165018 try {
5017- bytes = await file.readAsBytes ();
5019+ final handle = await file.open ();
5020+ await handle.close ();
50185021 } on FileSystemException {
50195022 // בלי הנתיב: הגשר מחזיר לתוסף את הודעת החריגה כמות שהיא.
50205023 throw Exception ('error.unavailable: the file could not be read' );
@@ -5029,7 +5032,7 @@ class PluginBridgeAdapter {
50295032 data: Future .value ('' ),
50305033 // במסלול ה-PDF בלבד: תווית להצגה, לשם עבודת ההדפסה ולשם הקובץ בייצוא.
50315034 bookId: jobName,
5032- createPdfOverride : (_) async => bytes ,
5035+ pdfFilePath : file.path ,
50335036 ),
50345037 );
50355038 return printed ?? false ;
0 commit comments