CN115167790A - Printing method and system - Google Patents

Printing method and system Download PDF

Info

Publication number
CN115167790A
CN115167790A CN202210827806.2A CN202210827806A CN115167790A CN 115167790 A CN115167790 A CN 115167790A CN 202210827806 A CN202210827806 A CN 202210827806A CN 115167790 A CN115167790 A CN 115167790A
Authority
CN
China
Prior art keywords
printing
target
object model
document object
configuration information
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
CN202210827806.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.)
Electronic Science And Technology Park Co ltd
Original Assignee
Electronic Science And Technology Park 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 Electronic Science And Technology Park Co ltd filed Critical Electronic Science And Technology Park Co ltd
Priority to CN202210827806.2A priority Critical patent/CN115167790A/en
Publication of CN115167790A publication Critical patent/CN115167790A/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/1206Improving or facilitating administration, e.g. print management resulting in increased flexibility in input data format or job format or job type
    • 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/1242Image or content composition onto a page
    • 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/1244Job translation or job parsing, e.g. page banding
    • G06F3/1247Job translation or job parsing, e.g. page banding by conversion to printer ready format
    • 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
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

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)
  • Document Processing Apparatus (AREA)

Abstract

The application provides a printing method and a system, wherein the printing method is used for browser printing, and the method comprises the following steps: reading a target printing template in the printing configuration information; judging whether the target printing template comprises a custom printing template or not; if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content; filtering the document object model to obtain a filtered document object model; rearranging the filtered document object model to generate a target document object model; and converting the target document object model into a target printing format and printing. By using the printing method provided by the embodiment of the application, the printing, the typesetting and the configuration can be adaptively printed, excessive intervention on the printed styles is not needed, and the development efficiency and the reusability can be improved.

Description

