CN113238720A - Implementation method for directly printing pdf file on page without plug-in - Google Patents

Implementation method for directly printing pdf file on page without plug-in Download PDF

Info

Publication number
CN113238720A
CN113238720A CN202110342100.2A CN202110342100A CN113238720A CN 113238720 A CN113238720 A CN 113238720A CN 202110342100 A CN202110342100 A CN 202110342100A CN 113238720 A CN113238720 A CN 113238720A
Authority
CN
China
Prior art keywords
processor
iframe
page
plug
pdf
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
CN202110342100.2A
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.)
Unicloud Technology Co Ltd
Original Assignee
Unicloud Technology 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 Unicloud Technology Co Ltd filed Critical Unicloud Technology Co Ltd
Priority to CN202110342100.2A priority Critical patent/CN113238720A/en
Publication of CN113238720A publication Critical patent/CN113238720A/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/1203Improving or facilitating administration, e.g. print management
    • G06F3/1204Improving or facilitating administration, e.g. print management resulting in reduced user or operator actions, e.g. presetting, automatic actions, using hardware token storing data
    • 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/1253Configuration of print job parameters, e.g. using UI at the client
    • 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/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/128Direct printing, e.g. sending document file, using memory stick, printing from a camera

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a realization method for directly printing a pdf file on a page without a plug-in, which comprises the following steps: s1, checking the legality of the parameters, and prompting the user if the parameters are not legal; s2, testing whether the Adobe Reader is installed in the current environment or not, and if not, prompting a user; s3, creating an iframe and setting the iframe to be invisible; s4, writing an HTML structure of the iframe; s5, adding the iframe in the S4 into the body. The invention has the beneficial effects that: the implementation method for directly printing the pdf file on the page without the plug-in is suitable for an ie browser, is convenient to call, is transparent to a user, enables system operation to be smoother, increases friendliness and does not depend on other js plug-ins.

Description

Implementation method for directly printing pdf file on page without plug-in
Technical Field
The invention belongs to the technical field of information, and particularly relates to a method for directly printing a pdf file on a page without a plug-in.
Background
The technical scheme of the invention is to solve the problem that in a B/S system, if a PDF file needs to be printed, the PDF file needs to be previewed or downloaded first and then the printing is executed, and the demand that a printer can be directly called to print the PDF file on a page is often required for keeping the uniformity and the integrity of system operation.
Disclosure of Invention
In view of the above, the present invention is directed to a method for directly printing a pdf document on a page without a plug-in, so as to solve the above-mentioned disadvantages.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a realization method for directly printing a pdf file on a page without a plug-in comprises the following steps:
s1, checking the legality of the parameters, and prompting the user if the parameters are not legal;
s2, testing whether the Adobe Reader is installed in the current environment or not, and if not, prompting a user;
s3, creating an iframe and setting the iframe to be invisible;
s4, writing an HTML structure of the iframe;
s5, adding the iframe in the S4 into the body.
Further, in steps S3 and S4, an iframe is created and set to be invisible, the HTML structure of the iframe is written, there is mainly a registered object, the PDF address in the parameter is assigned to the object, the onload event of the body is set to call PDF print event, the iframe is added to the body, and the program will automatically call the printer to start printing after the PDF loading is completed.
In a second aspect, the present disclosure discloses an electronic device, which includes a processor and a memory, wherein the memory is communicatively connected to the processor and is configured to store executable instructions of the processor, and the processor is configured to execute the implementation method for directly printing a pdf file on a page without a plug-in according to the first aspect.
In a third aspect, the present disclosure discloses a server, which includes at least one processor, and a memory communicatively connected to the processor, where the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to cause the at least one processor to execute the method for implementing direct printing of a pdf file on a page without plug-in according to the first aspect.
In a fourth aspect, the present disclosure discloses a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the implementation method for directly printing a pdf file on a page without a plug-in according to the first aspect is implemented.
Compared with the prior art, the implementation method for directly printing the pdf file on the page without plug-in has the following beneficial effects:
the implementation method for directly printing the pdf file on the page without the plug-in is applicable to an ie browser, is convenient to call, is transparent to a user, enables the system operation to be smoother, increases the friendliness and does not depend on other js plug-ins.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic diagram of an implementation method for directly printing a pdf file on a page without a plug-in according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, an implementation method for directly printing a pdf file on a page without a plug-in includes the following steps:
s1, checking the legality of the parameters, and prompting the user if the parameters are not legal;
s2, testing whether the Adobe Reader is installed in the current environment or not, and if not, prompting a user;
s3, creating an iframe and setting the iframe to be invisible;
s4, writing an HTML structure of the iframe;
s5, adding the iframe in the S4 into the body.
In steps S3 and S4, an iframe is created and set to be invisible, the HTML structure of the iframe is written, there is mainly a registered object, the PDF address in the parameter is assigned to this object, the onload event of the body is set to call PDF print event, this iframe is added to the body, and the program will automatically call the printer to start printing after the PDF loading is completed.
In a second aspect, the present disclosure discloses an electronic device, which includes a processor and a memory, wherein the memory is communicatively connected to the processor and is configured to store executable instructions of the processor, and the processor is configured to execute the implementation method for directly printing a pdf file on a page without a plug-in according to the first aspect.
In a third aspect, the present disclosure discloses a server, which includes at least one processor, and a memory communicatively connected to the processor, where the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to cause the at least one processor to execute the method for implementing direct printing of a pdf file on a page without plug-in according to the first aspect.
In a fourth aspect, the present disclosure discloses a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the implementation method for directly printing a pdf file on a page without a plug-in according to the first aspect is implemented.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of clearly illustrating the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed method and system may be implemented in other ways. For example, the above described division of elements is merely a logical division, and other divisions may be realized, for example, multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not executed. The units may or may not be physically separate, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (5)

