Easy operation method for PDF (Portable document Format) file thumbnail on webpage

文档序号:1406154 发布日期:2020-03-06 浏览:8次 中文

阅读说明:本技术 一种在网页上对pdf文件缩略图的易操作方法 (Easy operation method for PDF (Portable document Format) file thumbnail on webpage ) 是由 郑侃炜 吴德有 李洋溢 于 2018-08-10 设计创作,主要内容包括:本发明公开了一种在网页上对PDF文件缩略图的易操作方法,包含以下步骤:A、用户在网页中导入PDF文件;B、把引入的数据流转为PDF缩略图;C、对当前的PDF缩略进行排序及重命名处理;D、对操作之后的PDF缩略图选中某几个缩略图生成字符串。本发明可以对PDF的页面缩略图在保存之前就把想要的页面顺序以图形方式显示出来,易于用户直观判断。同时又增加了删除PDF页面功能,方便了用户快速剔除不需要的PDF页面。在整理完成之后,还可以根据鼠标再次选中的几个缩略图,重新生成一串字符组合,便于程序人员再次编码。在操作上,直接使用鼠标拖动操作,避免了只是输入数字造成对具体操作的PDF页面误输入。从而具有易用性和可操作性,并且大大提高了工作效率。(The invention discloses an easy operation method for a PDF (Portable document Format) file thumbnail on a webpage, which comprises the following steps of: A. a user imports a PDF file in a webpage; B. converting the introduced data stream into a PDF thumbnail; C. sorting and renaming the current PDF thumbnails; D. selecting some thumbnails from the PDF thumbnails after the operation to generate character strings. The invention can display the page sequence of PDF in a graphic mode before saving the page thumbnail, and is easy for users to judge visually. Meanwhile, the PDF page deleting function is added, so that the user can conveniently and quickly remove the unnecessary PDF pages. After finishing the sorting, a string of character combinations can be regenerated according to a plurality of thumbnails selected by the mouse again, so that the programmer can encode the character combinations again conveniently. In operation, the mouse is directly used for dragging operation, so that the error input of the PDF page of specific operation caused by only inputting numbers is avoided. Thereby having easy-to-use and operability, and greatly improving the working efficiency.)

1. An easy operation method for a PDF file thumbnail on a webpage is characterized by comprising the following steps:

a user imports a PDF file in a webpage;

converting the introduced data stream into a PDF thumbnail;

sorting and renaming the current PDF thumbnails;

selecting some thumbnails from the PDF thumbnails after the operation to generate character strings.

2. The method of claim 1, wherein the step A is specifically that ① uses JS page rendering method render View, the import parameters include filename, file number, PDF temporary variable, PDF count variable, view mode, ② set dimension variables of width of 130/PDF page file and height of 130/PDF page file, ③ generates canvas of PDF file, ④ accumulates page count parameter if the view mode is page mode, ⑤ other function part codes, ⑥ shows page number using html hypertext markup language, page index, and adds a button for deletion or not.

3. An easy operation method for the PDF file thumbnail on the webpage as recited in claim 1, wherein the step B comprises 2 methods: the first method is to convert the current data stream JS into a PDF object and convert the PDF object into a thumbnail, and the second method is to display the processed thumbnail on a webpage according to the canvas function of the html5 browser.

4.① get thumbnail object through JS plug-in pdf.js, ② sets the width and height of the thumbnail, ③ displays this thumbnail on top of canvas using HTML hypertext markup language, ④ resets the width and height of canvas while setting the page count attribute of canvas, ⑤ adds other thumbnails, ⑥ sets the serial number of canvas using HTML hypertext markup language.

5.① get thumbnail object through JS plug-in pdf.js, ② sets the width and height of the thumbnail, ③ displays this thumbnail on top of canvas using HTML hypertext markup language, ④ resets the width and height of canvas while setting the page count attribute of canvas, ⑤ adds other thumbnails, ⑥ sets the serial number of canvas using HTML hypertext markup language.

6. The easy-to-operate method for the PDF file thumbnail on the webpage as claimed in claim 1, wherein the step C specifically comprises ① setting sorting function parameters such as delay variable, list type, opacity of canvas, whether to update or not, ② obtaining the canvas information selected by a mouse through a JS plugin pdftool.js, ③ moving the mouse to obtain a new canvas position, resetting canvas serial number, ④ obtaining the selected canvas information through HTML hypertext markup language, and ⑤ renaming PDF page serial numbers in the selected canvas in sequence.

