CN114442966A - One-key printing method for electronic file based on domestic CPU and operating system - Google Patents

One-key printing method for electronic file based on domestic CPU and operating system Download PDF

Info

Publication number
CN114442966A
CN114442966A CN202210069971.6A CN202210069971A CN114442966A CN 114442966 A CN114442966 A CN 114442966A CN 202210069971 A CN202210069971 A CN 202210069971A CN 114442966 A CN114442966 A CN 114442966A
Authority
CN
China
Prior art keywords
height
files
plug
file
electronic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210069971.6A
Other languages
Chinese (zh)
Inventor
李春龙
董桂森
王威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN202210069971.6A priority Critical patent/CN114442966A/en
Publication of CN114442966A publication Critical patent/CN114442966A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1211Improving printing performance
    • G06F3/1215Improving printing performance achieving increased printing speed, i.e. reducing the time between printing start and printing end
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/125Page layout or assigning input pages onto output media, e.g. imposition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an electronic file one-key printing method based on a domestic CPU and an operating system, which belongs to the technical field of printing.

Description

One-key printing method for electronic file based on domestic CPU and operating system
Technical Field
The invention relates to the technical field of electronic file display technology, file screenshot technology and picture printing, in particular to a one-key printing method of an electronic file based on a domestic CPU and an operating system.
Background
With the development of electronic government affairs, the application of the online office system is more and more popular and deeper. Although the development and application of the office system on the internet are finally aimed at realizing paperless office, the real administrative system still has quite high requirements on the output printing of the official documents and the paper document management, so the printing of the official documents cannot be avoided.
In a home environment, the format of an electronic file generally includes files in multiple formats, such as an Office format file, a PDF format file, an OFD format file, a picture, a text format file, and the like, and when the files in the formats are printed, the files are usually opened by object plug-ins corresponding to the files, and then the printing method of the plug-ins is called to print the files. Because the electronic file formats are various and a plurality of plug-ins are required to be called to open and print the file, the processing of only one file basically can be realized, so that the operation is frequent and the efficiency is low. For electronic files with a large number of pages and a large content, the printer often crashes and printing is interrupted due to the memory limitation of the printer during printing.
An electronic official document generally comprises contents such as a text, an attachment, an associated file, a leader indicating part, a signing list, a sample clearing manuscript and the like, the types of the files are various, the number of the files is not fixed, if one electronic official document is printed, the printing is complicated, the speed is limited, and a method for rapidly completing one-key printing is urgently needed.
Disclosure of Invention
In order to solve the technical problems, the invention provides an electronic file one-key printing method based on a domestic CPU and an operating system.
The technical scheme of the invention is as follows:
a one-key printing method for electronic files based on a domestic CPU and an operating system comprises the steps of carrying out picture interception on the electronic files displayed in a browser through a MindShot plug-in, then loading the intercepted pictures by using img elements, and finally printing the pictures.
Further, in the above-mentioned case,
when the electronic files are printed, firstly, according to the sequence of selecting the files to be printed, the electronic files are opened through the plug-in corresponding to each electronic file, the displayed files are subjected to scroll bar elimination, then, the electronic files are subjected to screenshot through the MindShot plug-in to form pictures with the size of A4, after all the electronic files are subjected to screenshot, the pictures are stored in img elements, the pictures are sequentially printed, and the one-key printing operation is completed
Further, in the above-mentioned case,
when different electronic files are printed, the files are displayed on the browser through corresponding plug-ins or elements according to the file conditions, the width OF each plug-in is set to be (A4_ W + OF _ W) (RANDOM +1) millimeter, and the height OF each plug-in is set to be A4_ H + OF _ H _ 2+ OF _ BTN _ H millimeter.
For the picture file, the picture is shown using img elements, and the width of the elements is set to a height of a4_ W mm, the height is set to a4_ H mm, and the style attribute is set to width auto; height: auto; max-width is 100%; max-height: 100% to achieve picture scaling to within the A4 paper size range.
Further, in the above-mentioned case,
when different electronic files are printed, for the condition that the electronic files have more than one page, whether the electronic files have scroll bars or not is judged by monitoring the colors OF the right area OF the element, and then the purpose OF eliminating the scroll bars step by step is achieved by increasing the heights OF the plug-ins A4_ H + OF _ H2 mm page by page.
The method comprises the steps that the position and the height OF an element for displaying an electronic file are sent to a MindShot plug-in through a JS function, the plug-in scans the width and the height OF the element OF the SCRBAR _ W pixel on the right side OF the element, if an area with the color values OF a continuous area being # C1C1C1 exists, the situation that a scroll bar occurs due to the fact that the number OF pages OF the file is large is shown, the JS function is called at the moment to heighten the height OF the element to eliminate the scroll bar, the height OF A4_ H + OF _ H2 mm is increased when one page is increased, scroll bar verification and height are carried out according to the steps again after the height is increased every time, and the situation that the scroll bar cannot exist is monitored.
Further, in the above-mentioned case,
when the electronic file is subjected to screenshot, the screenshot is performed from (OBJ _ W-A4_ W)/2 mm to the right and from OF _ H + OF _ BTN _ H mm downwards by taking the upper left OF the element as a base point, and all the intercepted pictures are pictures with the size OF A4 paper.
When the picture file is subjected to screenshot, the upper left corner of the element is used as an initial coordinate, and screenshot is performed according to the size of A4, namely, A4_ W mm is cut rightwards, and A4_ H mm is cut downwards.
The invention has the advantages that
(1) The invention provides a one-key printing method of an electronic file based on a domestic CPU and an operating system, which solves the problems of complicated operation steps, long printing time and easy halt of a printer during printing of the electronic file and improves the office efficiency.
(2) The invention fully considers the compatibility of different homemade operating systems and browsers under the environment of nationwide hardware and software.
(3) The invention provides a thought for converting electronic files with different formats into pictures in a browser, and the pictures have the advantages of strong editability, small files and multiple application scenes, so that the thought can be applied to scenes in which plug-ins cannot be called to display electronic documents, such as document filing, electronic file display at a mobile phone end and the like.
Drawings
FIG. 1 is a schematic diagram of electronic file format classification;
fig. 2 is a schematic diagram of a one-key printing process of an electronic file.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
The invention provides an electronic file one-key printing method based on a domestic CPU and an operating system, which comprises the following specific working procedures:
(1) electronic document classification
The method can only print files which can be normally displayed in the browser, such as Office files, PDF files, OFD files, pictures, text files and other common electronic files, and the files which do not need to be printed and cannot be printed, such as compressed packets, audio and video files and the like, are out of the consideration range of the method.
(2) Electronic document presentation
For files which can be normally displayed in the browser, the method calls corresponding methods to display the electronic files in the browser according to different electronic file types.
For Office files and text files, the files are displayed on a browser by calling a Jinshan or Yongzhong plug-in interface, for PDF files, the files are displayed on the browser by iframe elements, and for OFD files, the files are displayed on the browser by a format reader such as Digital department or FuXin. After the browser display is finished, the height and the width of a container bearing the file are set according to the following algorithm, so that the effect that the file with only one page does not have transverse and longitudinal scroll bars is achieved.
Width: (A4_ W + OF _ W) (RANDOM +1) mm
Height: a4_ H + OF _ H × 2+ OF _ BTN _ H mm
For the picture file, the picture is shown using img elements, and the width of the elements is set to a height of a4_ W mm, the height is set to a4_ H mm, and the style attribute is set to width auto; height: auto; max-width is 100%; max-height: 100% to achieve picture scaling to within A4 paper size.
(3) Vertical scroll bar elimination
For Office files, PDF files, OFD files and text files, after the files are displayed on a browser, only one page of the preset files is provided, actually, the number of pages of the files is not fixed, when the number of pages is larger than one page, a scroll bar is inevitably generated during display, and if the scroll bar is cut into the files during screenshot, the scroll bar is also generated on the printed files, so that the scroll bar needs to be eliminated. The method comprises the steps that the position and the height OF an element for displaying an electronic file are sent to a MindShot plug-in through a JS function, the plug-in scans the width and the height OF the element OF the SCRBAR _ W pixel on the right side OF the element, if an area with the color values OF a continuous area being # C1C1C1 exists, the situation that a scroll bar occurs due to the fact that the number OF pages OF the file is large is shown, the JS function is called at the moment to heighten the height OF the element to eliminate the scroll bar, the height OF A4_ H + OF _ H2 mm is increased when one page is increased, scroll bar verification and height are carried out according to the steps again after the height is increased every time, and the situation that the scroll bar cannot exist is monitored.
(4) Electronic document picture interception
After eliminating the scroll bar of the electronic file, calling a JS function, obtaining the position, width OBJ _ W and height OBJ _ H of the plug-in or the element, and capturing the picture of the element by using a MindShot plug-in. For Office files, PDF files, OFD files and text files, during screenshot, during the first screenshot, taking the upper left corner OF an element as a base point, starting from (OBJ _ W-A4_ W)/2 mm to the right, and starting screenshot from OF _ H + OF _ BTN _ H mm downwards as an initial coordinate, during screenshot, screenshot according to the size OF A4 paper, namely, intercepting A4_ W mm to the right, intercepting A4_ H mm downwards to obtain a complete picture, when the second page is intercepted, firstly moving downwards by the height OF OF _ H2 mm, avoiding the middle blank OF the two pages, then screenshot according to the mode OF the first page, and so on until the screenshot is finished.
When the picture file is subjected to screenshot, the upper left corner of the element is used as an initial coordinate, and screenshot is performed according to the size of A4, namely, A4_ W mm is cut rightwards, and A4_ H mm is cut downwards.
(4) Document printing
And sequentially loading the intercepted pictures into the printing img elements according to the intercepting sequence, and then calling a printer to print.
The above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A one-key printing method of electronic file based on domestic CPU and operation system is characterized by that,
and carrying out picture interception on the electronic file displayed in the browser through a MindShot plug-in, then loading the intercepted picture by using an img element, and finally printing the picture.
2. The method of claim 1,
when the electronic files are printed, the electronic files are opened through the plug-ins corresponding to the electronic files according to the sequence of the selected files to be printed, and the displayed files are subjected to scroll bar elimination processing.
3. The method of claim 2,
and (4) screenshot is carried out on the electronic files to form a picture with the size of A4, after all electronic files are completely screenshot, the pictures are stored in img elements and are sequentially printed, and the one-key printing operation is completed.
4. The method of claim 3,
when different electronic files are printed, the files are displayed on the browser through corresponding plug-ins or elements according to the file conditions, the width OF each plug-in is set to be (A4_ W + OF _ W) (RANDOM +1) millimeter, and the height OF each plug-in is set to be A4_ H + OF _ H _ 2+ OF _ BTN _ H millimeter.
5. The method of claim 4,
for the picture file, the picture is shown using img elements, and the width of the elements is set to a height of a4_ W mm, the height is set to a4_ H mm, and the style attribute is set to width auto; height: auto; max-width is 100%; max-height: 100% to achieve picture scaling to within A4 paper size.
6. The method of claim 5,
when different electronic files are printed, for the condition that the electronic files have more than one page, whether the electronic files have scroll bars or not is judged by monitoring the colors OF the right area OF the element, and then the purpose OF eliminating the scroll bars step by step is achieved by increasing the heights OF the plug-ins A4_ H + OF _ H2 mm page by page.
7. The method of claim 6,
the method comprises the steps that the position and the height OF an element for displaying an electronic file are sent to a MindShot plug-in through a JS function, the plug-in scans the width and the height OF the element OF the SCRBAR _ W pixel on the right side OF the element, if an area with the color values OF a continuous area being # C1C1C1 exists, the situation that a scroll bar occurs due to the fact that the number OF pages OF the file is large is shown, the JS function is called at the moment to heighten the height OF the element to eliminate the scroll bar, the height OF A4_ H + OF _ H2 mm is increased when one page is increased, scroll bar verification and height are carried out according to the steps again after the height is increased every time, and the situation that the scroll bar cannot exist is monitored.
8. The method of claim 6,
when the electronic file is subjected to screenshot, the screenshot is performed from (OBJ _ W-A4_ W)/2 mm to the right and from OF _ H + OF _ BTN _ H mm downwards by taking the upper left OF the element as a base point, and all the intercepted pictures are pictures with the size OF A4 paper.
9. The method of claim 6,
when the picture file is subjected to screenshot, the upper left corner of the element is used as an initial coordinate, and screenshot is performed according to the size of A4, namely, A4_ W mm is cut rightwards, and A4_ H mm is cut downwards.
CN202210069971.6A 2022-01-21 2022-01-21 One-key printing method for electronic file based on domestic CPU and operating system Pending CN114442966A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210069971.6A CN114442966A (en) 2022-01-21 2022-01-21 One-key printing method for electronic file based on domestic CPU and operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210069971.6A CN114442966A (en) 2022-01-21 2022-01-21 One-key printing method for electronic file based on domestic CPU and operating system

