All Solutions for Reading Office Documents on Android

All Solutions for Reading Office Documents on Android

All Solutions for Reading Office Documents on Android

Reply 1024 to get a random surprise

Previous rambling session

For the first time, I am sending you a technical article on the weekend, please don’t mind. This week, the number of articles sent is relatively small, mainly because I am organizing GitHub open source Android projects and resources. I have reworked the previous classification layout, spending a lot of effort and time, and finally organized it to a certain extent. Looking back, “Hey, not bad!” It was worth the effort. I will write a separate article to introduce it later, keeping it a secret for now. Android developers who are interested can follow it, it’s definitely worth a Star:

https://github.com/Mike-bel/Awesome_Android

A few days ago, I saw an article summarized by asce1885 regarding browsing PDF files on the Android platform, listing various implementation methods and their pros and cons in detail. Coincidentally, in a project I handled not long ago, the functionality of online reading of Office documents (commonly PDF, EXCEL, WORD, PPT, etc.) was also involved, and I did some research on it, hence I wrote this article to make some personal supplements based on that article for future reference.

On the iOS platform, implementing online reading of Office documents on mobile devices is very simple; you just need to use WebView to load the URL of the network file. However, on the Android platform, due to the “high walls” and Google’s access restrictions in China, this simple operation becomes complicated, forcing developers to seek other solutions. Here are some listed.

WebView Web Display

Using the WebView control to load the remote document’s URL is sufficient. Here are two parsing solutions: Google Doc and Office Web 365.

Google Doc

Similar to iOS, Google also provides a function for online document parsing. You only need to pass the remote document’s URL to Google servers in a fixed format, and you can use the WebView control to load the new URL for display. The URL format for WebView loading is as follows:

https://docs.google.com/gview?embedded=true&url=document_address

Advantages: Easy to use, no extra server and client deployment work required. Disadvantages: Requires VPN access in China.

Office Web 365

A function provided by a third-party company for online preview of Office documents, capable of enabling mobile and PC online access to Microsoft, Adobe, and WPS documents. Easy to use, similar to the Google Doc access method, just a fixed format link to achieve:

http://ow365.cn/?i=your_website_ID&furl=document_address

Address: http://www.officeweb365.com/ Advantages: Powerful functions, easy to use. Disadvantages: Paid usage (can be used for free with limitations like access frequency, ad display, etc.).

Open Local Applications

If there are local applications installed on the mobile device that can open Office documents, you can use them to open the documents you want to operate, of course, the prerequisite is that the remote document must be downloaded to the local storage of the device:

All Solutions for Reading Office Documents on Android

Advantages: Readable and writable. Disadvantages: Requires prior download, and the device must have local applications capable of opening documents, plus reading will leave the current application.

Third-party SDK

There are some free open-source parsing source codes and paid SDKs provided by third-party companies online. By embedding them into your projects, you can use their functionalities to operate Office documents. The disadvantage of this method is also obvious; the most direct one is that it greatly increases the size of the APK installation file. Free open-source projects have some limitations and instability, and the operation is cumbersome; paid SDKs are relatively easier to use.

Free Open Source

  • pdfium

    Google’s open-source project, also the PDF rendering engine of the Chrome browser, with initial code from the well-known domestic PDF technology company “Foxit”.

  • AndroidPdfViewer

  • PdfiumAndroid

    Two Android platform implementations based on pdfium, supporting in-app preview of PDF documents, supporting animations, zooming, gestures, and double-click operations.

  • MuPDF

    A lightweight open-source PDF and XPS viewer.

Paid SDK

  • Foxit PDF SDK

    Produced by Foxit, stable performance, powerful functions, supports displaying, navigating, creating, searching, annotating, protecting, extracting PDF text, converting images, collecting and editing form data, etc.

  • plugPDF

    A paid SDK from abroad, easy to use, just three steps to integrate it into your application and use.

Server-side Parsing

It is necessary to complete the parsing of Office documents on the server side, using some technical means to convert the document into HTML files or images, and then load and display them on the client side through WebView.

  • PDF.js

    A JS solution open-sourced by “Mozilla”, providing both server-side and client-side integration methods.

  • pdf2htmlEX

    Similar to PDF.js, integrated on the server side, using web technology to complete the parsing of Office documents.

Overall, implementing preview and editing functions for Office documents on the Android platform is a relatively tricky problem, requiring consideration of actual product needs, development costs, stability, and other aspects. Of course, if it is not a hard requirement, it is best not to casually integrate open-source SDKs, as the research and development costs are too high, and stability may not be as expected.

Finally, I would like to thank asce1885 again for the summary. Reference address: Research on Implementing PDF File Reading Function on Android.

Public Account Recommendation

Focusing on programming knowledge for programmers, original tutorials, latest dynamics, etc. Now is the golden age of programming, it’s the ShowTime for programmers. We are not just coders, not just losers, not just programmers, we are Programmer Alliance.

All Solutions for Reading Office Documents on Android

Popular Tweets

★ Simple and efficient implementation of Gaussian blur effect on images using Android RenderScript

Breaking the 64K method limit in Android

[Translation]More than thirty valuable experiences I learned while developing Android Apps

★ These “very 7+1” tips will help you improve your coding skills!

★ Recommendation|A mind map telling Android beginners how to quickly get started

All Solutions for Reading Office Documents on Android

All Solutions for Reading Office Documents on Android

Read the original text to enter 【YiFeng ‘ Zone】

All Solutions for Reading Office Documents on Android

Leave a Comment

×