Printing method and system
Technical Field
The present application relates to the field of computers, and in particular, to a printing method and system.
Background
The demand for printing in a browser is increasing, for example, a website providing network retail service needs to print orders, online forms of enterprises and the like directly on the website; at present, one mode is to realize the printing of target information by the control of a browser-carried window print () method and custom printing css; another way is to print itself through a code generation template, such as pdf format, by way of browser preview.
The printing by the browser-carried method has the problems that the text format cannot be freely controlled and the printing effect is poor. By the method for generating the template through the code, a developer can preset the printing template during development, and the problem that the requirements of users cannot be met often occurs.
Disclosure of Invention
In view of the above problems, an object of the embodiments of the present application is to provide a printing method and system by automatically identifying configuration information of content to be printed; specifically, if the configuration information comprises a custom printing template, printing is carried out according to the custom printing template; and if the configuration information does not contain the custom printing template, automatically typesetting and printing according to the custom configuration or the global configuration and the requirement. The printing method provided by the embodiment of the application automatically identifies the content to be printed, automatically typesets and prints according to the configuration item and the table mode, meets the user-defined requirements on printing configuration and printing typesetting, and can present a better printing effect.
In a first aspect, an embodiment of the present application provides a printing method, where the printing method is used for browser printing, and the printing method includes: reading printing configuration information; the printing configuration information comprises a target printing template and/or a target printing configuration; judging whether the target printing configuration information comprises a custom printing template or not; if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content; filtering the document object model to obtain a filtered document object model; rearranging the filtered document object model to generate a target document object model; and converting the target document object model into a target printing format according to the target printing configuration, and printing.
In the implementation process, if the configuration information comprises the custom printing template, printing according to the custom printing template; and if the configuration information does not contain the custom printing template, automatically typesetting and printing according to the custom configuration or the global configuration and the requirement. The method and the device realize automatic identification of the configuration information, can meet the requirements of users on printing and typesetting to the greatest extent, and produce better printing effect.
Optionally, in this embodiment of the application, before reading the printing configuration information, the printing method further includes: judging whether the printing configuration information comprises a custom printing template or not; if the printing configuration information does not comprise the custom printing template, judging whether the printing configuration information comprises the custom configuration information; if the printing configuration information comprises the user-defined configuration information, combining the user-defined configuration information with the global configuration information; and generating target printing configuration according to the combined custom configuration information and the global configuration information.
In the implementation process, whether the printing configuration information comprises a custom printing template is judged firstly; if not, judging whether the configuration information comprises the self-defined configuration information; and if so, combining the custom configuration information with the global configuration information and generating the target printing configuration. The automatic identification of the custom printing configuration information and the custom printing template is realized, and the target printing configuration is obtained after the custom printing configuration and the global configuration are combined, so that the target configuration comprises the user-defined information.
Optionally, in this embodiment of the application, if the print configuration information does not include the custom configuration information, the target print configuration is generated according to the global configuration information.
In the implementation process, if the printing configuration information does not include the user-defined configuration information, the global configuration information is directly used to identify the global configuration information as the target printing configuration; enabling printing of the target content using the target printing configuration; therefore, the printing method provided by the embodiment of the application can also be used for directly printing when the user does not modify the configuration.
Optionally, in this embodiment of the application, if the print configuration information includes a custom print template, the target print template is generated according to the custom print template.
In the implementation process, if the configuration information contains the self-defined printing template, the self-defined printing template is directly identified as the target printing target; the custom template may be generated by the user in the last printing, and if the custom printing requirement of the user is not changed, the custom printing template can be directly used for printing. Therefore, repeated configuration is avoided, and reusability is improved.
Optionally, in this embodiment of the present application, the rearranging the filtered document object model to generate the target document object model includes: acquiring a document object model corresponding to target printing content; converting the parent-child relationship between the document object model and the filtered document object model; and adding the filtered document object model according to the document object model container ratio to generate a target document object model.
In the implementation process, the filtered document object model is rearranged; the reason is that when the document object model is rearranged, the previous order is disturbed, and the print format is affected. And recalculating the parent-child relationship of the document object model to generate a new target object document model. Therefore, the problems of document object model confusion and printing format occurrence caused by changing the printing configuration are avoided.
Optionally, in this embodiment of the present application, converting the target document object model into the target print format according to the target print configuration includes: performing text attribute transformation on the target document object model according to the target printing configuration to generate a target printing format; the text attribute transformation comprises the transformation of text fonts and text formats.
In the implementation process, text attribute transformation is carried out on the target document object model according to target printing configuration, so that a target printing format is generated; the target print format characterizes a target print configuration, and the target print format can be directly used for printing when printing is triggered.
Optionally, in this embodiment of the present application, the filtering the document object model includes: acquiring elements which are printed in the document object model in an neglected mode; wherein the elements that are omitted from printing comprise elements having a value of 0 in the document object model.
In the implementation process, in the printed content, some information which does not need to be printed exists, such as an empty table and the like; the information, which is the element with the value of 0 in the document object model, needs to be filtered, so that the waste of printing resources is avoided.
In a second aspect, an embodiment of the present application provides a printing system, where the printing system is used for browser printing, and the printing system includes: the system comprises a printing configuration acquisition module, a target document object model generation module and a printing module; the printing configuration acquisition module is used for reading a target printing template in the printing configuration information; the target document object model generation module is used for judging whether the target printing template comprises a custom printing template; if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content; filtering the document object model to obtain a filtered document object model; rearranging the filtered document object model to generate a target document object model; and the printing module is used for converting the target document object model into a target printing format according to the target printing configuration and printing.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes steps in any one of the foregoing implementation manners when reading and executing the program instructions.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are read and executed by a processor, the steps in any one of the foregoing implementation manners are performed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a first printing flow chart provided in the embodiment of the present application;
FIG. 2 is a flowchart of target print configuration test generation provided by an embodiment of the present application;
FIG. 3 is a flowchart of a target document object model generation process provided by an embodiment of the present application;
FIG. 4 is a second printing flowchart provided by an embodiment of the present application;
FIG. 5 is a third printing flowchart provided in an embodiment of the present application;
FIG. 6 is a schematic block diagram of a printing system provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. For example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In the research process, the applicant finds that the printing requirement is generally met when the WEB browsing and accessing are carried out through a browser; according to the original page 1:1, printing, local printing, self-adaptive typesetting printing and other requirements. At present, one way is to realize the printing of target information by the self-contained window & print () method of a browser and the control of a custom printing css; another way is to print itself through a code generation template, such as pdf format, by way of browser preview. However, printing by a browser-only method has problems that the text format cannot be freely controlled and the printing effect is poor. By the method for generating the template by the code, developers can preset the printing template during development, and the problem that the requirements of users cannot be met frequently occurs.
Based on the method, the content to be printed can be automatically identified, and the content can be automatically typeset and printed according to the configuration item and the table mode, so that the user-defined requirements on printing configuration and printing typesetting are met, and a better printing effect can be presented.
Referring to fig. 1, fig. 1 is a first printing flow chart provided in the embodiment of the present application; the printing method comprises the following steps:
step S100: the print configuration information is read.
In the above step S100, the printing configuration information is read, and it should be noted that there may be a target printing template or a target printing configuration in the printing configuration information. The target printing template can be directly used for printing; the target printing configuration needs to be rendered into a printing template for printing.
Step S102: and judging whether the target printing configuration information comprises a custom printing template.
In the step S102, it is determined whether the target print configuration information includes a custom print template; the purpose of the judgment is that if the custom printing template exists, the template can be directly used for printing.
Step S103: and if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content.
In the step S103, if the custom print template is not included, it is verified that the print template needs to be generated; it will be appreciated that the print template may be generated using the target print configuration.
Step S104: the document object model is filtered to obtain a filtered document object model.
In the step S104, the parts of the document that do not need to be printed are filtered, and a filtered document object model is obtained after filtering.
Step S105: the filtered document object model is rearranged to generate a target document object model.
In the step S105, the document object model may be confused after filtering, and a better printing effect cannot be achieved, so that the document object model is rearranged to obtain a new document object model.
Step S106: and converting the target document object model into a target printing format according to the target printing configuration, and printing.
In the above step S106, the finally generated document object model is converted into the target printing format, and printing can be realized.
As can be seen from fig. 1, if the configuration information includes the custom printing template, printing is performed according to the custom printing template; and if the configuration information does not contain the custom printing template, automatically typesetting and printing according to the custom configuration or the global configuration and the requirement. The method and the device realize automatic identification of the configuration information, can meet the requirements of users on printing and typesetting to the greatest extent, and produce better printing effect.
Referring to fig. 2, fig. 2 is a flowchart of target print configuration test generation provided in an embodiment of the present application; the method comprises the following steps:
step S200: and judging whether the printing configuration information comprises a custom printing template.
In the step S200, it is first determined whether the print configuration information includes a self-defined print template;
step S201: and if the printing configuration information does not comprise the custom printing template, judging whether the printing configuration information comprises the custom configuration information.
In step S201, if the print configuration information does not include the custom print template, it is further determined whether the print configuration information includes custom configuration information.
Step S202: and if the printing configuration information comprises the custom configuration information, combining the custom configuration information and the global configuration information.
In the step S202, if the print configuration information includes the custom configuration information, the custom configuration information and the global configuration information are merged; since the print configuration information is so much that the user may only change a portion when changing the configuration, the unchanged portion may continue to use the original global configuration.
Step S203: and generating target printing configuration according to the combined custom configuration information and the global configuration information.
In step S203, the combined custom configuration information and global configuration information may generate a target print configuration.
As can be seen from fig. 2, it is first determined whether the print configuration information includes a custom print template; if not, judging whether the configuration information comprises the self-defined configuration information; and if so, combining the custom configuration information with the global configuration information and generating the target printing configuration. The automatic identification of the custom printing configuration information and the custom printing template is realized, and the target printing configuration is obtained after the custom printing configuration and the global configuration are combined, so that the target configuration comprises the user-defined information.
In an optional embodiment, if the print configuration information does not include the custom configuration information, the target print configuration is generated according to the global configuration information. That is, the global profile is used directly as the target print profile when there is no custom template and no custom profile information.
Therefore, if the printing configuration information does not include the custom configuration information, the global configuration information is directly used to identify the global configuration information as the target printing configuration; enabling printing of the target content using the target printing configuration; therefore, the printing method provided by the embodiment of the application can also be used for directly printing when the user does not modify the configuration.
In an optional embodiment, if the print configuration information includes a custom print template, the target print template is generated according to the custom print template. That is, if there is a custom print template in the print configuration information, the custom print template is directly used for printing.
Therefore, if the configuration information contains the custom printing template, the custom printing template is directly identified as the target printing target; the custom template may be generated by the user in the last printing, and if the custom printing requirement of the user is not changed, the custom template can be directly used for printing. Therefore, repeated configuration is avoided, and reusability is improved.
Referring to fig. 3, fig. 3 is a flowchart of generating a target document object model according to an embodiment of the present application; the method comprises the following steps:
step S300: and acquiring a document object model corresponding to the target printing content.
In the above step S300, the document object model corresponding to the target print content is obtained, and it should be understood that the document object model here is the original document object model.
Step S301: and converting the parent-child relationship between the document object model and the filtered document object model.
In the above step S301, the filtered document object model is judged from the following dimensions according to the target print configuration: whether the model is a parent-level document object model, whether the label is displayed or not, whether the value is available or not and the like judge whether the corresponding document object model is displayed or not and whether the previous style display needs to be reserved or not. Finally, judging whether corresponding proportion judgment is needed to be recalculated; it will be appreciated that if the target print configuration is generated by a global configuration, then there is no need to recalculate the container fraction; if the target printing configuration is formed by combining the custom configuration and the global configuration, the container ratio calculation needs to be carried out again. And after the judgment is finished, performing parent-child relationship conversion on the document object models before and after the filtering.
Step S302: and adding the filtered document object model according to the document object model container ratio to generate a target document object model.
In the above step S301, the filtered document object model is added according to the document object model container percentage. Illustratively, the corresponding document object model is compared and judged, there is configuration in the configuration class to identify the document object model selector that needs to calculate the comparison and judge; if not, automatically calculating the item in form automatically, and converting the occupation ratio of the current item in one row by a fraction (such as 1/2, 1/3); thereby obtaining a target document object model.
As can be seen from fig. 3, the filtered document object model is rearranged; the reason is that when the document object model is rearranged, the previous order is disturbed, and the print format is affected. And recalculating the parent-child relationship of the document object model to generate a new target object document model. Therefore, the problems of document object model confusion and printing format occurrence caused by changing the printing configuration are avoided.
In an alternative embodiment, converting the target document object model to the target print format according to the target print configuration comprises: performing text attribute transformation on the target document object model according to the target printing configuration to generate a target printing format; the text attribute transformation comprises the transformation of text fonts and text formats. Exemplarily, after the target document object model is obtained, rendering the target document object model tree, which can be understood as that rendering is to convert the content to be printed into a target printing format corresponding to the target configuration according to the target printing configuration; further, if the target printing content is displayed in a tabular form, when line and row cutting is performed, if the container occupation ratio of the target printing content document object model is 1, the target printing content document object model is exclusive one line; if the container proportion of the target printing content document object model is 1/2, the number of columns is half of the number of columns in a row, and row-column combination is automatically carried out. It should be noted that, if there is a required filtering item in the configuration, a filtering annotation is added in front of the target document object model, and a printing style registry configured by the user is registered on a new page rendering, and the user-defined style overlay is performed after the default printing style registry.
Therefore, text attribute transformation is carried out on the target document object model according to the target printing configuration, and a target printing format is generated; the target print format characterizes a target print configuration, and the target print format can be directly used for printing when printing is triggered.
In an alternative embodiment, filtering the document object model comprises: acquiring an element which neglects printing in the document object model; wherein the elements that are omitted from printing comprise elements having a value of 0 in the document object model. In the printed contents, there is some information that does not need to be printed, such as an empty form or the like; the information, which is the element with the value of 0 in the document object model, needs to be filtered, so that the waste of printing resources is avoided.
Referring to fig. 4, fig. 4 is a second printing flowchart provided in the embodiment of the present application. The method comprises the following steps:
step S400: the print page is loaded in the browser.
Step S401: a reading software toolkit, which may be an SDK; it is understood that an SDK is a software development kit; the tool kit used in the present application is the SDK, but in practical applications, the software tool kit is for the purpose of implementing custom configuration, and the SDK should not be a limitation to the kind of the software tool kit of the present application.
Step S402: reading configuration information, wherein the configuration information can comprise a target printing template and/or a target printing configuration; it should be noted that the target printing template is generated by a freely defined printing template; the target print configuration may be a global configuration or a combination of a global configuration and a custom configuration.
Step S403: and judging whether the configuration information has the custom template.
Step S404: if the custom template exists, loading the template to generate a target printing template; ready for printing.
Step S405: and if the self-defined template does not exist in the configuration information, judging whether the self-defined configuration exists or not.
Step S406: and if the configuration information has the custom configuration, combining the custom configuration information with the global configuration information to generate the target configuration.
Step S407: and if the configuration information contains the custom configuration information, the root takes the global configuration information as target configuration.
Step S408: the target print configuration is converted to a target print template.
Step S409: and monitoring an event of the binding page, and monitoring if the printing is triggered.
Step S410: and ejecting for printing.
Therefore, a complete printing process is completed, the contents to be printed are automatically identified in the process, and the contents are automatically typeset and printed according to the configuration items and the table mode, so that the requirements of users on self-definition of printing configuration and printing typesetting are met, and a better printing effect can be presented.
Referring to fig. 5, fig. 5 is a third printing flowchart provided in the embodiment of the present application; the method comprises the following steps:
step S500: reading the original document object model tree.
In the above step S500, reading the original document object model tree from the target print configuration; it will be appreciated that the original document object model tree corresponds to the document object model before the custom configuration has not taken place.
Step S501: and converting the parent-child relationship between the document object model and the filtered document object model to obtain a target document object model.
In the above step S501, the filtered document object model is judged from the following dimensions according to the target print configuration: whether the model is a parent document object model, whether the label is displayed or not, whether the value is available or not and the like judge whether the corresponding document object model is displayed or not and whether the previous style display needs to be reserved or not. Finally, judging whether corresponding proportion judgment is needed to be recalculated; it will be appreciated that if the target print configuration is generated by a global configuration, then there is no need to recalculate the container fraction; if the target printing configuration is formed by combining the custom configuration and the global configuration, the container ratio calculation needs to be carried out again. And after the judgment is finished, performing parent-child relationship conversion on the document object models before and after the filtering.
Step S502: and adding the target document object model to the corresponding attribute of each document object model according to the new container ratio.
Step S503: and judging whether the target document object model conforms to the table entry format.
Step S504: and if the table item format is met, converting the target document object model into a target printing format according to the table item format for printing. Step S505: if the target document object model does not conform to the table entry format, performing document transformation on the target document object model; to obtain the entry format of the entry format.
Step S506: printing is started.
As can be seen from fig. 5, if the ordering of the document object model is disturbed, the printing format will be affected. And recalculating the parent-child relationship of the document object model to generate a new target object document model. Therefore, the problems of document object model confusion and printing format occurrence caused by changing the printing configuration are avoided. In practical application, if the table entry form is required to be used for printing, the document format of the target document object model is converted, so that the table entry form printing is realized.
Referring to fig. 6, fig. 6 is a schematic diagram of a printing system module according to an embodiment of the present disclosure; the printing system 500 includes: a print configuration acquisition module 501, a target document object model generation module 502, and a print module 503.
The print configuration acquisition module 501 is configured to read a target print template in the print configuration information.
The target document object model generation module 502 is used for judging whether the target printing template comprises a custom printing template; if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content; filtering the document object model to obtain a filtered document object model; and rearranging the filtered document object model to generate a target document object model.
The print module 503 is configured to convert the target document object model into a target print format according to the target print configuration and print.
In an optional embodiment, the print configuration acquiring module 501, before reading the print configuration information, the printing method further includes: the print configuration acquisition module 501 determines whether the print configuration information includes a custom print template; if the printing configuration information does not comprise the custom printing template, judging whether the printing configuration information comprises the custom configuration information; if the printing configuration information comprises the user-defined configuration information, combining the user-defined configuration information with the global configuration information; the print configuration acquisition module 501 generates a target print configuration according to the merged custom configuration information and global configuration information.
In an optional embodiment, if the print configuration information does not include the custom configuration information, the print configuration acquiring module 501 generates the target print configuration according to the global configuration information.
In an optional embodiment, if the print configuration information includes a custom print template, the print configuration acquiring module 501 generates a target print template according to the custom print template.
In an alternative embodiment, the target document object model generation module 502 re-arranges the filtered document object model to generate the target document object model comprises: the target document object model generation module 502 obtains a document object model corresponding to the target print content; converting the parent-child relationship between the document object model and the filtered document object model; the target document object model generation module 502 adds the filtered document object model according to the document object model container fraction to generate a target document object model.
In an alternative embodiment, the converting the target document object model to the target print format according to the target print configuration by the print module 503 comprises: the printing module 503 performs text attribute transformation on the target document object model according to the target printing configuration to generate a target printing format; the text attribute transformation comprises the transformation of text fonts and text formats.
In an alternative embodiment, the target document object model generation module 502 filtering the document object model includes: the target document object model generation module 502 obtains an element with a value of 0 in the document object model; wherein an element with a value of 0 represents an element that ignores printing; the target document object model generation module 502 deletes the element having a value of 0 from the document object model.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. An electronic device 600 provided in an embodiment of the present application includes: a processor 601 and a memory 602, the memory 602 storing machine readable instructions executable by the processor 602, the machine readable instructions when executed by the processor 602 performing the method as above.
Based on the same inventive concept, embodiments of the present application further provide a computer-readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform steps in any of the above-mentioned implementation manners.
The computer-readable storage medium may be a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and other various media capable of storing program codes. The storage medium is used for storing a program, and the processor executes the program after receiving an execution instruction.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, 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.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
Alternatively, all or part of the implementation may be in software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part.
The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.).
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A printing method for browser printing, the method comprising:
reading printing configuration information; wherein the printing configuration information comprises a target printing template and/or a target printing configuration;
judging whether the printing configuration information comprises a custom printing template or not;
if the printing configuration information does not include the custom printing template, acquiring a document object model corresponding to target printing content;
filtering the document object model to obtain a filtered document object model;
rearranging the filtered document object model to generate a target document object model; and
and converting the target document object model into a target printing format according to the target printing configuration, and printing.
2. The method of claim 1, wherein prior to said reading printing configuration information, the method further comprises:
judging whether the printing configuration information comprises a custom printing template or not;
if the printing configuration information does not comprise the custom printing template, judging whether the printing configuration information comprises custom configuration information or not;
if the printing configuration information comprises the user-defined configuration information, combining the user-defined configuration information with the global configuration information;
and generating target printing configuration according to the combined custom configuration information and the global configuration information.
3. The method of claim 2, further comprising:
and if the printing configuration information does not comprise the custom configuration information, generating target printing configuration according to the global configuration information.
4. The method of claim 2, further comprising:
and if the printing configuration information comprises the custom printing template, generating a target printing template according to the custom printing template.
5. The method of claim 1, wherein said rearranging the filtered document object model to generate a target document object model comprises:
acquiring a document object model corresponding to target printing content;
converting the parent-child relationship between the document object model and the filtered document object model;
and adding the filtered document object model according to the proportion of the document object model container to generate a target document object model.
6. The method of claim 1, wherein converting the target document object model to a target print format according to a target print configuration comprises:
performing text attribute transformation on the target document object model according to the target printing configuration to generate a target printing format; wherein the text attribute transformation comprises the transformation of text font and text format.
7. The method of claim 1, wherein the filtering the document object model comprises:
acquiring an element which neglects printing in the document object model; wherein the print-omitted elements include elements having a value of 0 in the document object model;
deleting the print-omitted element from the document object model.
8. A printing system for browser printing, the printing system comprising: the system comprises a printing configuration acquisition module, a target document object model generation module and a printing module;
the printing configuration acquisition module is used for reading a target printing template in the printing configuration information;
the target document object model generation module is used for judging whether the target printing template comprises a custom printing template; if the target printing template does not comprise the custom printing template, acquiring a document object model corresponding to the target printing content; filtering the document object model to obtain a filtered document object model; rearranging the filtered document object model to generate a target document object model; and
and the printing module is used for converting the target document object model into a target printing format according to target printing configuration and printing.
9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
10. A computer-readable storage medium having computer program instructions stored thereon for execution by a processor to perform the steps of the method of any one of claims 1-7.
CN202210827806.2A 2022-07-14 2022-07-14 Printing method and system Pending CN115167790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210827806.2A CN115167790A (en) 2022-07-14 2022-07-14 Printing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210827806.2A CN115167790A (en) 2022-07-14 2022-07-14 Printing method and system