1. A realization method for directly printing a pdf file on a page without a plug-in is characterized by comprising the following steps:
s1, checking the legality of the parameters, and prompting the user if the parameters are not legal;
s2, testing whether the Adobe Reader is installed in the current environment or not, and if not, prompting a user;
s3, creating an iframe and setting the iframe to be invisible;
s4, writing an HTML structure of the iframe;
s5, adding the iframe in the S4 into the body.
2. The method of claim 1, wherein the method for directly printing the pdf document on the page without plug-in comprises: in steps S3 and S4, an iframe is created and set to be invisible, the HTML structure of the iframe is written, there is mainly a registered object, the PDF address in the parameter is assigned to this object, the onload event of the body is set to call PDF print event, this iframe is added to the body, and the program will automatically call the printer to start printing after the PDF loading is completed.
3. An electronic device comprising a processor and a memory communicatively coupled to the processor and configured to store processor-executable instructions, wherein: the processor is configured to perform the method of any one of claims 1-2 as described above for directly printing a pdf document on a page without an add-in.
4. A server, characterized by: comprising at least one processor and a memory communicatively coupled to the processor, the memory storing instructions executable by the at least one processor, the instructions being executable by the processor to cause the at least one processor to perform a method of implementing direct printing of a pdf document on a page without a plug-in according to any of claims 1-2.
5. A computer-readable storage medium storing a computer program, characterized in that: the computer program when executed by a processor implements a method of implementing direct printing of a pdf document on a page without a plug-in according to any of claims 1-2.
CN202110342100.2A 2021-03-30 2021-03-30 Implementation method for directly printing pdf file on page without plug-in Pending CN113238720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110342100.2A CN113238720A (en) 2021-03-30 2021-03-30 Implementation method for directly printing pdf file on page without plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110342100.2A CN113238720A (en) 2021-03-30 2021-03-30 Implementation method for directly printing pdf file on page without plug-in

Publications (1)

Publication Number Publication Date
CN113238720A true CN113238720A (en) 2021-08-10

Family

ID=77130789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110342100.2A Pending CN113238720A (en) 2021-03-30 2021-03-30 Implementation method for directly printing pdf file on page without plug-in

Country Status (1)

