pdftextboxfield Border properties not working

Hi,

I am using pdftextboxfield in a PDF but the border properties are not working properly. I want to remove the border either with width=0 or color as whit. Both don't work:

textBoxField.BorderWidth = 0;
textBoxField.BorderColor = new PdfColor(Color.White);




Kind regards

3 Replies 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team August 3, 2020 11:08 AM UTC

Hi Haikal,   
  
Thank you for contacting Syncfusion support.   
  
We have tried to remove the border with using BorderWidth 0 and BorderColor as White and it removes the border properly. Please refer the below code snippet,  
 
//Create a new PDF document  
PdfDocument document = new PdfDocument();  
  
//Add a new page to the PDF document  
PdfPage page = document.Pages.Add();  
  
//Create a textbox field and add the properties  
PdfTextBoxField textBoxField = new PdfTextBoxField(page, "FirstName");  
textBoxField.Bounds = new RectangleF(0, 0, 100, 20);  
textBoxField.ToolTip = "First Name";  
textBoxField.Text = "Hello"  
  
//Set the border width   
textBoxField.BorderWidth = 0;  
  
////Set the border color   
//textBoxField.BorderColor = new PdfColor(Color.White);  
  
//Add the form field to the document  
document.Form.Fields.Add(textBoxField);  
  
 
  
Please try the above sample in your end and let us know the result. If you still facing the issue, please provide us the below details, it will helpful for us to provide the precise solution on this.   
  
·       Modified sample   
·       PDF Viewer details (like Adobe, Chrome, etc.,)   
·       Product version   
  
Regards,  
Sowmiya Loganathan 
 
 


Marked as answer

HK Haikal Khair August 3, 2020 02:50 PM UTC

Hi,

your sample works. Is this related to my version of the library? 17.1450.0.32


PV Prakash Viswanathan Syncfusion Team August 4, 2020 12:46 PM UTC

Hi Haikal,   
   
Thank you for contacting Syncfusion support.    
   
We have checked the sample with 17.1450.0.32 version and we are not able to reproduce the reported border preservation issue and it is working as expected.   
If still you are facing the same issue on your side, kindly share with us the below details to reproduce the issue on our side. So that it will be helpful for us to analyze and assist you further on this.    
  • Output PDF document.
  • Complete code snippet.
  • Platform.
  • Simple sample/modify the provided sample to reproduce the issue (if possible).
Regards,  
Prakash V 

Loader.
Up arrow icon