Publications (1)

Publication Number Publication Date
CN115167790A true CN115167790A (en) 2022-10-11

Family

ID=83495968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210827806.2A Pending CN115167790A (en) 2022-07-14 2022-07-14 Printing method and system

Country Status (1)

Country Link
CN (1) CN115167790A (en)

Similar Documents

Publication Publication Date Title
US7673235B2 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
CN109933322B (en) Page editing method and device and computer readable storage medium
JP4669381B2 (en) Map information system, map information processing method and program thereof
CN110705237B (en) Automatic document generation method, data processing device and storage medium
CN111694565A (en) Data visualization application development method and system
JP2008033875A (en) Layering program of cad drawing data, recording medium and device therefor, and layering system therefor, and cad drawing reference data checking device
CN111752565A (en) Interface generation method and device, computer equipment and readable storage medium
CN110347984B (en) Policy page changing method and device, computer equipment and storage medium
CN112417826B (en) PDF online editing method and device, electronic equipment and readable storage medium
CN115167790A (en) Printing method and system
CN115618838A (en) Report generation method and equipment
CN115809652A (en) Method and device for automatically synthesizing red-header file
CN115146602A (en) Method and device for batch generation of infrared thermal image analysis reports based on template
KR20110021714A (en) Method and apparatus for the page-by-page provision of an electronic document as a computer graphic
CN101639866A (en) Operations information management system
CN114564799A (en) Card wiring diagram generation method, system and storage medium
CN113741953A (en) Form processing method and device, electronic equipment and computer storage medium
US9147091B2 (en) Printing barcodes from an enterprise resource planning (ERP) system
CN112528184A (en) Sending method and device of rich text mail, computer equipment and storage medium
JP6388756B2 (en) Electronic manual output system, electronic manual output method, and electronic manual output program
CN112347219B (en) Vector map material library generation method, vector map generation system and electronic equipment
CN111352917A (en) Information input method and device, electronic equipment and storage medium
CN114004211B (en) Document template generation method, processing method, device, computer equipment and medium
CN117540704B (en) Data reverse perspective conversion method, device, equipment and medium of data table
US20050251498A1 (en) Method, computer program and device for executing actions using data sets

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