PdfViewer doesnt react to the textfield beeing set to ReadOnly

1 Answer 42 Views
PDFViewer
Dominik
Top achievements
Rank 1
Iron
Iron
Dominik asked on 29 Nov 2023, 10:10 AM | edited on 29 Nov 2023, 10:12 AM

Hey,

I have set my TextField to ReadOnly but the RadPdfViewer doesnt react to it. Im getting a pdf File that im importing using the telerik PdfFormatProvider after that im trying to set some of the fields to readOnly like this: 

if (formField is TextBoxField textBox)
{
	if (field is not null)
	{
	
		textBox.Value = field.ViewValue(viewMode);
		if (field.VarType != 0)
			formField.IsReadOnly = true;
			
	}
}

 

Im sure its setting it because if i export it to a pdf the fields are set to ReadOnly but not in the Telerik PdfViewer

 

Thanks

Dominik

Akbar
Top achievements
Rank 1
commented on 01 Dec 2023, 06:30 AM

Hello All,

I am stuck in the same scenario, Please anyone have any idea on this share ASAP.

Thanks,

Akbar Husain

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 01 Dec 2023, 12:01 PM

Hello Dominik,

This is a known issue with the IsReadOnly setting of the FormField objects. You can track it in our feedback portal.

To work this around, you can flatten the form fields as described in the help documentation. I hope that helps.

Regards,
Martin Ivanov
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.

Dominik
Top achievements
Rank 1
Iron
Iron
commented on 01 Dec 2023, 12:17 PM

Is there a way to reverse it? So its a field again?
Martin Ivanov
Telerik team
commented on 01 Dec 2023, 01:26 PM

No, flattening a form field will convert it to a standard element. If you want to unflatten it, you can try to remove the text element and insert a new form field. Can you tell me why would you need to change the element to field again? 
Dominik
Top achievements
Rank 1
Iron
Iron
commented on 01 Dec 2023, 01:43 PM

The User can fill a field with data from a database and that field has a binding to that database. I wanted to make it readonly if there is a binding. If the user then decides to remove that binding the readonly should be false so he can type in it agian.

That why i asked if i can unflatten it. But if there is no way then I have a different idea.

 

Akbar
Top achievements
Rank 1
commented on 04 Dec 2023, 04:33 AM | edited

Hey Dominic,

I am going through the same issue. so If you have any idea how to tackle it then please don't forget to share over here.

Thanks in Advance...

Martin Ivanov
Telerik team
commented on 04 Dec 2023, 03:22 PM

Thank you for sharing why you need to change this back to field. The item status is already change to In Development, so if everything goes smoothly this should be fixed soon and it should be available with the next official release. 
Tags
PDFViewer
Asked by
Dominik
Top achievements
Rank 1
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or