Method for annotating files in browser

文档序号:1889912 发布日期:2021-11-26 浏览:17次 中文

阅读说明:本技术 一种实现在浏览器中对文件批注的方法 (Method for annotating files in browser ) 是由 朱玮 谈辉 周峰 丁昊 于 2020-05-21 设计创作,主要内容包括:本发明公开了一种实现在浏览器中对文件批注的方法,包括:在浏览器的支持程序中植入转码程序,所述浏览器的支持程序内具有页面渲染模块;用户上传待批注文件,利用浏览器打开所述待批注文件,所述转码程序将所述待批注文件转换成可批注的文件,所述转码程序具有签批功能块,用户通过所述签批功能块对所述可批注的文件进行批注,批注完成后,通过浏览器将批注内容转化为批注图片,所述批注图片通过服务器程序合并在所述待批注文件的对应位置处。本发明提出了一种基于JavaScript技术实现在浏览器中对文件自定义批注的方法,方便用户在浏览器内对文件进行签批。(The invention discloses a method for annotating files in a browser, which comprises the following steps: implanting a transcoding program into a support program of a browser, wherein the support program of the browser is internally provided with a page rendering module; the method comprises the steps that a user uploads a file to be annotated, the file to be annotated is opened by a browser, a transcoding program converts the file to be annotated into a file capable of being annotated, the transcoding program is provided with an endorsement function block, the user annotates the file capable of being annotated by the endorsement function block, after the annotation is completed, annotation content is converted into an annotation picture by the browser, and the annotation picture is combined at a corresponding position of the file to be annotated by a server program. The invention provides a method for realizing the user-defined annotation of files in a browser based on a JavaScript technology, which is convenient for a user to sign the files in the browser.)

1. A method for annotating a file in a browser is characterized by comprising the following steps:

implanting a transcoding program into a support program of a browser, wherein the support program of the browser is internally provided with a page rendering module;

a user uploads a file to be annotated, the file to be annotated is opened by using a browser, the transcoding program converts the file to be annotated into an annotatable file,

the transcoding program is provided with an endorsement function block, a user annotates the annotatable file through the endorsement function block, after the annotating is finished, the annotating content is converted into an annotating picture through a browser, and the annotating picture is merged at the corresponding position of the file to be annotated through a server program.

2. The method of claim 1, wherein the transcoding program converts the to-be-annotated document into an annotatable file, the annotatable file comprising a web page format file compatible with a browser.

3. The method of claim 1, wherein the endorsement function enables a user to annotate the web page formatted file in the form of a page annotation.

4. The method according to claim 2, wherein after the user annotates the web page format file through the endorsement function block, the endorsement function block calls a page rendering module in the browser support program to perform page rendering on the web page format file.

5. The method of claim 4, wherein the page rendering module page-renders the web page format file specifically comprises:

and performing page drawing and forming on the file content of the webpage format file, the file document format and the file space to obtain the created annotatable file page.

6. The method according to claim 1, wherein after the user annotates, a page rendering module in the browser support program converts annotation content into an annotation picture, and the annotation picture is merged at a corresponding position of the file to be annotated through a server program to obtain an annotation file.

Technical Field

The invention relates to a method for realizing the annotation of a file in a browser, in particular to a method for realizing the user-defined annotation of the file in the browser based on a JavaScript technology.

Background

In a certain situation, a file is usually received and browsed in a browser, but if we need to annotate at will, the browser cannot support our needs, in order to annotate, the file is usually downloaded, and then the file is opened through corresponding types of software to browse the annotation, such as a word file, a ppt file or an ofd file, so that the common types of file formats are frequently used in our work and life, such as received email attachments, and when previewing in the browser, the annotation is desired to be quickly performed, but cannot be realized, which wastes time and energy, and increases work load.

Therefore, a new technical solution is needed to solve the above problems.

Disclosure of Invention

The invention aims to solve the problems in the prior art and provides a method for annotating files in a browser, which adopts the following technical scheme:

a method for annotating a file in a browser comprises the following steps:

implanting a transcoding program into a support program of a browser, wherein the support program of the browser is internally provided with a page rendering module;

further, a user uploads a file to be annotated, the file to be annotated is opened by using a browser, the transcoding program converts the file to be annotated into an annotatable file,

furthermore, the transcoding program is provided with an endorsement function block, a user annotates the annotatable file through the endorsement function block, after the annotating is completed, the annotating content is converted into an annotating picture through a browser, and the annotating picture is merged at the corresponding position of the file to be annotated through a server program.

Further, the transcoding program converts the files to be annotated into annotatable files, wherein the annotatable files comprise web page format files compatible with a browser.

Furthermore, the endorsement function block supports a user to annotate the webpage format file in a page annotating mode.

Furthermore, after the user annotates the web page format file through the endorsement function block, the endorsement function block calls a page rendering module in the browser support program to perform page rendering on the web page format file.

Further, the page rendering of the web page format file by the page rendering module specifically includes:

furthermore, the file content, the file document format and the file space of the webpage format file are subjected to page drawing and forming, and the created page of the annotatable file is obtained.

Further, after the user finishes annotating, a page rendering module in the browser support program converts annotation content into an annotation picture, and the annotation picture is merged at a corresponding position of the file to be annotated through a server program to obtain an annotation file.

