Completed
Last Updated: 04 Oct 2022 14:57 by ADMIN
Release R3 2022 SP1
Martin
Created on: 28 Sep 2022 13:41
Category: PdfProcessing
Type: Bug Report
0
PdfProcessing: ArgumentNullException is thrown when exporting a document that contains a Widget created with FixedContentEditor

When exporting a document that contains a Widget created with FixedContentEditor an exception is thrown: System.ArgumentNullException: 'Value cannot be null. Parameter name: context'

It can be reproduced using the following code snippet:

RadFixedDocument document = new RadFixedDocument();
var page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);

PushButtonField pushButton = new PushButtonField("button");
editor.Position.Translate(20, 450);
editor.DrawWidget(pushButton, new Size(100, 20));

string path = "Exported.pdf";
File.Delete(path);

using (Stream output = File.OpenWrite(path))
{
	PdfFormatProvider provider = new PdfFormatProvider();
	provider.Export(document, output);
}

Workaround: Add the form filed to the AcroForm`s FromFields collection before exporting the document:
document.AcroForm.FormFields.Add(pushButton);

1 comment
ADMIN
Peshito
Posted on: 04 Oct 2022 14:57

Hello,

This item will be available in R3 2022 SP1 Release. 

It is also available with Telerik UI for WPF's latest internal build - LIB 2022.3.1010 (10 Oct 2022) if you need it earlier.

Regards,
Peshito
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.