We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Manipulating Word files with form fields and protected sections from mobile device

Dear members,

we are planning to implement a mobile device-based solution for one of our customers. Under mobile device we mean Android and iOS tablets, maybe phones with larger screens.

Today our customer has a .NET based portal called Sense/Net ECM which is quite similar to SharePoint. They store an enormous number of documents in their document libraries which they would like to edit somehow from their mobiles just like they do it today from their MS Word on their PC.

I have not found any solutions so far which supports editing the content of Word files in a sophisticated way as all solutions (even Office 365) are missig e.g. the handling of form fields and protected areas, which are essential for us.

Aspose might be good for us to get around this problem, but we are not sure of this, so we need a confirmation.

Possible solution can be:
We make an Android and iOS native app that can browse the word files in the doc library via our REST API (this is easy). When the user opens the file for editing, we use one of Aspose’s .NET library to present the MS Word file itself (I guess we can read all parts of the document and present texts and fields etc. on the dvice) or if the Word file cannot be presented then we can display a converted file (e.g. interactive pdf or HTML) for the user. User fills in form fields and then submits the form, meaning he sends in the provided information as an XML to the doclibrary, where we use it to update the Word file via Aspose’s .NET API.

I wonder if there is a simplier way to do this, and if we need to use Aspose’s Android SDK for this at all or the basic .NET components are enough. Do you think this could work?

I would appreciate if someone could give me useful inforation if this works or not.

Thanks.

Best regards,
Zoltan Szekeres

Hi Zoltan,
If your host platform/app is .NET and your Android and iOS apps will access your .NET app (for document manipulation) via REST API, then you can use Aspose.Words for .NET. If you want to develop pure Android and iOS apps which will manipulate/update and convert documents on mobile devices, then Aspose.Words for .NET cannot be used and following solutions are available in this scenario.

  1. You can use Aspose.Words for Android to load remote documents (Aspose.Words for Android supports loading documents from URL) and edit form fields or other sections of the documents. You can also convert Word documents to HTML and other formats and convert HTML to Word.
    The only restriction in this solution is that we do not have a library which allows you to work with documents on iOS devices (only Android devices are supported).
  2. You can use Aspose.Words for Cloud to convert Word documents to HTML and convert updated HTML to Word on any platform including Android and iOS. Please check Working with Documents using Aspose.Words for Cloud for more details.
    Best Regards,

Dear Muhammad,

thanks for your reply.

We have to make sure that we have the very same Word file after manipulating it, so I wonder if we can guarantee that abter converting Word to HTML and back. I guess this will ruin the document e.g. bookmarks will be missing, styles probably will change etc. Am I right?

This is why I was thinking about creating an HTML or PDF form from the word file and post the filled in information to a service, which will write it into the document. Is this posibble?

While manipulating we need to see the whole content of a document. In many documents we have static text, tables and checkboxes and text inputs next to / under each other. I attach a sample one.
We somehow need to enable the user to see the contents of this Word file on a mobile device, fill in the form fields and save the file back.

As I understand there is no doc viewer plugin on the mobiles, what you can give us in case of a word file is an API to read and update form fields, but we cannot display static texts. Please confirm this as currently I really can’t imagine what we can display on a mobile phone for the user. Something like in Kingsoft Office or a similar app, or just a simple form with the fields? We don’t insist on converting anything on a mobile, but I am not sure if we can do everything server side with Aspose.Word.

What soulition do you think would be possible and the best/easiest?

  1. Generate a HTML or PDF form from the original Word file by Aspose.Word/PDF and submit changes back to a webservice which updates the Word file via Aspose.Word
    OR
    2a) Download Word file to mobile, open is with Aspose.Android, manipulate, and upload it from the app back to our content repository via a custom upload function
    OR
    2b) Download Word file to mobile, convert is with Aspose.Android to pdf or HTML, fill in and, and submit changes back to a webservice which updates the Word file via Aspose.Word
    OR
  2. Open Word file via the Cloud service from 3rd party storage, fill in and save back to 3rd party storage

If I get you right, these are the possible ways to do this, right?

Please note that currently we have Aspose.Total licenses, so we prefer not to get others (e.g. Cloud) only if we cannot solve this problem without them.

Thanks.

Best regards,
Zoltan

Hi Zoltan,
Your understanding and what you have stated above is correct. You might not get 100% fidelity if you go for Word to HTML to Word. The best possible solution in the given conditions is solution 1 in your post. You can convert Word to HTML and then pass filled information to your service and update the Word file.
Best Regards,

Dear Muhammad,

thanks for the answer. We will do some prototyping then.

Is there any best practice how to make a fillable HTML page/form from the Word file? Is there a buil-in functionality for this, or do we need to program this field by field?

How about the pdf way. Is there a function that would convert the docx to an interactive pdf where the fields can be filled in and the values can be posted by a submit button which we add when converting docx to pdf?

Best regards,
Zoltan

Hi Zoltan,
Please try converting to PDF and set PreserveFormFields option in the PdfSaveOptions to true. This will give you an interactive PDF and you can convert that PDF to DOC/DOCX using Aspose.Pdf once the PDF is filled.
Best Regards,

Dear Muhammad,

Thanks for the example.

I’m still not concerned about converting the docx to pdf, so I tried another way. I managed to convert a docx file into HTML and the form fields were preserved in that case as well.

Is there an option to make this HTML a webform that can submit the entered folr values? Can I add a Submit button to this HTML while converting or do I need to do that in a custom way with my custom code?

I really don’t know if the HTML or PDF based solution would be better to use on the mobile devices. When it comes to posting back information from the HTML/PDF form, then I think the HTML based could be better as it could be used inside our mobile app, while the pdf probably would not work like that as it would be opened in a seperate pdf reader app (not our app), so we would not have control over it. However the pdf form could have a submit button with a special url including authentication data as well, so the submission could be done from the pdf reader app as well.

What do you think about this? Am I right?

Thanks.

Best regards,
Zoltan

Hi Zoltan,
Your understanding is correct about HTML vs PDF forms. In your case, it is better to use HTML forms but Aspose.Words will not make it a submit form during conversion. You will have to use your custom code to make it a submit form.
Best Regards,