Publications (1)

Publication Number Publication Date
CN114442966A true CN114442966A (en) 2022-05-06

Family

ID=81367087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210069971.6A Pending CN114442966A (en) 2022-01-21 2022-01-21 One-key printing method for electronic file based on domestic CPU and operating system

Country Status (1)

Country Link
CN (1) CN114442966A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100031784A (en) * 2008-09-11 2010-03-25 주식회사 디자인메이드 Method for printing a captured screen of web pages
CN104461412A (en) * 2014-12-30 2015-03-25 广州视源电子科技股份有限公司 Web page designated area printing method and system
CN106648481A (en) * 2016-12-28 2017-05-10 珠海赛纳打印科技股份有限公司 Processing method and device and printing control method and device
CN108897502A (en) * 2018-05-29 2018-11-27 安徽天斯努信息技术股份有限公司 A kind of intelligent cloud print controling terminal monitored

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100031784A (en) * 2008-09-11 2010-03-25 주식회사 디자인메이드 Method for printing a captured screen of web pages
CN104461412A (en) * 2014-12-30 2015-03-25 广州视源电子科技股份有限公司 Web page designated area printing method and system
CN106648481A (en) * 2016-12-28 2017-05-10 珠海赛纳打印科技股份有限公司 Processing method and device and printing control method and device
CN108897502A (en) * 2018-05-29 2018-11-27 安徽天斯努信息技术股份有限公司 A kind of intelligent cloud print controling terminal monitored

