Welcome to the .NET MAUI feedback portal. We’re happy you’re here! If you have feedback on how to improve the .NET MAUI, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi, if the pdfviewer contains a combobox without a selected item then the SaveDocument methods fail with a System.ArgumentOutOfRangeException.
Sample code:
PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
PdfComboBoxField comboBoxField = new PdfComboBoxField(page, "JobTitle");
comboBoxField.Bounds = new Syncfusion.Drawing.RectangleF(0, 40, 100, 20);
comboBoxField.Items.Add(new PdfListFieldItem("Development", "accounts"));
comboBoxField.Items.Add(new PdfListFieldItem("Support", "advertise"));
comboBoxField.Items.Add(new PdfListFieldItem("Documentation", "content"));
document.Form.Fields.Add(comboBoxField);
MemoryStream stream = new MemoryStream();
document.Save(stream);
stream.Position = 0;
pdfViewerControl.DocumentSource = stream;
var stream = new MemoryStream();
//await pdfViewerControl.SaveDocumentAsync(stream);
pdfViewerControl.SaveDocument(stream); =>