Error after save the document if form.flattenAllFields is called
I am working with syncfusion_flutter_pdf ^22.1.37 and running on windows.
document.save() normally works, but If I call document.form.flattenAllFields() before, I got this error:
Unhandled Exception: type 'PdfString' is not a subtype of type 'PdfName' in type cast.
This was the stack:
#0 PdfField._getLoadedPage pdf_field.dart:532
#1 PdfField.page pdf_field.dart:145
#2 PdfFormHelper.beginSave pdf_form.dart:996
#3 PdfDictionary.onBeginSave pdf_dictionary.dart:554
#4 PdfDictionary.saveDictionary pdf_dictionary.dart:221
#5 PdfDictionary.save pdf_dictionary.dart:518
#6 PdfCrossTable._doSaveObject pdf_cross_table.dart:871
#7 PdfCrossTable._saveIndirectObject pdf_cross_table.dart:493
#8 PdfCrossTable._saveObjects pdf_cross_table.dart:361
#9 PdfCrossTable.save pdf_cross_table.dart:215
#10 PdfDocument._appendDocument pdf_document.dart:823
#11 PdfDocument.saveSync pdf_document.dart:583
#12 exportPdf export_bill.dart:18
#13 _BillTabState.addContent.
#14 GestureRecognizer.invokeCallback recognizer.dart:275
#15 TapGestureRecognizer.handleTapUp tap.dart:654
#16 BaseTapGestureRecognizer._checkUp tap.dart:311
#17 BaseTapGestureRecognizer.handlePrimaryPointer tap.dart:244
#18 PrimaryPointerGestureRecognizer.handleEvent recognizer.dart:630
#19 PointerRouter._dispatch pointer_router.dart:103
#20 PointerRouter._dispatchEventToRoutes.
#21 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
#22 PointerRouter._dispatchEventToRoutes pointer_router.dart:141
#23 PointerRouter.route pointer_router.dart:127
#24 GestureBinding.handleEvent binding.dart:465
#25 GestureBinding.dispatchEvent binding.dart:445
#26 RendererBinding.dispatchEvent binding.dart:331
#27 GestureBinding._handlePointerEventImmediately binding.dart:400
#28 GestureBinding.handlePointerEvent binding.dart:363
#29 GestureBinding._flushPointerEventQueue binding.dart:320
#30 GestureBinding._handlePointerDataPacket binding.dart:293
#31 _invoke1 (dart:ui/hooks.dart:158:13)
#32 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382:7)
#33 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)
Attachment: flutter_pdf_project_75930311.7z
Currently, we are analyzing the reported behavior with the provided details on our end and we will provide further details on July 12th, 2023
We confirmed the issue ”Type casting issue occurs while flattening specific PDF document” as a defect in our product and fix will be included in our upcoming weekly NuGet release, which will be available on July 25, 2023.
Use the below feedback link to track the status of the reported bug.
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
The fix for the reported issue "Type casting issue occurs while flattening specific PDF document" has been included in our Vol 2, 2023 SP release v22.2.5.
Kindly use the following link to refer to our latest package,
- 3 Replies
- 2 Participants
-
AA Alberto Aliberti
- Jul 9, 2023 12:14 PM UTC
- Jul 28, 2023 05:46 AM UTC