Similar Documents

Publication Publication Date Title
CN100517372C (en) Image forming apparatus that automatically creates an index and a method thereof
US20120011429A1 (en) Image processing apparatus and image processing method
US9398191B2 (en) Electronic document generation system, electronic document generation apparatus, and recording medium
US7145676B2 (en) Compound document image compression using multi-region two layer format
CN1303517C (en) Image processing apparatus, image processing method and computer program
JP2009081707A (en) Image processing device, image forming device, image processing method, image processing program, and recording medium
CN110536040B (en) Image processing apparatus for performing multi-cropping processing, method of generating image, and medium
US20100158410A1 (en) Image processing apparatus, image processing method and computer-readable storage medium
CN101127819A (en) A method and device for image transmission
KR20080018396A (en) Computer-readable medium for recording mobile application and personal computer application for displaying display information of mobile communications terminal in external display device
US20120250101A1 (en) Image processing device
US8195626B1 (en) Compressing token-based files for transfer and reconstruction
CN113033165B (en) Method, device and computer readable storage medium for analyzing electronic form file
US6163625A (en) Hybrid image compressor
JP2004040784A (en) Image scan processing system, image scan processing method, and selection method of master file composed of scanned image encoded data
US8320668B2 (en) Image processing apparatus and image processing method
US20120250102A1 (en) Controlling device for controlling scan performing unit
Ávila et al. A new algorithm for removing noisy borders from monochromatic documents
JP5182902B2 (en) Document image output device
US10609249B2 (en) Scanner and scanning control program which outputs an original image and an extracted image in a single file
CN114442966A (en) One-key printing method for electronic file based on domestic CPU and operating system
CN106488074B (en) Image processing apparatus and electronic document generation method
Ávila et al. Efficient removal of noisy borders from monochromatic documents
JP2013020477A (en) Image processing apparatus and program
CN112291588A (en) Display content sharing method and device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination