I tried the code of how to fill preinsert forms on pdf using syncfusion that one created, and I think some argument is outdated because of the null safety. Can someone help me how to properly use the fill form on pdf please. This is my code :
import 'dart:io';
import 'package:syncfusion_flutter_pdf/pdf.dart';
class edit{
final PdfDocument doc = PdfDocument(inputBytes: File('template/cl.pdf').readAsBytesSync());
late PdfForm form = doc.form;
//Get text box and fill value.
late PdfTextBoxField name = doc.form.fields[0] as PdfTextBoxField;
name.text = 'John';
//to change the font or size use
name.font = PdfStandardFont(PdfFontFamily.timesRoman, 12,0);
}
I want a code that can fill the form with some textform field widget that I made through the widget.
We suggest you to check the field type before accessing it properties to avoid unwanted exceptions. Please refer to the following code snippet for your reference.
Please refer to the UG documentation for further details.
https://help.syncfusion.com/flutter/pdf/working-with-forms#filling-form-fields-in-an-existing-pdf-document
If still you are facing issues, we kindly request you to share the input PDF document to reproduce the reported issue on our end. It will be helpful for us to analyze and assist you further on this.
Note: I work for Syncfusion.