Country Link
CN (1) CN113238720A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116382604A (en) * 2023-05-29 2023-07-04 天翼云科技有限公司 Method, system, storage medium and equipment for printing PDF (portable document format) file on webpage

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749997A (en) * 2004-09-15 2006-03-22 佳能株式会社 Embedded device, control method therefor, program for implementing the control method, and storage medium
CN103999028A (en) * 2011-05-23 2014-08-20 微软公司 Invisible control
CN104714766A (en) * 2015-03-12 2015-06-17 福建工程学院 Method for direct printing in WEB report browser
CN109343804A (en) * 2018-09-28 2019-02-15 江苏中服焦点信息科技有限公司 A kind of method of printing template
CN110347349A (en) * 2019-05-21 2019-10-18 平安银行股份有限公司 The method, apparatus and computer equipment of specified content are printed in browser
CN110851092A (en) * 2019-11-15 2020-02-28 厦门商集网络科技有限责任公司 Customized printing method and system based on printing template under B/S framework

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749997A (en) * 2004-09-15 2006-03-22 佳能株式会社 Embedded device, control method therefor, program for implementing the control method, and storage medium
CN103999028A (en) * 2011-05-23 2014-08-20 微软公司 Invisible control
CN104714766A (en) * 2015-03-12 2015-06-17 福建工程学院 Method for direct printing in WEB report browser
CN109343804A (en) * 2018-09-28 2019-02-15 江苏中服焦点信息科技有限公司 A kind of method of printing template
CN110347349A (en) * 2019-05-21 2019-10-18 平安银行股份有限公司 The method, apparatus and computer equipment of specified content are printed in browser
CN110851092A (en) * 2019-11-15 2020-02-28 厦门商集网络科技有限责任公司 Customized printing method and system based on printing template under B/S framework

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑秀琴等: "B/S模式MIS中报表打印方法研究", 《计算机与现代化》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116382604A (en) * 2023-05-29 2023-07-04 天翼云科技有限公司 Method, system, storage medium and equipment for printing PDF (portable document format) file on webpage
CN116382604B (en) * 2023-05-29 2023-10-10 天翼云科技有限公司 Method, system, storage medium and equipment for printing PDF (portable document format) file on webpage

Similar Documents

Publication Publication Date Title
CN108038134B (en) Page display method and device, storage medium and electronic equipment
CN107943426B (en) Document paging printing method, document paging printing system and computer device
CN107092625B (en) Data configuration method, data processing method and device
JP6115515B2 (en) Printer driver and prohibition processing method of printer driver
CN110674619A (en) Online document editing method, device, equipment and computer storage medium
CN113238720A (en) Implementation method for directly printing pdf file on page without plug-in
CN108109187A (en) E-seal generation method, device and electronic equipment
CN112116325A (en) Examination and approval form control method and device, electronic equipment and readable storage medium
CN109145242A (en) The online sharing method of office documents, system and computer readable storage medium
CN107977410B (en) Bookshelf management method based on electronic book application and electronic equipment
CN109388465A (en) Method for drafting, device, computer equipment and the readable storage medium storing program for executing of view control
US6574001B2 (en) Managing font data in a print job
US20130007580A1 (en) Optimizing the layout of electronic documents
US10733355B2 (en) Information processing system that stores metrics information with edited form information, and related control method information processing apparatus, and storage medium
JP5885702B2 (en) Image forming apparatus and web page language adding method
CN111552447B (en) Printing method and system
US11334302B1 (en) Methods and systems for indicating and replacing missing element(s) in print job files prior to printing
US20150186758A1 (en) Image processing device
CN112199056B (en) Data printing method, device and computer storage medium
US20150373118A1 (en) Cloud off-ramp management
CN111078257B (en) H5 application package loading method and related device
CN112148230B (en) Printing method, system, device and storage medium thereof
CN109359384B (en) Method and device for calling silk-screen mark into printed circuit board
US10481844B2 (en) Data communication method and information processing apparatus having multiple print settings
US20140016150A1 (en) System and method to store embedded fonts

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210810

RJ01 Rejection of invention patent application after publication