7. The method as claimed in claim 1, wherein the step D comprises ① obtaining canvas information that "mouse has selected", entering temporary variables, ② extracting file number information and page number information in the canvas information, ③ arranging character strings from front to back in a manner of "file introduction sequence number-page number of the current file where the PDF page is located", separating the character strings with commas in between, placing the separated character strings in the text1 control of HTML for reprogramming, ④ extracting information from front to back of all "canvas, extracting file number information and page number information in the canvas information, ⑤ character string combination method is similar to the above ③, placing the extracted character strings in text2 control of HTML for reprogramming.

Technical Field

The invention relates to a file processing technology, in particular to an easy operation method for a PDF (Portable document Format) file thumbnail on a webpage.

Background

Disclosure of Invention

The invention aims to provide an easy operation method for a PDF file thumbnail on a webpage, so as to solve the problems in the background technology.

In order to achieve the purpose, the invention provides the following technical scheme:

an easy operation method for a PDF file thumbnail on a webpage comprises the following steps:

A. a user imports a PDF file in a webpage;

B. converting the introduced data stream into a PDF thumbnail;

C. sorting and renaming the current PDF thumbnails;

D. selecting some thumbnails from the PDF thumbnails after the operation to generate character strings.

As a further technical scheme of the invention: the step B comprises 2 methods: the first method is to convert the current data stream JS into a PDF object and convert the PDF object into a thumbnail, and the second method is to display the processed thumbnail on a webpage according to the canvas function of the html5 browser.

① obtains the thumbnail object through JS plug-in pdf.js, ② sets the width and height of the thumbnail, ③ displays the thumbnail on a canvas by using HTML hypertext markup language, ④ resets the width and height of the canvas, sets the page count attribute of the canvas at the same time, ⑤ adds other thumbnails, ⑥ sets the serial number of the canvas by using HTML hypertext markup language.

As a further technical solution of the invention, the method for easy operation of the thumbnail of the PDF file on the webpage as claimed in claim 3 is characterized in that the second method comprises the following steps of ① obtaining the thumbnail object through a JS plug-in pdf.js, ② setting the width and the height of the thumbnail, ③ displaying the thumbnail on a canvas by using HTML hypertext markup language, ④ resetting the width and the height of the canvas while setting the page count attribute of the canvas, ⑤ adding other thumbnails, ⑥ setting the serial number of the canvas by using HTML hypertext markup language.

The method comprises the following specific steps that ① obtains a thumbnail object through a JS plug-in pdf.js, ② sets the width and the height of the thumbnail, ③ displays the thumbnail on a canvas by using HTML hypertext markup language, ④ resets the width and the height of the canvas, simultaneously sets a page count attribute of the canvas, ⑤ adds other thumbnails, and ⑥ sets the serial number of the canvas by using HTML hypertext markup language.

The step C specifically comprises ① setting sequencing function parameters such as delay variable, list type, opaqueness of canvas, whether to update and the like, ② obtaining information of the canvas which is selected by a mouse through JS plugin pdftool.js, ③ moving the mouse to obtain a new position of the canvas, resetting the sequence number of the canvas, ④ obtaining information of the selected canvas through HTML, and ⑤ renaming the sequence numbers of PDF pages in the selected canvas in sequence.

The step D concretely comprises ① obtaining canvas information which is selected by a mouse, sending a temporary variable, ② extracting file sequence number information and page number information in the canvas information, ③ arranging character strings from front to back in a mode of ' file introduction sequence number-page number of a current file where a PDF page is located ', separating the character strings by commas in the middle, putting the character strings into a text1 control of an HTML hypertext markup language for reprogramming, ④ extracting information of all ' canvas from front to back, extracting file sequence number information and page number information in the canvas information, and putting the canvas information into the text2 control of the HTML hypertext markup language for reprogramming by a method of combining ⑤ character strings similar to ③ above.

