CN110347349A - The method, apparatus and computer equipment of specified content are printed in browser - Google Patents
The method, apparatus and computer equipment of specified content are printed in browser Download PDFInfo
- Publication number
- CN110347349A CN110347349A CN201910422696.XA CN201910422696A CN110347349A CN 110347349 A CN110347349 A CN 110347349A CN 201910422696 A CN201910422696 A CN 201910422696A CN 110347349 A CN110347349 A CN 110347349A
- Authority
- CN
- China
- Prior art keywords
- printed
- content
- label
- browser
- mentioned
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1203—Improving or facilitating administration, e.g. print management
- G06F3/1206—Improving or facilitating administration, e.g. print management resulting in increased flexibility in input data format or job format or job type
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1242—Image or content composition onto a page
- G06F3/1243—Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
Abstract
Present applicant proposes method, apparatus and computer equipment that specified content is printed in a kind of browser, wherein, the method that specified content is printed in above-mentioned browser includes: acquisition print command, and the print command is generated after the content to be printed in the browser current presentation page is acquired;Obtain content to be printed indicated by the print command;Pre-prepd printing template is written into the content to be printed, the printing template realizes that the attribute of the frame tags is hiding by the frame tags in hypertext markup language HTML;Printer is called to print the content to be printed in the printing template by the browser.The application may be implemented when printing to the specified content in the currently browsed page, and content to be printed is separated with the content in current browse webpage, not influence the pattern of the currently browsed page of user, improve user experience.
Description
[technical field]
This application involves method, dresses that specified content is printed in pedestal O&M technical field more particularly to a kind of browser
It sets and computer equipment.
[background technique]
With the development of information technology, enterprise can develop the operation system of oneself to preferably service user, log in
After operation system, user may browse through and use the respective services of enterprise's offer.For example, it is wrapped in the operation system of bank
Including " personal Web bank " this subsystem can be in " personal net after user logs in " personal Web bank " by browser
Go to bank " in the above-mentioned user of inquiry account detail, transfer accounts or buy finance product etc..
It is existing in the related technology, user, can be straight by browser by after the operation system of browser Entry Firm
It connects and printer is called to print the specified content in the currently browsed page, such as: user is logged in " personal by browser
After Web bank ", can in " personal Web bank " printing user account detail.But browser calls directly printing
Machine is printed, and the currently browsed page of user can be made to be rewritten, and causes the currently browsed page of user not to be able to maintain original
Pattern, user experience is poor.
[summary of the invention]
The embodiment of the present application provides the method, apparatus and computer equipment that specified content is printed in a kind of browser, with
It realizes when being printed to the specified content in the currently browsed page, it will be in content and current browse webpage to be printed
Content separation, does not influence the pattern of the currently browsed page of user, improves user experience.
In a first aspect, the embodiment of the present application provides a kind of method for printing specified content in browser, comprising: acquisition is beaten
Print instruction, the print command are generated after the content to be printed in the browser current presentation page is acquired;Obtain institute
State content to be printed indicated by print command;Pre-prepd printing template, the printing is written into the content to be printed
Template realizes that the attribute of the frame tags is hiding by the frame tags in hypertext markup language HTML;By described
Browser calls printer to print the content to be printed in the printing template.
In one of possible implementation, the print command is used to indicate to the browser current presentation page
In content to be printed printed;It is beaten alternatively, the print command is used to indicate to treat according to pre-set configuration information
Print content is printed.
It is described to obtain content to be printed indicated by the print command and include: in one of possible implementation
Content to be printed indicated by the print command, the mark for separating label label are wrapped up by the label label that separates of HTML
Knowing selector is printing content;Through JavaScript order from the html file of the current presentation page, package is obtained
The content to be printed separates label label, and is separated between the beginning label and the end-tag that mark label described in acquisition
HTML。
It is described that pre-prepd printing template packet is written into the content to be printed in one of possible implementation
It includes: according to the mark selector of the frame tags, obtaining the frame tags from the window that the browser is opened, according to
The frame tags obtain pre-prepd printing template;Between the beginning label that will acquire and the end-tag
The printing template is written in HTML.
In one of possible implementation, it is described will the pre-prepd printing template of the content write-in to be printed it
Before, further includes: frame tags are set in the window that the browser is opened;The type of the frame tags is set as not showing
Show, and the mark selector of the frame tags is set.
Second aspect, the embodiment of the present application provide the device that specified content is printed in a kind of browser, comprising: obtain mould
Block, for obtaining print command, the print command is after the content to be printed in the browser current presentation page is acquired
It generates;And obtain content to be printed indicated by the print command;Writing module, for writing the content to be printed
Enter pre-prepd printing template, the printing template is realized by the frame tags in hypertext markup language HTML, described
The attribute of frame tags is hiding;Print module, for calling printer in the printing template by the browser
Content to be printed is printed.
In one of possible implementation, the print command for obtaining module acquisition is used to indicate to the browsing
Content to be printed in the device current presentation page is printed;Alternatively, the print command for obtaining module acquisition is used to indicate
Content to be printed is printed according to pre-set configuration information.
In one of possible implementation, the acquisition module, specifically for separating label label by HTML
Content to be printed indicated by the print command is wrapped up, the mark selector for separating label label is printing content;It is logical
JavaScript order is crossed from the html file of the current presentation page, obtain the package content to be printed separates mark
Remember label, and separates the HTML of label label started between label and end-tag described in acquisition.
In one of possible implementation, the write module, specifically for the mark according to the frame tags
Selector obtains the frame tags from the window that the browser is opened, and is prepared in advance according to frame tags acquisition
Printing template;It will be beaten described in HTML write-in between the beginning label and the end-tag of the acquisition module acquisition
Die plate.
In one of possible implementation, described device further include: setup module, being used for will in the write module
The content to be printed is written before pre-prepd printing template, and frame mark is arranged in the window that the browser is opened
Label;The type of the frame tags is set as not showing, and the mark selector of the frame tags is set.
The third aspect, the embodiment of the present application provide a kind of computer equipment, including memory, processor and are stored in described
It is real when the processor executes the computer program on memory and the computer program that can run on the processor
Now method as described above.
Fourth aspect, the embodiment of the present application provide a kind of non-transitorycomputer readable storage medium, are stored thereon with meter
Calculation machine program, the computer program realize method as described above when being executed by processor.
In above technical scheme, print command is obtained, above-mentioned print command is in the browser current presentation page wait beat
What print content generated after being acquired, content to be printed indicated by above-mentioned print command is then obtained, it will be above-mentioned to be printed interior
Hold and pre-prepd printing template is written, calls printer to be printed in above-mentioned printing template finally by above-mentioned browser
Content is printed, since above-mentioned printing template passes through hypertext markup language (Hypertext Markup Language;With
Lower abbreviation: HTML) in frame (iframe) label realize, so as to realize in specified in the currently browsed page
When appearance is printed, content to be printed is separated with the content in current browse webpage, does not influence the currently browsed page of user
The pattern in face improves user experience.Also, the attribute of above-mentioned iframe label is hiding, therefore is carried out to content to be printed
When printing, printing content page will not be explicitly rendered, whole printing process user's unaware can keep good user's body
It tests.
[Detailed description of the invention]
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached
Figure is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for this field
For those of ordinary skill, without creative efforts, it can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the flow chart that method one embodiment of specified content is printed in the application browser;
Fig. 2 is the flow chart that specified another embodiment of the method for content is printed in the application browser;
Fig. 3 is the flow chart that the method further embodiment of specified content is printed in the application browser;
Fig. 4 is the structural schematic diagram of prediction meanss one embodiment of the application vehicle caseload;
Fig. 5 is the structural schematic diagram of another embodiment of the prediction meanss of the application vehicle caseload;
Fig. 6 is the structural schematic diagram of the application computer equipment one embodiment.
[specific embodiment]
In order to better understand the technical solution of the application, the embodiment of the present application is retouched in detail with reference to the accompanying drawing
It states.
It will be appreciated that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.Base
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall in the protection scope of this application.
The term used in the embodiment of the present application is only to be not intended to be limiting merely for for the purpose of describing particular embodiments
The application.In the embodiment of the present application and the "an" of singular used in the attached claims, " described " and "the"
It is also intended to including most forms, unless the context clearly indicates other meaning.
Fig. 1 is the flow chart that method one embodiment of specified content is printed in the application browser, as shown in Figure 1, on
Stating the method that specified content is printed in browser may include:
Step 101, print command is obtained, above-mentioned print command is the content quilt to be printed in the browser current presentation page
It is generated after obtaining.
In a kind of implementation, the content to be printed in the browser current presentation page is acquired can be with are as follows: above-mentioned browsing
The button of the specified content of printing in the device current presentation page is operated.Specifically, in the above-mentioned browser current presentation page
Printing the button of specified content can be with by operation are as follows: the button for printing specified content is hit by mouse-click or double-click, touched point
Or be long pressed, the present embodiment is not construed as limiting to above-mentioned button by operation format.
For example, after user logs in " the personal Web bank " in banking system by browser, Ke Yi
The account detail that user is checked in " personal Web bank " may include that " printing account is bright in the page for checking account detail
A print command can be generated after user is by mouse-click " printing account detail " this button in carefully " this button.
In another implementation, the content to be printed in the browser current presentation page is acquired can be with are as follows: browser
Content to be printed in the current presentation page is chosen by user.Specifically, user is in the page for browsing current presentation by browser
After face, for content to be printed, user can be clicked by cursor and the box pulled out to diagonal is chosen
Above-mentioned content to be printed, the present embodiment pair can be chosen in such a way that cursor pulls by stating content or user to be printed
User selects the mode of content to be printed to be not construed as limiting, and the content to be printed in the browser current presentation page is selected by user
In after, the content to be printed that the available user of browser chooses, generate print command.
In the present embodiment, above-mentioned print command is used to indicate to the content to be printed in the above-mentioned browser current presentation page
It is printed, further, if pre-setting configuration information, above-mentioned print command is used to indicate according to above-mentioned configuration
Information prints content to be printed, above-mentioned configuration information may include print intended duration in content to be printed and/or
The layout etc. of content to be printed, above-mentioned layout may include Excel or Word etc., the present embodiment to layout not
It limits.
Still by taking user checks the account detail of user in " personal Web bank " as an example, user " is beaten by mouse-click
After this button of print account detail ", a print command can be generated, if being not provided with the configuration of content to be printed in advance
Information, then the account detail that above-mentioned print command is used to indicate in institute's displayed page current to browser prints.If
The configuration information of content to be printed is pre-set, then above-mentioned print command is used to indicate according to above-mentioned configuration information to predetermined
Account detail in time limit (such as: 1 month, 6 months or 1 year) is printed, and layout is Excel or Word etc..
Step 102, content to be printed indicated by above-mentioned print command is obtained.
Step 103, pre-prepd printing template is written into above-mentioned content to be printed, above-mentioned printing template passes through in HTML
Iframe label realize, the attribute of above-mentioned iframe label is hiding.
Wherein, iframe label is one of html tag, and iframe label will create comprising another document
Inline frame (inner frame at once), specifically,<iframe>label can specify that an inline frame, an inline frame by with
To be embedded in another document in the html document currently shown.
Step 104, printer is called to print the content to be printed in above-mentioned printing template by above-mentioned browser.
It specifically, will above-mentioned content write-in to be printed after obtaining content to be printed indicated by above-mentioned print command
Then pre-prepd printing template again prints the content to be printed in above-mentioned pre-prepd printing template, due to
Above-mentioned printing template is realized by iframe label, is carried out so as to realize to the specified content in the currently browsed page
When printing, content to be printed is separated with the content in current browse webpage, does not influence the sample of the currently browsed page of user
Formula.
It is window.print () by the method that above-mentioned browser calls printer, here to above-mentioned in the present embodiment
Content to be printed in iframe label is printed, and used sentence can be as follows: printsiframe.conte
ntWindow.print()。
It after printing finishes, needs to close above-mentioned printing template, printing next time is prevented to be repeatedly written, printing is caused to repeat to ask
Topic.
In the method for printing specified content in above-mentioned browser, print command is obtained, above-mentioned print command is that browser is worked as
What the content to be printed in preceding displayed page generated after being acquired, it then obtains in be printed indicated by above-mentioned print command
Hold, pre-prepd printing template is written into above-mentioned content to be printed, calls printer to above-mentioned finally by above-mentioned browser
Content to be printed in printing template is printed, since above-mentioned printing template is real by frame (iframe) label in HTML
It is existing, so as to realize when being printed to the specified content in the currently browsed page, by content to be printed and currently
Content separation in browsing pages, does not influence the pattern of the currently browsed page of user, improves user experience.Also, it is above-mentioned
The attribute of iframe label is hiding, therefore when printing to content to be printed, will not explicitly render printing content page,
Whole printing process user's unaware, can keep good user experience.
Fig. 2 is the flow chart that specified another embodiment of the method for content is printed in the application browser, as shown in Fig. 2,
In the application embodiment illustrated in fig. 1, step 102 may include:
Step 201, by HTML separate label (div) label wrap up indicated by above-mentioned print command it is to be printed in
Hold, the mark selector of above-mentioned div tag is printing content (printContent).
Wherein, div tag is that the content of the bulk (block-level) in for html document provides structure and background
Element.All the elements between beginning label and the end-tag of div tag are all for constituting this block, div tag
Included in the characteristic of element controlled by the attribute of div tag.
In the present embodiment, content to be printed indicated by above-mentioned print command is wrapped up with div tag, and will be above-mentioned
The mark selector of div tag is set as " printContent ", is to get content to be printed in JavaScript
HTML.
Step 202, through JavaScript order from the html file of the current presentation page, it is above-mentioned wait beat to obtain package
The div tag of content is printed, and obtains the HTML of above-mentioned div tag started between label and end-tag.
Specifically, script label can be first inserted into the head (head) of the html file of the current presentation page, so
It is obtained afterwards with the getElementById method (class selector getElementByClassName) in JavaScript order
Wrap up the div tag of above-mentioned content to be printed.Next, can be obtained by the innerHTML attribute in JavaScript order
Get the HTML of above-mentioned div tag started between label and end-tag.
In this way, step 103 may include:
Step 203, according to the mark selector of above-mentioned pre-prepd iframe label, from the window of above-mentioned browser opening
Above-mentioned iframe label is obtained in mouth (window), and pre-prepd printing template is obtained according to above-mentioned iframe label.
Step 204, above-mentioned printing template is written in the HTML between the above-mentioned beginning label that will acquire and above-mentioned end-tag.
In specific implementation, it this can be ordered from above-mentioned browser with window.frames [" printsiframe "]
Pre-prepd iframe label is obtained in the window (window) of opening, wherein " printsiframe " is to mention in step 203
The mark selector of the pre-prepd iframe label arrived.Pre-prepd impression block is being obtained according to above-mentioned iframe label
After plate, above-mentioned printing can be written into the HTML between the above-mentioned beginning label obtained in step 202 and above-mentioned end-tag
Template.
Fig. 3 is the flow chart that the method further embodiment of specified content is printed in the application browser, such as
Shown in Fig. 3, in the application embodiment illustrated in fig. 1, before step 103, can also include:
Step 301, iframe label is set in the window (window) that above-mentioned browser is opened.
Step 302, the type of above-mentioned iframe label is set as not showing, and the mark of above-mentioned iframe label is set
Selector.
It specifically, will be to be printed in order to realize when being printed to the content to be printed in the currently browsed page
Content is separated with the content in current browse webpage, does not influence the pattern of the currently browsed page of user, and the present embodiment passes through pre-
The printing template first prepared carries content to be printed, and above-mentioned printing template is realized by iframe label, it is therefore desirable to
Iframe label is set in the window that browser is opened in advance, and the type of above-mentioned iframe label is set as not showing
Show, i.e. style=" display:none " may be implemented to hide on iframe label in this way, it is also necessary to above-mentioned iframe be arranged
The mark selector of label specifically can set " printsiframe " for the mark selector of above-mentioned iframe label,
It is, of course, also possible to set other variable names for the mark selector of iframe label, the present embodiment marks above-mentioned iframe
The specific name of the mark selector of label is not construed as limiting, and is named as needed.
Fig. 4 is the structural schematic diagram that device one embodiment of specified content is printed in the application browser, the present embodiment
In browser in print the device of specified content and may be implemented to print specified content in browser provided by the embodiments of the present application
Method.As shown in figure 4, the device for printing specified content in above-mentioned browser may include: to obtain module 41, writing module 42
With print module 43;
Wherein, module 41 is obtained, for obtaining print command, above-mentioned print command is in the browser current presentation page
What content to be printed generated after being acquired;And obtain content to be printed indicated by above-mentioned print command.
In a kind of implementation, the content to be printed in the browser current presentation page is acquired can be with are as follows: above-mentioned browsing
The button of the specified content of printing in the device current presentation page is operated.Specifically, in the above-mentioned browser current presentation page
Printing the button of specified content can be with by operation are as follows: the button for printing specified content is hit by mouse-click or double-click, touched point
Or be long pressed, the present embodiment is not construed as limiting to above-mentioned button by operation format.
For example, after user logs in " the personal Web bank " in banking system by browser, Ke Yi
The account detail that user is checked in " personal Web bank " may include that " printing account is bright in the page for checking account detail
A print command can be generated after user is by mouse-click " printing account detail " this button in carefully " this button.
In another implementation, the content to be printed in the browser current presentation page is acquired can be with are as follows: browser
Content to be printed in the current presentation page is chosen by user.Specifically, user is in the page for browsing current presentation by browser
After face, for content to be printed, user can be clicked by cursor and the box pulled out to diagonal is chosen
Above-mentioned content to be printed, the present embodiment pair can be chosen in such a way that cursor pulls by stating content or user to be printed
User selects the mode of content to be printed to be not construed as limiting, and the content to be printed in the browser current presentation page is selected by user
In after, the content to be printed that the available user of browser chooses, generate print command.
In the present embodiment, obtains the print command that module 41 obtains and be used to indicate in the above-mentioned browser current presentation page
Content to be printed printed, further, if pre-setting configuration information, obtain module 41 obtain printing
Instruction, which is used to indicate, prints content to be printed according to above-mentioned configuration information, and above-mentioned configuration information may include that printing is predetermined
Content to be printed and/or the layout of content to be printed in time limit etc., above-mentioned layout may include Excel or Word
Deng the present embodiment is not construed as limiting layout.
Still by taking user checks the account detail of user in " personal Web bank " as an example, user " is beaten by mouse-click
After this button of print account detail ", a print command can be generated, if being not provided with the configuration of content to be printed in advance
Information, then the account detail that above-mentioned print command is used to indicate in institute's displayed page current to browser prints.If
The configuration information of content to be printed is pre-set, then above-mentioned print command is used to indicate according to above-mentioned configuration information to predetermined
Account detail in time limit (such as: 1 month, 6 months or 1 year) is printed, and layout is Excel or Word etc..
Writing module 42, for pre-prepd printing template to be written in above-mentioned content to be printed, above-mentioned printing template is logical
The iframe label crossed in HTML realizes that the attribute of above-mentioned iframe label is hiding;Wherein, iframe label is html tag
One of, iframe label will create the inline frame (inner frame at once) comprising another document, specifically, <
Iframe > label can specify that an inline frame, an inline frame are used to embedding in the html document currently shown
Enter another document.
Print module 43, for by above-mentioned browser call printer to the content to be printed in above-mentioned printing template into
Row printing.
Specifically, after obtaining module 41 and obtaining content to be printed indicated by above-mentioned print command, writing module 42
Pre-prepd printing template is written into above-mentioned content to be printed, then print module 43 is again to above-mentioned pre-prepd impression block
Content to be printed in plate is printed, since above-mentioned printing template is realized by iframe label, so as to realize right
When specified content in the currently browsed page is printed, by the content in content and current browse webpage to be printed point
From not influencing the pattern of the currently browsed page of user.
In the present embodiment, print module 43 is window.print () by the method that above-mentioned browser calls printer,
Here the content to be printed in above-mentioned iframe label is printed, used sentence can be as follows: printsif
rame.contentWindow.print()。
It after printing finishes, needs to close above-mentioned printing template, printing next time is prevented to be repeatedly written, printing is caused to repeat to ask
Topic.
In the device for printing specified content in above-mentioned browser, obtains module 41 and obtain print command, above-mentioned print command
It is to be generated after content to be printed in the browser current presentation page is acquired, then obtains indicated by above-mentioned print command
Content to be printed, pre-prepd printing template, last print module 43 is written in above-mentioned content to be printed by writing module 42
Printer is called to print the content to be printed in above-mentioned printing template by above-mentioned browser, due to above-mentioned printing template
Realized by frame (iframe) label in HTML, so as to realize to the specified content in the currently browsed page into
When row printing, content to be printed is separated with the content in current browse webpage, does not influence the currently browsed page of user
Pattern improves user experience.Also, the attribute of above-mentioned iframe label is hiding, therefore is printed to content to be printed
When, printing content page will not be explicitly rendered, whole printing process user's unaware can keep good user experience.
Fig. 5 is the structural schematic diagram that specified another embodiment of the device of content is printed in the application browser, this implementation
In example, module 41 is obtained, wraps up content to be printed indicated by above-mentioned print command specifically for the div tag by HTML,
The mark selector of above-mentioned div tag is printing content;By JavaScript order from the html file of the current presentation page
In, the div tag for wrapping up above-mentioned content to be printed is obtained, and obtain between the beginning label of above-mentioned div tag and end-tag
HTML.
Wherein, div tag is that the content of the bulk (block-level) in for html document provides structure and background
Element.All the elements between beginning label and the end-tag of div tag are all for constituting this block, div tag
Included in the characteristic of element controlled by the attribute of div tag.
In the present embodiment, content to be printed indicated by above-mentioned print command is wrapped up with div tag, and will be above-mentioned
The mark selector of div tag is set as " printContent ", is to get content to be printed in JavaScript
HTML.
Specifically, obtaining module 41 can the first insertion in the head (head) of the html file of the current presentation page
Script label, then with the getElementById method in JavaScript order, (class selector is
GetElementByClassName the div tag for wrapping up above-mentioned content to be printed) is obtained.Next, obtaining module 41 can lead to
The innerHTML attribute crossed in JavaScript order is got between beginning label and the end-tag of above-mentioned div tag
HTML。
In this way, writing module 42 is beaten specifically for the mark selector according to above-mentioned iframe label from above-mentioned browser
Above-mentioned iframe label is obtained in the window opened, and pre-prepd printing template is obtained according to above-mentioned iframe label;It will acquire
Above-mentioned printing template is written in the HTML between above-mentioned beginning label and above-mentioned end-tag that module 41 obtains.
In specific implementation, writing module 42 can with window.frames [" printsiframe "] this order from
Pre-prepd iframe label is obtained in the window (window) that above-mentioned browser is opened, wherein " printsiframe " is
The mark selector of pre-prepd iframe label.According to above-mentioned iframe label obtain pre-prepd printing template it
Afterwards, writing module 42 can will acquire in the HTML write-in between the above-mentioned beginning label and above-mentioned end-tag of the acquisition of module 41
State printing template.
Further, the device that specified content is printed in above-mentioned browser can also include: setup module 44;
Setup module 44, for writing module 42 will the pre-prepd printing template of above-mentioned content to be printed write-in it
Before, iframe label is set in the window that above-mentioned browser is opened;The type of above-mentioned iframe label is set as not showing,
And the mark selector of above-mentioned iframe label is set.
It specifically, will be to be printed in order to realize when being printed to the content to be printed in the currently browsed page
Content is separated with the content in current browse webpage, does not influence the pattern of the currently browsed page of user, and the present embodiment passes through pre-
The printing template first prepared carries content to be printed, and above-mentioned printing template is realized by iframe label, therefore is arranged
Module 44 needs that iframe label is arranged in the window that browser is opened in advance, and the type of above-mentioned iframe label is set
It is set to and does not show, is i.e. style=" display:none " may be implemented to hide on iframe label in this way, and setup module 44 is also
It needs to be arranged the mark selector of above-mentioned iframe label, specifically, the mark selector of above-mentioned iframe label can be set
It is set to " printsiframe ", certainly, it is other can also to set the mark selector of iframe label to for setup module 44
Variable name, the present embodiment are not construed as limiting the specific name of the mark selector of above-mentioned iframe label, and name as needed is
It can.
Fig. 6 is the structural schematic diagram of the application computer equipment one embodiment, and above-mentioned computer equipment may include depositing
Reservoir, processor and it is stored in the computer program that can be run on above-mentioned memory and on above-mentioned processor, above-mentioned processor
When executing above-mentioned computer program, it may be implemented to print the method for specifying content in browser provided by the embodiments of the present application.
Wherein, above-mentioned computer equipment can be server, such as: cloud server;Alternatively, above-mentioned computer equipment can
Think electronic equipment, such as: the smart machines such as smart phone, smartwatch or tablet computer, the present embodiment is to above-mentioned computer
The specific form of equipment is not construed as limiting.
Fig. 6 shows the block diagram for being suitable for the exemplary computer device 12 for being used to realize the application embodiment.Fig. 6 is shown
Computer equipment 12 be only an example, should not function to the embodiment of the present application and use scope bring any restrictions.
As shown in fig. 6, computer equipment 12 is showed in the form of universal computing device.The component of computer equipment 12 can be with
Including but not limited to: one or more processor or processing unit 16, system storage 28 connect different system components
The bus 18 of (including system storage 28 and processing unit 16).
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts
For example, these architectures include but is not limited to industry standard architecture (Industry Standard
Architecture;Hereinafter referred to as: ISA) bus, microchannel architecture (Micro Channel Architecture;Below
Referred to as: MAC) bus, enhanced isa bus, Video Electronics Standards Association (Video Electronics Standards
Association;Hereinafter referred to as: VESA) local bus and peripheral component interconnection (Peripheral Component
Interconnection;Hereinafter referred to as: PCI) bus.
Computer equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by
The usable medium that computer equipment 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access
Memory (Random Access Memory;Hereinafter referred to as: RAM) 30 and/or cache memory 32.Computer equipment 12
It may further include other removable/nonremovable, volatile/non-volatile computer system storage mediums.Only conduct
Citing, storage system 34 can be used for reading and writing immovable, non-volatile magnetic media, and (Fig. 6 do not show, commonly referred to as " hard disk
Driver ").Although being not shown in Fig. 6, the magnetic for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") can be provided
Disk drive, and to removable anonvolatile optical disk (such as: compact disc read-only memory (Compact Disc Read Only
Memory;Hereinafter referred to as: CD-ROM), digital multi CD-ROM (Digital Video Disc Read Only
Memory;Hereinafter referred to as: DVD-ROM) or other optical mediums) read-write CD drive.In these cases, each driving
Device can be connected by one or more data media interfaces with bus 18.Memory 28 may include that at least one program produces
Product, the program product have one group of (for example, at least one) program module, and it is each that these program modules are configured to perform the application
The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store in such as memory 28
In, such program module 42 includes --- but being not limited to --- operating system, one or more application program, other programs
It may include the realization of network environment in module and program data, each of these examples or certain combination.Program mould
Block 42 usually executes function and/or method in embodiments described herein.
Computer equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24
Deng) communication, can also be enabled a user to one or more equipment interact with the computer equipment 12 communicate, and/or with make
The computer equipment 12 any equipment (such as network interface card, the modulatedemodulate that can be communicated with one or more of the other calculating equipment
Adjust device etc.) communication.This communication can be carried out by input/output (I/O) interface 22.Also, computer equipment 12 may be used also
To pass through network adapter 20 and one or more network (such as local area network (Local Area Network;Hereinafter referred to as:
LAN), wide area network (Wide Area Network;Hereinafter referred to as: WAN) and/or public network, for example, internet) communication.Such as figure
Shown in 6, network adapter 20 is communicated by bus 18 with other modules of computer equipment 12.Although should be understood that in Fig. 6 not
It shows, other hardware and/or software module can be used in conjunction with computer equipment 12, including but not limited to: microcode, equipment are driven
Dynamic device, redundant processing unit, external disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and
Data processing, such as realize the method that specified content is printed in browser provided by the embodiments of the present application.
The embodiment of the present application also provides a kind of non-transitorycomputer readable storage medium, is stored thereon with computer journey
Sequence, above-mentioned computer program may be implemented to print specified content in browser provided by the embodiments of the present application when being executed by processor
Method.
Above-mentioned non-transitorycomputer readable storage medium can appointing using one or more computer-readable media
Meaning combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.Computer can
Reading storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device
Or device, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes:
Electrical connection, portable computer diskette, hard disk, random access memory (RAM), read-only storage with one or more conducting wires
Device (Read Only Memory;Hereinafter referred to as: ROM), erasable programmable read only memory (Erasable
Programmable Read Only Memory;Hereinafter referred to as: EPROM) or flash memory, optical fiber, portable compact disc are read-only deposits
Reservoir (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer
Readable storage medium storing program for executing can be any tangible medium for including or store program, which can be commanded execution system, device
Either device use or in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including --- but
It is not limited to --- electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be
Any computer-readable medium other than computer readable storage medium, which can send, propagate or
Transmission is for by the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited
In --- wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
Can with one or more programming languages or combinations thereof come write for execute the application operation computer
Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++,
It further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with
It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion
Divide and partially executes or executed on a remote computer or server completely on the remote computer on the user computer.?
It is related in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (Local
Area Network;Hereinafter referred to as: LAN) or wide area network (Wide Area Network;Hereinafter referred to as: WAN) it is connected to user
Computer, or, it may be connected to outer computer (such as being connected using ISP by internet).
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is contained at least one embodiment or example of the application.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance
Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the present application, the meaning of " plurality " is at least two, such as two, three
It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discussed suitable
Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be by the application
Embodiment person of ordinary skill in the field understood.
Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination " or " in response to detection ".Similarly, depend on context, phrase " if it is determined that " or " if detection
(condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when the detection (condition of statement
Or event) when " or " in response to detection (condition or event of statement) ".
It should be noted that terminal involved in the embodiment of the present application can include but is not limited to personal computer
(Personal Computer;Hereinafter referred to as: PC), personal digital assistant (Personal Digital Assistant;Below
Referred to as: PDA), radio hand-held equipment, tablet computer (Tablet Computer), mobile phone, MP3 player, MP4 player etc..
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or group
Part can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown
Or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit it is indirect
Coupling or communication connection can be electrical property, mechanical or other forms.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that device (can be personal computer, server or network equipment etc.) or processor (Processor) execute the application
The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory;Hereinafter referred to as: ROM), random access memory (Random Access Memory;Hereinafter referred to as: RAM),
The various media that can store program code such as magnetic or disk.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.
Claims (10)
1. printing the method for specified content in a kind of browser characterized by comprising
Print command is obtained, the print command is generated after the content to be printed in the browser current presentation page is acquired
's;
Obtain content to be printed indicated by the print command;
Pre-prepd printing template is written into the content to be printed, the printing template passes through hypertext markup language HTML
In frame tags realize, the attribute of the frame tags is hiding;
Printer is called to print the content to be printed in the printing template by the browser.
2. the method according to claim 1, wherein the print command be used to indicate it is current to the browser
Content to be printed in displayed page is printed;Alternatively, the print command is used to indicate according to pre-set with confidence
Breath prints content to be printed.
3. the method according to claim 1, wherein described obtain in be printed indicated by the print command
Appearance includes:
Content to be printed indicated by the print command is wrapped up by the label label that separates of HTML, it is described to separate label label
Mark selector be printing content;
Through JavaScript order from the html file of the current presentation page, obtains and wrap up the content to be printed
Label label is separated, and separates the HTML of label label started between label and end-tag described in acquisition.
4. according to the method described in claim 3, it is characterized in that, described be written pre-prepd beat for the content to be printed
Die plate includes:
According to the mark selector of the frame tags, the frame tags, root are obtained from the window that the browser is opened
Pre-prepd printing template is obtained according to the frame tags;
The printing template is written in HTML between the beginning label that will acquire and the end-tag.
5. method according to any of claims 1-4, which is characterized in that described that the content to be printed is written in advance
Before the printing template first prepared, further includes:
Frame tags are set in the window that the browser is opened;
The type of the frame tags is set as not showing, and the mark selector of the frame tags is set.
6. printing the device of specified content in a kind of browser characterized by comprising
Module is obtained, for obtaining print command, the print command is the content to be printed in the browser current presentation page
It is generated after being acquired;And obtain content to be printed indicated by the print command;
Writing module, for pre-prepd printing template to be written in the content to be printed, the printing template passes through super literary
Frame tags in this markup language HTML realize that the attribute of the frame tags is hiding;
Print module, for calling printer to beat the content to be printed in the printing template by the browser
Print.
7. device according to claim 6, which is characterized in that described to obtain the print command that module obtains and be used to indicate pair
Content to be printed in the browser current presentation page is printed;Alternatively, the print command for obtaining module and obtaining
It is used to indicate and content to be printed is printed according to pre-set configuration information.
8. device according to claim 6, which is characterized in that
The acquisition module, specifically for by HTML separate label label wrap up it is to be printed indicated by the print command
Content, the mark selector for separating label label are printing content;By JavaScript order from the current presentation
In the html file of the page, obtain the package content to be printed separates label label, and separates label label described in acquisition
The HTML started between label and end-tag.
9. a kind of computer equipment, which is characterized in that including memory, processor and be stored on the memory and can be in institute
The computer program run on processor is stated, when the processor executes the computer program, is realized as in claim 1-5
Any method.
10. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, which is characterized in that the meter
Such as method as claimed in any one of claims 1 to 5 is realized when calculation machine program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910422696.XA CN110347349A (en) | 2019-05-21 | 2019-05-21 | The method, apparatus and computer equipment of specified content are printed in browser |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910422696.XA CN110347349A (en) | 2019-05-21 | 2019-05-21 | The method, apparatus and computer equipment of specified content are printed in browser |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110347349A true CN110347349A (en) | 2019-10-18 |
Family
ID=68174714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910422696.XA Pending CN110347349A (en) | 2019-05-21 | 2019-05-21 | The method, apparatus and computer equipment of specified content are printed in browser |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110347349A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110837347A (en) * | 2019-11-06 | 2020-02-25 | 王前 | Webpage printing method based on analysis plug-in, server and storage medium |
CN111708499A (en) * | 2020-05-13 | 2020-09-25 | 厦门汉印电子技术有限公司 | Printing management method, device, equipment and storage medium for printing pages |
CN111783414A (en) * | 2020-07-20 | 2020-10-16 | 上海乾臻信息科技有限公司 | Label printing template generation method and device |
CN113238720A (en) * | 2021-03-30 | 2021-08-10 | 紫光云技术有限公司 | Implementation method for directly printing pdf file on page without plug-in |
CN113360106A (en) * | 2021-06-30 | 2021-09-07 | 建信金融科技有限责任公司 | Webpage printing method and device |
CN114296662A (en) * | 2021-12-28 | 2022-04-08 | 城云科技(中国)有限公司 | Page-based form document paging printing method, device and application thereof |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100281351A1 (en) * | 2009-04-29 | 2010-11-04 | Soiba Mohammed | Web print content control using html |
CN104461412A (en) * | 2014-12-30 | 2015-03-25 | 广州视源电子科技股份有限公司 | Web page designated area printing method and system |
CN104714766A (en) * | 2015-03-12 | 2015-06-17 | 福建工程学院 | Method for direct printing in WEB report browser |
-
2019
- 2019-05-21 CN CN201910422696.XA patent/CN110347349A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100281351A1 (en) * | 2009-04-29 | 2010-11-04 | Soiba Mohammed | Web print content control using html |
CN104461412A (en) * | 2014-12-30 | 2015-03-25 | 广州视源电子科技股份有限公司 | Web page designated area printing method and system |
CN104714766A (en) * | 2015-03-12 | 2015-06-17 | 福建工程学院 | Method for direct printing in WEB report browser |
Non-Patent Citations (1)
Title |
---|
脚本之家: "js调用iframe实现打印页面内容的方法", pages 1 - 2, Retrieved from the Internet <URL:https://www.jb51.net/article/47622.htm> * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110837347A (en) * | 2019-11-06 | 2020-02-25 | 王前 | Webpage printing method based on analysis plug-in, server and storage medium |
CN111708499A (en) * | 2020-05-13 | 2020-09-25 | 厦门汉印电子技术有限公司 | Printing management method, device, equipment and storage medium for printing pages |
CN111783414A (en) * | 2020-07-20 | 2020-10-16 | 上海乾臻信息科技有限公司 | Label printing template generation method and device |
CN113238720A (en) * | 2021-03-30 | 2021-08-10 | 紫光云技术有限公司 | Implementation method for directly printing pdf file on page without plug-in |
CN113360106A (en) * | 2021-06-30 | 2021-09-07 | 建信金融科技有限责任公司 | Webpage printing method and device |
CN114296662A (en) * | 2021-12-28 | 2022-04-08 | 城云科技(中国)有限公司 | Page-based form document paging printing method, device and application thereof |
CN114296662B (en) * | 2021-12-28 | 2023-10-13 | 城云科技(中国)有限公司 | Form document paging printing method and device based on webpage and application of form document paging printing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110347349A (en) | The method, apparatus and computer equipment of specified content are printed in browser | |
CN106991154B (en) | Webpage rendering method and device, terminal and server | |
CN106484383B (en) | Page rendering method, device and equipment | |
KR101507629B1 (en) | Browser-based proxy server for customization and distribution of existing applications | |
CN104520816B (en) | For adjusting method, equipment and storage media across expanding communication | |
US7698628B2 (en) | Method and system to persist state | |
CN110187913A (en) | Publication, operation method and the device of small routine | |
US7761842B2 (en) | System and method for generating a graphical user interface (GUI) element | |
CN104995601B (en) | It is switched to the machine Web page application program and is switched away from from the machine Web page application program | |
CN107515862A (en) | Voice translation method, device and server | |
EP3074863A1 (en) | System and method for testing data representation for different mobile devices | |
US20150319117A1 (en) | Computer System and Computer-Implemented Method for Service and Application Load Testing | |
US9684641B1 (en) | Presenting content in multiple languages | |
US10839140B2 (en) | Page displaying method, apparatus based on H5 webpage, and computer readable storage medium | |
CN104915186B (en) | A kind of method and apparatus making the page | |
CN107341388A (en) | Access right control method and device | |
CN108073435A (en) | A kind of multi information integrative display method and system | |
CN109683880A (en) | Webpage exchange method, device, equipment and storage medium | |
CN107301046A (en) | Treating method and apparatus, computer equipment and the storage medium of icon | |
US8010893B2 (en) | Electronic document with selectively editable fields and methods for same | |
CN107341027A (en) | The generation method and generating means of user interface | |
US20180341787A1 (en) | Method and system to maintain the integrity of a certified document while persisting state in a dynamic form | |
CN109582317A (en) | Method and apparatus for debugging boarding application | |
JP2009519542A (en) | Alternative graphics pipe | |
KR101797573B1 (en) | Web based spreadsheets service providing apparatus and method |
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 |