NTKO usage experience in online office document editing

Source: Internet
Author: User

NTKO usage experience in online office document editing
Directory

  • Preface
  • What is ntko?
  • Preparations
  • Practical drills
  • Summary
I. Preface

Online office document processing is often used in Web development. Currently, some commonly used Web page calling controls for displaying Office are available on the market, making it easy to use. There are some third-party ActiveX browser controls, such as kohan's SOAOffice middleware, Zhuo Zheng's pageoffice controls, WebOffice controls, and ntko I want to talk about in this article.

2. What is NTKO?

  Easy to understand, you can directly view and edit Word documents in a browser and save them to controls on the web server.

Borrow the official words, is able to in IE, Firefox, Google and other core browsers directly edit WPS, MS Office, Kingsoft electronic table and other documents and save to the web server, enables unified management of documents and workbooks. It also provides essential functions for office automation systems, such as trace retention, template red, QR code, pdf, and tif reading. For details, refer to the definition on the official website.

Advantages:

Disadvantages:

Iii. Preparations

Test environment: browser: IE7 and later; Operating System: Windows; local Office: Office 2003-2013; (I heard that ntko does not support office 2016) Note that the Office must be in the full version.

Official js, css, and cab: 1.Ntko. js2.Ntkoofficecontrol. js3.ComFun_OA8.js4.OfficeControl. cab5.Css_One.css(These official websites can be downloaded)

The. cab file Baidu encyclopedia means: windows compression format, which can be opened with winrar, but some are encrypted and cannot be opened with common compression programs. Here, OfficeControl is essential. It is the interface for calling the local server on a Web page.

Because NTKO is an ActiveX control, when you operate a local control through a browser, the user permission to be operated must be an administrator user so that the control can be loaded normally. Therefore, this problem can be solved by adding the application system site to the trusted site of IE browser. Restart the browser after setting.

If noTo load the document control, check the security settings of the browser in the browser check options. The solution on the official website is as follows:

 

This issue has nothing to do with the control itself. To solve the problem that NTKO cannot be automatically loaded, let's take a look at the steps involved in browser objects.

The first is the code referenced in HTML:

<object id="TANGER_OCX" classid="clsid:C9BC4DFF-4248-4a3c-8A49-63A7D317F404" codebase="/path/to/OfficeControl.cab#version=4,0,0,5" width="100%" height="100%">

1. id = "TANGER_OCX" is the programming identifier of the control js. It is referenced by documnet. all ("TANGER_OCX.

2. clsid: The C9BC4DFF-4248-4a3c-8A49-63A7D317F404 identifies the unique identifier of the ntko document, the browser uses clsid to determine whether the client accessing the web page has installed ntko.

3. You don't need to mention codebase. Let's take a look at the meaning of the path where the file is stored. version indicates the version number of the control.

AppearsTo load the document control, check the security settings of the browser in the browser check options.The problem may be caused by the following reasons:

1) The security settings in the local Internet option prohibit the download of signed ActiveX controls in the current region;
2) on the webpage that references the control, the <codebase attribute specified in the object tag is incorrect, causing the browser to fail to download the OfficeControl. cab file;
3) The OfficeControl. cab on the server is damaged, the correct signature is lost, or an incorrect version is used;
4) Although the OfficeControl. cab on the server is correct, there is a problem with the download from the browser. This may be caused by Incorrect mime configurations on some WEB servers. As a result, the server does not send OfficeControl. cab to the browser as a binary file;
5) The security settings in the local Internet option are not allowed to run ActiveX controls and plug-ins in the current region;
6) It may also be caused by Microsoft patches, or other anti-virus software or filter software that prevents control installation.

If there are other problems, you can log on to the official website to solve the problem.

Iv. Practical drills

Next we will use a project instance I recently worked on to explain the principle of ntko, and the functional requirements will be shown in the map.

First, add data on the page, submit the operation, and insert data into the corresponding database data table.
Figure 1

Next, after the operation prompt is submitted successfully, fill in the report materials, click fill in, go to the declaration form page, call the ntko control, 3.

Figure 2

For example, because the local Office is called, all functions in Office are retained on the page, including common font settings, insertion, and design.
Figure 3

For online editing of the word content, the corresponding fields in the database are bound to the word template in the form of bookmarks, 4. For online editing, you must first create an empty word template. Of course, the style in word is typeset by yourself, and then insert the place where fields need to be bound into the bookmarks. the bookmarks are bound to fields in the corresponding data table.

Figure 4

Finally, reference the method in js loading the page for the first time on the html page. For some explanations, refer to the Api on the official website.

Function window_onload () {var DocPrintUrl = '<% = ViewState ["DocPrintUrl"]. toString () %> '; // obtain the doc template address // var DocPrintUrl = 'px _ OpenFile_List.aspx'; OpenEditOffice (DocPrintUrl, "1"); // call ntko. setReviewMode (true); // revision mode setShowRevisions (false); // display trace TANGER_OCX_OBJ.Menubar = true; // whether to display the menu bar TANGER_OCX_OBJ.TitleBar = true; // whether to display the title bar SetBookmarkValue ("ZX_QYMC", '<% = ViewState ["UnitName"]. toString () %> '); // add content to the word bookmarks}
V. Summary

NTKO and other third-party ActiveX controls bring us great convenience. It can automatically identify the modified documents and prompt to save the complicated process of downloading, modifying, and uploading on the server, it provides functions such as online editing, online preview, electronic seal, attachment management, and large file upload. However, there are also many disadvantages. When Html, Css, and desktop are gradually converted, controls may also be eliminated sooner or later.

 

Author: edisoner
Disclaimer: The copyright of this article is shared by the author and the blog. You are welcome to repost it, but you must keep this statement and provide the original article link clearly on the article page. Otherwise, the author will reserve the right to pursue legal liability.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.