Compared with the prior art, the invention has the beneficial effects that: the invention can display the page sequence of PDF in a graphic mode before saving the page thumbnail, and is easy for users to judge visually. Meanwhile, the PDF page deleting function is added, so that the user can conveniently and quickly remove the unnecessary PDF pages. After finishing the sorting, a string of character combinations can be regenerated according to a plurality of thumbnails selected by the mouse again, so that the programmer can encode the character combinations again conveniently. In operation, the mouse is directly used for dragging operation, so that the error input of the PDF page of specific operation caused by only inputting numbers is avoided. Thereby having easy-to-use and operability, and greatly improving the working efficiency.

Drawings

FIG. 1 is a flow chart of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in 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.

Referring to fig. 1, an easy-to-operate method for a PDF file thumbnail on a web page includes the following steps:

A. user imports PDF file in webpage

The web page is designed using any web page design tool. The main information that the webpage needs to display is as follows: the function button "import file" is attached with other explanatory words. This section requires the browser to support the canvas function of hypertext markup language html 5.

① for supporting IE browser, it needs to introduce javascript plug-in excancas

② the user uses the mouse to click on the 'import file' to import the PDF file from the webpage end to the browser by the JS code, wherein the current file is converted into the data stream mainly by the plug-in webplug.

③ sets a variable to count the number of files currently being imported.

④ use style definitions for each imported file separately, and record the flag code and size of each file.

⑤ other functional part codes.

⑥ sets the system state to wait.

B. Converting incoming data streams into PDF thumbnails

⑴, converting the current data stream JS into a PDF object, and converting the PDF object into a thumbnail:

① render View using JS page rendering method, the import parameters include file name, file number, PDF temporary variable, PDF count variable, view mode, etc.

② setting dimension variables of 130/PDF page file width and 130/PDF page file height

③ generate a canvas of PDF files.

④ if the view mode is page mode, the page count parameter is accumulated.

⑤ other functional part codes.

⑥ the page number and page index are shown by using html hypertext markup language, and a button for deleting is added.

⑵ according to the canvas function of html5 browser (browser supporting this function, current mainstream new version browser such as IE9 and Google latest version browser), the processed thumbnail is displayed on the web page:

① get to the thumbnail object through the JS plug-in pdf.

② sets the width and height of the thumbnail.

③ displays this thumbnail on top of a canvas using the HTML hypertext markup language.

④ resets the width and height of the canvas while setting the page count attribute of the canvas.

⑤ add other thumbnails.

⑥ the canvas is ordered using html hypertext markup language.

C. Sorting and renaming current PDF thumbnails

⑴, the current PDF thumbnail is sorted, and mouse operation is supported:

① sets the sort function parameters delay variable, list type, opacity of the canvas, whether to update, etc.

② get the canvas information that has been selected by the mouse through the JS plugin pdftool.

③ move the mouse to a new canvas position, resetting the canvas sequence number.

⑵ rename part:

① get the selected canvas information through HTML hypertext markup language.

② rename the PDF page number in the selected canvas.

D. Selecting a plurality of thumbnails to generate character strings for the PDF thumbnails after operation

For the displayed PDF thumbnail, a new character string can be formed after the PDF thumbnail is clicked again by a mouse, so that a programmer can develop the PDF thumbnail again conveniently:

① obtains the canvas information of "mouse has been selected" and sends it to the temporary variable.

② extracts the file number information and page number information in the canvas information.

③ arranging character strings from front to back in a mode of 'document introduction serial number-PDF page current document page number', separating the character strings by commas in the middle, and putting the character strings into a text1 control of HTML hypertext markup language for reprogramming.

④ extracts the information from the front to the back of all the canvas, and the file number information and page number information in the canvas information.

⑤ the string combination method is similar to ③ above, and is put into the text2 control of HTML hypertext markup language for reprogramming.

The working principle of the invention is as follows: the design provides a method for directly displaying PDFs on a webpage as thumbnails without storing PDF pages as pictures, and meanwhile, the operations of moving, deleting, holding and dragging a mouse and the like can be performed on different PDFs of a plurality of files. Therefore, the quick operation judgment of opening the PDF file by the user is improved, and meanwhile, the working efficiency of the system is improved as the picture does not need to be stored additionally and then is introduced again. PDF thumbnails of different files can be moved, and can be combined into a new PDF file or a PDF page is deleted, so that more practical operations are provided. Therefore, the working efficiency of the computer system is improved, more operation possibilities are provided for a user to process a plurality of PDF files or a single PDF file again, and the efficiency of rearranging the PDF files is improved.

It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:智能化工程招标代理系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!