Compared with the prior art, the invention has one or more of the following beneficial effects:

1. the invention provides a method for annotating a file in a browser, which meets the requirement that a user previews a word document, a ppt document or an ofd document in the browser through a transcoding program, can alter by using a handwriting signing function only by opening a signing function block through the transcoding program, and obtains the altered document after storage;

2. by utilizing the method for annotating the file in the browser, the user can conveniently sign the file in the browser, the operation step of downloading and reopening the file is omitted, and the office and life are more convenient and less worry.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

FIG. 1 is a window diagram illustrating a first step in a user opening an exemplary file in a browser using the method of the present invention;

FIG. 2 is a schematic view of a window in which a user posts the example document in the window page of FIG. 1, wherein the document format of the example document is pdf format;

FIG. 3 is a schematic view of a state of a window where a browser converts annotation content into an annotation picture after the user completes annotation based on FIG. 2;

fig. 4 is a schematic view of a window of an annotation file obtained by a server merging annotation pictures into corresponding positions of an example file after a user saves the annotation pictures on the basis of fig. 3.

Detailed Description

The technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In the description of the present invention, it is to be understood that the terms "upper", "lower", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.

In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.

The gist of the present invention will be further explained below with reference to the accompanying drawings and examples.

Example (b):

for solving the problems existing in the prior art, the present invention provides a method for annotating a file in a browser, please refer to fig. 1-4, fig. 1 is a schematic window diagram of a first step of a user opening an exemplary file in a browser by using the method of the present invention; FIG. 2 is a schematic view of a window in which a user posts the example document in the window page of FIG. 1, wherein the document format of the example document is pdf format; FIG. 3 is a schematic view of a state of a window where a browser converts annotation content into an annotation picture after the user completes annotation based on FIG. 2; fig. 4 is a schematic view of a window of an annotation file obtained by a server merging annotation pictures into corresponding positions of an example file after a user saves the annotation pictures on the basis of fig. 3.

A method for annotating a file in a browser comprises the following steps:

implanting a transcoding program into a support program of a browser, wherein the support program of the browser is internally provided with a page rendering module;

a user uploads a file to be annotated, the file to be annotated is opened by using a browser, the transcoding program converts the file to be annotated into an annotatable file,

the transcoding program is provided with an endorsement function block, a user annotates the annotatable file through the endorsement function block, after the annotating is finished, the annotating content is converted into an annotating picture through a browser, and the annotating picture is merged at the corresponding position of the file to be annotated through a server program.

In one embodiment, the transcoding program converts the to-be-annotated document into an annotatable document, wherein the annotatable document comprises a web page format document compatible with a browser.

In one embodiment, the endorsement function block of the present invention supports a user to annotate the web page format file in a page annotation manner.

Furthermore, after the user annotates the web page format file through the endorsement function block, the endorsement function block calls a page rendering module in the browser support program to perform page rendering on the web page format file.

The page rendering module specifically performs page rendering on the web page format file by including:

and performing page drawing and forming on the file content of the webpage format file, the file document format and the file space to obtain the created annotatable file page.

In one embodiment, after the user finishes annotating, a page rendering module in the browser support program converts annotation content into an annotation picture, and the annotation picture is merged at a corresponding position of the file to be annotated through a server program to obtain an annotation file.

The method for annotating the file in the browser realizes the requirement that a user previews a word document, a ppt document or an ofd document in the browser through a transcoding program, can revise the word document, the ppt document or the ofd document by using a handwriting signing function only by opening a signing function block through the transcoding program, and obtains the revised document after storage.

The partial codes of the transcoding program are as follows:

the method for realizing the annotation of the file in the browser has the following realization principle:

a user uploads a word document (or a document with another format), the word document is converted into a webpage document through a transcoding program and previews the webpage document as shown in fig. 1, a handwriting signing function is opened through a signing function block of the transcoding program, an editing toolbar is formed on a page as shown in fig. 2, the user notes the document through the editing toolbar, and a page rendering module (the page rendering module can be canvas which is a new function provided by html 5) is arranged in a supporting program of the browser after the annotation is finished, if the browser supports the new characteristic of html5, the function can be used, and the new function is supported by google, fire fox and IE9 at present, the method of the invention needs a developer to write a corresponding JavaScript program and draw the canvas page, and draws the page as shown in fig. 3 and 4, when the annotation is finished and stored, the rendering content is converted into a picture through a browser page rendering module (which may be a function of a canvas and may generate picture content from the rendering content), the picture is sent to a server, the server merges word and the picture according to information (a page number corresponding to the picture), merging operation is provided by a server program, based on partial capability provided by office software, merging operation can be performed on the picture and a source document, and a merged final file is finally formed, as shown in fig. 4.

The local related codes of the signing function in the JavaScript program are as follows:

in summary, the invention provides a method for realizing the user-defined annotation of files in a browser based on the JavaScript technology, and by using the method for realizing the annotation of files in a browser, a user can conveniently sign and approve the files in the browser, so that the operation step of downloading and reopening the files is omitted, and the office work and life are more convenient and less worry.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example" or "some examples" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples described in this specification can be combined and combined by one skilled in the art.

While embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and not to be construed as limiting the present invention, and that changes, modifications and variations may be made therein by those of ordinary skill in the art within the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种合同在线生成方法、装置及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!