We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Overflow text & PdfTextBoxField Events

Hello,

   I have two questions:
  1. I am creating a fillable pdf in my Xamarin.Forms app and have a number of PdfTextBoxFields, some of which are quite small.  I would like to be able to overflow the text from one small text box to another larger text box while typing or worst case once typing is complete and the field loses focus.  Ex: Say I have a sentence: "We are performing 26 tasks this week.  Please be on time and lets get this done!"  I would like to be able to type into the smaller text box and anything that does not fit would automatically overflow into the larger text box. TextBox1 would contain: "We are performing" and TextBox2 would contain: " 26 tasks this week.  Please be on time and lets get this done!" Is there a setting or function that can allow me to perform this function?  I have searched and could not find anything.
  2. When trying to solve #1 I came across the PdfJavaScriptAction, so I created a PdfJavaScriptAction function and assigned it to my PdfTextBoxField and what I found is that only the .GotFocus action is called and only when the pdf is loading in the viewer, all of the other Actions to not get called at any time, even if I modify (type into) the field.  I would like to be able to tie an event to a field for multiple reasons and it seams like an action is the only solution, however, I cannot get any actions to run once the pdf is loaded in the viewer.  
Thanks for any help you can provide.

5 Replies

KC Karthikeyan Chandrasekar Syncfusion Team January 23, 2019 11:57 AM

Hi Michael, 
We are currently analyzing the possibility to perform your requirement with the help of Java script actions. Meanwhile could you please let us know which PDF viewer you are using in mobile platform to view or fill the PDF document, since different viewers may not have support for performing JavaScript actions, also please provide us the JavaScript string which you have provided which does not work from your side. 
Regards, 
Karthikeyan 



MI MikeD January 23, 2019 03:30 PM

I am using Syncfusion.Xamarin.SfPdfViewer version 16.4.0.48 (the newest in nuget) and Syncfusion.Xamarin.Pdf version 16.4.0.48 (also the newest in nuget).  The JavaScriptAction that I am using is below:


PdfJavaScriptAction javaAction = TextBoxAction();
textBoxField.Actions.GotFocus = javaAction;

public PdfJavaScriptAction TextBoxAction()
{
       textBoxField2.Text = "Hi!!!!";
       return null;
}

What I was trying to do was to set the text in textBoxField2 whenever textBoxField has focus, however the java script action is ran once when the form is loading into the viewer and is not ran when the text field actually gets focus.  Note that I am creating the pdf in code and storing it in memory and loading it into the viewer from the Stream.


KC Karthikeyan Chandrasekar Syncfusion Team January 25, 2019 12:59 PM

Hi Michael, 
PDF Viewer 
Our PDF viewer do not have support for JavaScript in the PDF document, it support actions only to identify Numeric and Alpha Numeric keyboard associated with the textbox. We do not have any immediate plans to implement this feature. 
 
PDF Creation 
We are still working in this by referring the JavaScript actions to achieve your requirement. 
Regards, 
Karthikeyan  



MS Michal Saman August 8, 2019 04:47 AM

Hello,

we have a some similar request on SfPdfViewer. In our application we need check every change in PdfTextBoxField
Depending on catched change in one field we must fill data in other field. 
Will you planned implemented some standart handler, used in C#,  for services this type of request? 
Or exists in this time some way of solution,  look like standart Entry as in xamarin?

Thanks for help, Best Regards  

Vladimir



GR Gayathri Ramalingam Syncfusion Team August 9, 2019 09:40 AM

 Hi Vladimir, 
 
Please find your query from below, 
 
Query 
Detail 
we have a some similar request on SfPdfViewer. In our application we need check every change in PdfTextBoxField.  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Depending on catched change in one field we must fill data in other field.  
Will you planned implemented some standart handler, used in C#,  for services this type of request?  
Or exists in this time some way of solution,  look like standart Entry as in xamarin? 
 
At present we do not have support for “events to track the form fields Interaction”. We do not have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. 
Based on our present commitments and the above parameters, this feature is expected to be implemented in our 2019 Volume 4 main release. We will let you know when this feature is implemented. 
Disclaimer: The date for the feature implementation is tentative and not a commitment on our parts. 
      
You can now track the status of this feature request here,        
 
 
Once provided support for event tracking, we will expose event arguments with form field type and its corresponding values. Using that we can iterate form fields from PdfLoadedDocument and map the values of required form field. After that save the document with modified form fields into memory stream and load that stream using PDF Viewer to view the changes. 
 
 
 
 
With Regards, 
Gayathri R 


Loader.
Live Chat Icon For mobile
Up arrow icon