Document printing method, cloud platform of printing software and computing device
By centrally managing the document printing process of different operating systems on the server side of the printing software, intelligently identifying and matching the printing strategies of the operating system, cross-operating system compatibility issues are solved, efficient and accurate document printing is achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202411821457.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
Existing digital document printing software is difficult to be compatible between different operating systems, resulting in frequent compatibility problems when used across operating systems, poor user experience, and increases the complexity and technical cost of maintaining multiple printing configurations.
By centrally managing the document printing process of different operating systems on the server side of the printing software, intelligently identifying the client's operating system, and accurately matching and calling the corresponding printing strategy from the corresponding printing policies of multiple operating systems, the target printing task that the operating system can successfully execute is generated.
It achieves cross-operating system compatibility, simplifies integration requirements in multi-operating system environments, reduces maintenance costs, improves user experience, and ensures efficient and accurate document printing.
Smart Images

Figure CN119759298A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the technical field of digital information processing, and more particularly to a document printing method, a cloud platform for printing software, and a computing device. Background Art
[0002] With the development of digital information processing technology, digital documents have been widely used in many fields, realizing digital management. For example, in the field of logistics, digital management of package information has been realized, improving distribution efficiency and accuracy. For another example, in the field of medical services, the quality and convenience of medical services have been improved through electronic medical record (EMR) systems and telemedicine services. For another example, in the field of public services, digital documents have simplified service processes and improved the quality and convenience of public services.
[0003] At present, by designing digital document printing software, the printer can be directly called to complete the printing of digital documents, allowing users to quickly and accurately print out paper documents. This not only simplifies the operation process and reduces the possibility of manual errors, but also improves processing speed and user experience.
[0004] However, the printing software for digital documents is usually designed for specific operating systems. Since different operating systems have corresponding interface specifications and driver requirements, the generated printing tasks cannot run interoperably. Clients of different operating systems often need to install the corresponding printing software to successfully realize digital document printing. It is difficult to realize the identification and integration requirements of clients running on multiple operating systems, resulting in frequent compatibility issues when used across operating systems, poor user experience, and increased complexity and technical costs of maintaining multiple printing configurations. Therefore, there is an urgent need for a document printing method that supports a variety of printing strategies to adapt to printing requirements in different operating environments, and can intelligently identify and automatically adapt to the client's operating system, and efficiently generate and execute printing tasks. Summary of the invention
[0005] In view of this, an embodiment of this specification provides a document printing method. One or more embodiments of this specification also involve a cloud platform of printing software, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0006] An embodiment of the present specification provides a document printing method, which is applied to a server of a printing software, including:
[0007] In response to a print instruction for a target document sent by a client of the printing software, a print policy corresponding to the operating system running the client is called from the print policies corresponding to the multiple operating systems to generate a target print task;
[0008] Run the target print task to schedule the target printer on the client to print the target document.
[0009] The document printing process of different operating systems is centrally managed through the printing software server. In response to the printing instruction, the client's operating system is intelligently identified. From the printing policies corresponding to multiple operating systems, the corresponding printing policies are accurately matched and called to generate the target printing task that the operating system can successfully execute, avoiding the problem of complex configuration caused by differences in operating systems and ensuring cross-operating system compatibility. In addition, by generating printing tasks on a unified server, the computing burden of the client is reduced, and the printing efficiency and response speed are improved. It not only simplifies the integration requirements in a multi-operating system environment and reduces maintenance costs, but also enhances the user experience and achieves efficient and accurate document printing. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a flow chart of a document printing method provided by an embodiment of this specification;
[0011] Figure 2 It is a business architecture diagram of printing software in a document printing method provided in one embodiment of this specification;
[0012] Figure 3 It is a system architecture diagram of printing software in a document printing method provided in one embodiment of this specification;
[0013] Figure 4 It is a cloud platform architecture diagram of printing software in a document printing method provided in one embodiment of this specification;
[0014] Figure 5 It is a front-end schematic diagram of a target printing task of a client in a document printing method provided by an embodiment of this specification;
[0015] Figure 6 It is a schematic diagram of a target electronic waybill in a document printing method provided in one embodiment of this specification;
[0016] Figure 7 This is a process flow chart of a document printing method applied to the field of logistics of an e-commerce platform provided by an embodiment of this specification;
[0017] Figure 8 It is a schematic diagram of the structure of a cloud platform of printing software provided by an embodiment of this specification;
[0018] Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0019] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0020] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0021] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0022] In addition, it should be noted that the data involved in one or more embodiments of the present invention are information and data authorized by the user or fully authorized by all parties, and the statistics, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0023] First, the terms involved in one or more embodiments of this specification are explained.
[0024] Desktop: Desktop usually refers to the operating system and applications on a computer or laptop, as opposed to applications on mobile devices. There are multiple operating systems for desktops, such as Windows, macOS, and Linux. They provide a user interface, file management, and a variety of software applications, suitable for handling complex tasks and multitasking.
[0025] Electronic waybills: Electronic waybills are a type of digital logistics label used in the logistics and e-commerce industries. Compared with traditional paper waybills, electronic waybills are automatically generated and printed by the system, which can improve efficiency and accuracy.
[0026] Tauri framework: used to build lightweight and efficient cross-platform desktop applications. It allows developers to use front-end technologies such as HTML, CSS and JavaScript, combined with the Rust backend, to create native desktop applications compatible with multiple operating systems.
[0027] SumatraPDF is an open source lightweight document reader library that is mainly used to parse and render multiple document formats (such as PDF, ePub, MOBI, etc.). The following is a detailed introduction to the SumatraPDF library, including its storage location, storage content, interaction mode, and specific initialization and printing function implementation. The SumatraPDF library and its related files are usually stored in the following locations: System temporary directory: At runtime, SumatraPDF will store necessary executable files (such as sm.exe) in the system's temporary directory to solve printing compatibility issues between different Windows versions (such as Windows 7 to Windows 10). Example path: C:\Users\username\AppData\Local\Temp\. The SumatraPDF library mainly stores the following: Core library files: Contains core code and dependent libraries for parsing and rendering documents, such as mupdf for PDF parsing. Auxiliary executable files: such as sm.exe, used to handle specific printing tasks to ensure printing compatibility on different Windows versions. Configuration files: Store user settings and application configurations, such as print settings, interface preferences, etc. Temporary files: Temporary data generated when processing documents, such as rendering cache, print output, etc. Log file: records the log information of the application during runtime to facilitate debugging and troubleshooting.
[0028] In this specification, a document printing method is provided. This specification also involves a cloud platform for printing software, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0029] See also Figure 1 , Figure 1 A flowchart of a document printing method provided by an embodiment of the present specification is shown. The method is applied to a server of a printing software and includes the following specific steps:
[0030] Step 102: In response to a print instruction for a target document sent by a client of the printing software, a print policy corresponding to the operating system running the client is called from the print policies corresponding to multiple operating systems to generate a target print task.
[0031] Printing software is a computer program that generates and runs printing tasks to call printers to print documents. For example, an e-commerce platform's self-developed electronic waybill printing software. Another example is a logistics platform's electronic waybill printing software. Another example is a hospital's electronic medical record printing software. Another example is a public service agency's document printing software. Another example is a multi-platform compatible enterprise-level document printing system.
[0032] Take the electronic waybill printing in the logistics field as an example. Figure 2 The following is a business architecture diagram of printing software in a document printing method provided by an embodiment of this specification:
[0033] The business architecture of printing software includes core business processes, basic guarantees, operational support, basic capabilities and data support:
[0034] The core processes of merchants include: Electronic waybill activation: the activation process when merchants use the electronic waybill service for the first time. Waybill account management: management of electronic waybill account related operations, such as account information maintenance. Waybill template setting: setting the template of the electronic waybill, including format, content, etc. Printing component download: downloading components or software for printing electronic waybill. Print waybill shipment: printing electronic waybill and shipping.
[0035] Among them, basic guarantees include: System monitoring: monitoring the system operation status to ensure the stability and security of the system. System warning: issuing warnings when the system is abnormal so as to deal with it in time. System plan: formulating emergency plans in case of system failure to ensure business continuity. Quality assurance: ensuring the quality of electronic waybill printing, including print clarity, information accuracy, etc.
[0036] Among them, operational support includes: Account management: manage the account information of the electronic waybill account. Template management: manage the templates of the electronic waybill, including the creation, modification and deletion of templates. Branch management: manage the branch information of the electronic waybill printing, including the addition, modification and deletion of branches.
[0037] Among them, basic capabilities include electronic waybill accounts, electronic waybill orders and electronic waybill printing.
[0038] Electronic waybill accounts include: System monitoring: monitoring the operating status of electronic waybill accounts. System warning: issuing warnings when an abnormality occurs in the account. System contingency plan: formulating emergency plans in case of account failure.
[0039] Placing an electronic waybill includes: Importing a waybill template: importing an electronic waybill template. Setting a waybill template: setting an electronic waybill template. Checking the inventory of electronic waybills: checking the inventory of electronic waybills to ensure that there are enough waybills available. Obtaining the number of an electronic waybill: obtaining the number of an electronic waybill. Previewing an electronic waybill: previewing the content of an electronic waybill. Querying an electronic waybill: querying the status and information of an electronic waybill. Circle the waybill privacy: select the waybill information that needs to be protected. Recycling an electronic waybill: recycling unused electronic waybills.
[0040] Electronic waybill printing includes: Printing software client: Printing software client installed on user equipment. Printer: used to print electronic waybill.
[0041] Among them, data support includes: Electronic waybill account: stores the relevant data of the electronic waybill account. Waybill inventory: stores the inventory information of the electronic waybill. Logistics outlets: stores the relevant information of the logistics outlets. Waybill template: stores the template data of the electronic waybill. Electronic waybill: stores the specific information of the electronic waybill, including the waybill content, status, etc.
[0042] like Figure 2 The business architecture shown is designed to support functions such as electronic waybill template editing, printer management, and print task management. The Tauri framework and the self-developed Ditto engine, combined with the underlying technology of the printing end, realize the whole process from template editing to printing.
[0043] Corresponds to Figure 2 The business architecture shown, Figure 3 The following is a system architecture diagram of printing software in a document printing method provided by an embodiment of this specification:
[0044] At the application layer (front end), it includes printing software and the cloud platform of printing software.
[0045] The printing software has the following features: the Tauri framework is used in combination with the front-end architecture; the client installation process; the Windows operating system installation system; the clear MacOS operating system installation process; the C++ back-end service communication protocol; the Windows version support; the client calling instructions.
[0046] The printing software includes print log management, printer management, and print task management. Print log management: provides logging of past printing activities, which is helpful for troubleshooting and performance evaluation. Printer management: users can add, remove, or edit connected printers through this module. Print task management: allows users to create new print tasks, manage existing print queues, and pause, cancel, or reorder print tasks.
[0047] It has the following advantages: 1. Lightweight and high performance: The applications generated by Tauri are small in size and start quickly, reducing the waiting time for users. Cross-platform support: Code can be written once and deployed to multiple operating systems such as Windows, macOS, and Linux, reducing development costs and expanding user coverage. Security: Built-in security measures help protect applications from malicious attacks. Low resource consumption: Optimized applications take up less memory and CPU resources, improving the overall performance of the device. Signature system compliance: Ensure that the application meets the security requirements of each operating system, especially in the Windows environment. Release pipeline: A complete CI / CD process has been established, which is automated from code submission to final product delivery to ensure the quality and stability of each release.
[0048] The cloud printing platform includes template editor, template list management, and preview and export. Template editor: provides a graphical interface for users to customize the format of electronic waybills, supporting drag-and-drop components such as text boxes, barcodes, and image uploads. Template list management: users can browse, search, and manage their saved templates. Preview and export: before final printing, users can check the template effect through the real-time preview function and export the completed template to the required file format.
[0049] Among them, the template editor has the following features: using Ditto's components (horizontal, vertical, picture upload and other components); Ditto's low-code configuration capability; -Ditto's real-time preview capability; Ditto's visual Canvas generation capability.
[0050] At the client layer (middle layer), it includes printer list, printer configuration, print task execution, printer status monitoring, and print log. Printer list: dynamically obtain the current list of available printers. Printer configuration: adjust printer parameters according to user selection. Print task execution: send print instructions to the specified printer and track task progress. Printer status monitoring: continuously monitor the status of the printer, such as ink level, paper remaining, etc., and provide timely feedback to the user. Print log: synchronize local log information to the cloud for remote management and analysis.
[0051] The service layer (backend) includes template management service, print task service, log management service and user management service. Template management service: handles all operations related to templates. Print task service: responsible for creating, assigning and tracking print tasks. Log management service: centrally collects and stores log data from clients. User management service: maintains user account information and permission settings.
[0052] In the data layer (database), it includes template database, print task database, log database and user database. Template database: stores all templates created by users and their version history. Print task database: records the details of each print task, including the timestamp of status change. Log database: accumulates various log entries generated during system operation. User database: stores the personal information and authentication information of registered users.
[0053] The underlying system (driver layer) includes C++ printer drivers, system API calls, and USB printer communication protocols. C++ printer drivers: write drivers specific to different printer models to achieve optimal compatibility. System API calls: use the interfaces provided by the operating system to control peripheral devices. USB printer communication protocol: defines a standard method for exchanging information with a printer through a USB port.
[0054] like Figure 3 The system architecture shown not only improves the performance and stability of the system, but also significantly reduces development costs and manpower investment, providing users with efficient and reliable printing solutions.
[0055] The server of the printing software is used to centrally manage the digital document printing process of different operating systems, and after receiving the printing instruction sent by the client of the printing software, it generates and runs the printing task adapted to the operating system used to run the client, completes the printing of the digital document, and obtains the paper document. The server has the compatibility of the platform across operating systems, and can intelligently identify and adapt to the printing requirements under various operating system environments to ensure that the digital document can be successfully printed. The server can be a server running on a cloud network, that is, a cloud platform. For example, on the cloud platform of the self-developed electronic waybill printing software of the e-commerce platform, after receiving the printing instruction sent by the client running the Windows system, the cloud platform will detect that the client's operating system is a Windows system, and call the corresponding Windows printing policy for it to generate and run the printing task.
[0056] Take the electronic waybill printing in the logistics field as an example. Figure 4 The following is a cloud platform architecture diagram of printing software in a document printing method provided by one embodiment of this specification:
[0057] The printing interface of the Powershell printing software on the cloud platform encapsulates the electronic document printing method xhs_electronic_print::print that is compatible with multiple operating systems, and the electronic waybill printer acquisition method xhs_electronic_print::getprinter that is compatible with multiple operating systems.
[0058] It also includes printing policy modules for multiple operating systems, including a printing policy module for MacOS operating system, a printing policy module for WIN7 operating system, and a printing policy module for WIN10 operating system.
[0059] Among them, in the printing policy module of the MacOS operating system, the lp command prints the PDF file, and the complete command line is executed through sh-c: lpstat-o: Get the printer status. lpstat-p: Get the printer queue.
[0060] In the printing policy module of the WIN7 operating system, WMI (Windows Management Instrumentation) is used to query the Win32_Printer class to obtain the printer information class, and an external tool (such as sm.exe) is used to execute printing through Powershell: Get-Host: used to return the information of the current host. whoaml / groups: displays the authentication information of the current user and the group to which he belongs.
[0061] In the printing policy module of the WIN10 operating system, Select-ObjectName, DriverName, JobCount, ... | ConverTo-Json automatically deconstructs the printer information, and uses external tools (such as sm.exe) to execute printing through Powershell: Get-Printer: Get printer information. Get-Job: Get print tasks.
[0062] Taking sm.exe as an example, it explains how the electronic waybill interacts with external tools such as the SumatraPDF library:
[0063] API call: Use the core API provided by SumatraPDF to load, render and print documents. For example, calling the print_pdf_compatible_mode function can implement PDF printing in compatible mode.
[0064] Command line interface: SumatraPDF supports operations through command line parameters, such as printing specified documents, setting print options, etc. For example, use SumatraPDF-prerel-64.exe-print-to "PrinterName" "DocumentPath.pdf" to print.
[0065] Automation script: Use PowerShell script to call SumatraPDF to achieve batch processing and automation tasks. In the code example provided, the print command is executed through the PowerShell script and the execution results are recorded.
[0066] The specific function analysis is as follows:
[0067] This article takes the code snippet provided by the user as an example to explain in detail how to initialize the SumatraPDF environment and implement the PDF printing function in compatibility mode:
[0068] Initialization function init_windows:
[0069]
[0070] Function description: Purpose: Initialize the Windows environment and ensure that the sm.exe file is correctly stored in the system's temporary directory to solve the printing compatibility problem between multiple versions from Windows 7 to Windows 10. Storage location: Store sm.exe in the system's temporary directory (env::temp_dir()) to ensure that different Windows versions can correctly call the executable file when printing. Storage content: sm.exe is an auxiliary executable file used to process printing tasks to ensure the compatibility and stability of the printing process on different Windows versions. Error handling: If the sm.exe file cannot be created, the function will record an error log and return a custom error to prevent subsequent printing tasks from failing.
[0071] The printing function is reflected in:
[0072] Windows 7 Compatibility Mode Printing:
[0073]
[0074] Windows 10 compatibility mode printing (asynchronous):
[0075]
[0076] Functional description: Storage location: Print commands and related temporary files are stored in the system's temporary directory to ensure fast and secure operations. Storage content: Print commands and their parameters, print result record files (such as print_pdf_output.txt), execution logs, etc. Interaction method: By building and executing PowerShell scripts, calling sm.exe or SumatraPDF-prerel-64.exe to implement the printing function. Use asynchronous tasks (async) to improve the responsiveness and efficiency of printing operations. Compatibility processing: Different Windows versions (such as Windows 7 and Windows 10) use different print commands and execution files to ensure stable operation of the printing function on each version.
[0077] Error handling and logging: Detailed records of the time and results of each operation are provided to facilitate debugging and optimization. When printing fails, specific error information is returned to help developers quickly locate the problem.
[0078] Taking Mac as an example, the core shell scripts are: get_printers_macos: Get and return the list of printers in the system, and output it as a string in JSON format. get_jobs_macos: Get the list of print jobs for the specified printer, and output it as a string in JSON format. print_pdf_macos: Send a PDF print job to the target printer, and get and process the preview result.
[0079] The printing interface can complete the error reporting and ensure the calling performance to the front end: Reduce the calling performance to the front end: Use rayon::prelude::* for data parallel processing to improve performance. Data parallelism: Partition operation: Use std::thread::spawn to support basic thread support and improve concurrent processing capabilities.
[0080] Communication protocols for Windows and MacOS: ensuring cross-platform compatibility.
[0081] Print drivers for Windows and MacOS: Windows: Use standard Windows printer drivers, which can be installed and configured through the Control Panel or Device Manager, and support multiple connection methods such as USB and network connections. MacOS: Use CUPS (Common UNIX Printing System) and built-in drivers to support a wide range of printer models, and printers can be added through System Preferences.
[0082] The user interacts with the server through the client software, which can be a web page, desktop application or mobile application. The client of the printing software is the client of the printing software installed on the operating system of the user's device, which is used to initiate printing instructions and interact with the server to complete the printing of electronic waybills. The client can run on a variety of different operating systems, such as Windows, MacOS, Linux, etc., and communicate with the server through the network. For example, an employee of a logistics company installed the client of the electronic waybill printing software provided by the e-commerce platform on his computer with Mac operating system to print electronic waybills.
[0083] The target document is a digital document that needs to be printed, containing a variety of necessary information. For example, an electronic waybill includes sender information, recipient information, barcode, etc. Electronic waybill is a tool for logistics technology to achieve digital information management, which improves the efficiency and accuracy of automated sorting and distribution in the subsequent logistics process. An electronic waybill in PDF format sent to a certain place includes the sender's address information, recipient's address information, barcode and other necessary logistics information.
[0084] A print instruction is a request instruction for printing a target document initiated by the client of the user's printing software. When a user needs to print a digital document, he or she can interact with the printing software client through a graphical interface or command line tool to submit and send a print instruction. The print instruction contains necessary information, such as the attribute parameters of the target document to be printed, the information of the target printer, the client identification, etc. For example, an e-commerce seller uses the client of the printing software provided by the e-commerce platform on a Windows computer, selects an electronic waybill to be printed, and clicks the "Print" button, which triggers a print instruction to be sent to the cloud platform.
[0085] The operating system is a system software used to manage and coordinate computer hardware and software resources on the client side of the printing software. The operating system provides a running environment for the client side of the printing software and serves as an interface between the user and the computer hardware. The operating system determines which printer drivers and services can be used on the client device and how to interact with the server to complete the printing task. Different operating systems have corresponding interface and API (Application Programming Interface) specifications, file system structures, process management methods, and memory management mechanisms, which affect the working and implementation methods of the printing software. Including but not limited to: Windows 7 operating system, Windows 10 operating system and MacOS operating system. Among them, the Windows operating system supports a wide range of printer connection methods, such as USB, network, etc., and provides a graphical interface and command line tools to manage printers. The MacOS operating system uses CUPS to manage printing services, supports multiple printer models, and allows printers to be added or configured through system preferences.
[0086] Print policies corresponding to multiple operating systems are rules and methods pre-set by the server to adapt to the characteristics of different operating systems. Print policies cover various processes from how to obtain a printer list to how to submit a print task and monitor the print status. It should be noted that each operating system has its own unique interface specifications and technical requirements, so customized printing policies are required to ensure that the print task can be correctly executed under the operating system. By maintaining multiple printing policies, the server can intelligently identify the client's operating system and select the appropriate policy to generate the target print task, thereby ensuring cross-platform compatibility and successful execution of the print task. For example, MacOS printing policy module: use the lp command line tool to print PDF files, use lpstat-o to obtain printer status, and use lpstat-p to obtain the printer queue. Another example is Windows7 printing policy module: use WMI to query the Win32_Printer class to obtain printer information, and execute the print task through a Powershell script. Another example is Windows 10 printing policy module: use the Get-Printer command of Powershell to obtain printer information, and use Start-PrintJob or similar commands to start the print task.
[0087] The target printing task is a specific printing work item generated by calling the printing strategy corresponding to the operating system running the client. The target printing task contains the parameters and configuration of the printing target server, which can be correctly parsed and executed in the operating system running the client to achieve successful printing on the target server. The target printing task ensures that no matter which operating system the client runs on, the printing operation can be completed consistently, and has cross-platform compatibility. The target printing task not only contains the target server to be printed, but may also include parameters and configurations such as printer name, document path, and paper size.
[0088] For example, on the client side of the printing software of the e-commerce platform, the user introduces an interface in the main module and initiates a printing instruction through the following code:
[0089]
[0090]
[0091] Among them, printer_name: the name of the printer. path: the file path to be printed. printer_setting: customized print settings. remove_after_print: Boolean value, whether to delete the file after printing.
[0092] The specific printing instructions in JSON format are:
[0093]
[0094]
[0095] In response to the print command sent by the client of the printing software, the printing policies corresponding to the three operating systems are selected: MacOS printing policy module: Use the lp command line tool to print PDF files, use lpstat-o to obtain the printer status, and use lpstat-p to obtain the printer queue. Windows7 printing policy module: Use WMI to query the Win32_Printer class to obtain printer information, and execute the printing task through the Powershell script. Windows 10 printing policy module: Use the Get-Printer command of Powershell to obtain printer information, and use Start-PrintJob or similar commands to start the printing task.
[0096] The printing strategy corresponding to the above operating system is called to generate a target printing task.
[0097] The printing software server centrally manages the printing of documents of different operating systems. In response to the printing instruction, it intelligently identifies the operating system of the client, and accurately matches and calls the corresponding printing strategy from the printing strategies corresponding to multiple operating systems to generate the target printing task that the operating system can successfully execute, avoiding the complex configuration problems caused by differences in operating systems and ensuring the compatibility across operating systems.
[0098] Step 104: Run the target printing task and schedule the target printer on the client to print the target document.
[0099] The target printer is a physical or virtual printer used to perform the target printing task. The selection of the target printer is based on the user's configuration on the printing software client and the printing policy adapted by the server according to the client operating system. Features: The target printer may have different connection methods (such as USB, network) and support various types of printing tasks (such as PDF files, image files, etc.). The server of the printing software usually provides status monitoring functions for the target printer, including information such as ink level, paper remaining, error reporting, etc., to ensure that the printing task can be completed smoothly. Once the target printer is selected, the print task is sent to the target printer through the print driver, and the task progress can be viewed, paused, canceled or reprinted through the client interface.
[0100] Take the electronic waybill printing in the logistics field as an example. Figure 5 A front-end schematic diagram of a target printing task of a client in a document printing method provided by an embodiment of this specification is shown:
[0101] On the client graphical interface of the electronic waybill printing software, a navigation bar is set on the left, including a printer list and a print test. On the printer list page, printer model 1, Windows 10 print plug-in 1, Windows 10 print plug-in 2, Windows 10 print plug-in 3, view messages, refresh printers and operation guides are displayed. On the printer list page, a "Delete Record" button and a "Set" button are set. On the printer list page, a print task list is displayed, including the task number (WORK, 13...), printer name (printer model 1), task status (print instruction is issued successfully), document address (view), operator (-), number of documents (1), creation time (2024-09-0419:17:44, 2024-09-0419:22:58, 2024-09-0419:23:34), and multiple operation controls: view, refresh, preview, reprint, delete.
[0102] For example, if the operating system is Windows 7, the target printing task is run to schedule the target printer on the client to print the target electronic waybill:
[0103] Use env::temp_dir() to get the system's temporary directory path and log it to show the temporary directory location of the print file. Generate the -print-to parameter based on the id (printer ID) in the passed PrintOptions parameter to specify the printer target. Combine the printer ID and PDF file path into a complete PowerShell command string shell_command. Use Command::new("powershell") to create a new PowerShell process and execute the command through args(&["-Command",&shell_command]) to interpret PowerShell as a command line operation. If the command fails to execute (that is, the PowerShell process cannot be started), capture the error and return the error information of the execution failure. If the command is executed successfully (output.status.success() is true), log the "preview successful" information. According to the remove_after_print parameter in PrintOptions, determine whether to delete the PDF file after printing is completed: if true, call remove_file(&options.path) to delete the file and log the successful deletion of the file. If the file deletion fails, capture the error and return the detailed failure reason. Returns the success message "Windows7-Preview successful", indicating that printing is complete. If the print command fails to execute, the "Preview failed" log message is recorded, and the error string "Windows-Preview failed" is returned to facilitate handling of preview failure in the upper logic. The specific Rust code is as follows:
[0104]
[0105] If the operating system is MacOS, run the target printing task to schedule the target printer on the client to print the target electronic waybill:
[0106] The function receives four parameters: id (printer ID), path (PDF file path), print_setting (print settings), and remove_after_print (whether to delete the file after printing). The parameters are encapsulated into a PrintOptions structure to facilitate unified management and transmission of printing information. The paper size is set to "Custom.76x130mm" through the media_size variable, which is the specified custom paper size. A command parameter list args is created, including: -d parameter, used to specify the printer ID. -o parameter, used to configure the paper size. File path, used to specify the PDF file to be printed. The file path and executed commands are recorded for debugging. The output information includes detailed parameters of the print command (for example: lp -d <id>-o media=Custom.76x130mm <path>). Use sh-c to execute the lp print command. Create a new command through Command::new("sh") and call .arg("-c").arg(format!("lp{}",args.join(""))) to execute it. Capture the output of the command execution through output() to check whether the printing is successful. If the preview is successful (that is, output.status.success() is true), record the success log and return Ok(()). If it fails, extract the error information in stderr, convert it to a string and record it, and finally return the error information for capture in the application. If the command execution fails (such as sh cannot run), capture and record the error information, and return the error description string to avoid application crashes and facilitate problem diagnosis. The specific Rust code is as follows:
[0107]
[0108]
[0109] The printed target electronic waybill, such as Figure 6 As shown, Figure 6 A schematic diagram of a target electronic bill in a document printing method provided in one embodiment of this specification is shown:
[0110] The target electronic waybill contains the following information: order number, barcode, date and time, delivery code, logistics information, address information, product information and remarks. Date and time: September 20, 2024, 15:34:55. Delivery code: XXXXXXXXXX. Logistics information: There is a line of text "YYYY transit logistics point" below the barcode. Address information: There are "sender address information" and "recipient address information" on the label. Product information: "Product 1" and "Product 2" are listed below the label. Remarks: There are "sender product remarks" and "recipient product remarks" at the bottom of the label.
[0111] In the embodiments of this specification, the document printing of different operating systems is centrally managed through the server of the printing software. In response to the printing instruction, the operating system of the client is intelligently identified. From the printing policies corresponding to multiple operating systems, the corresponding printing policies are accurately matched and called to generate the target printing task that the operating system can successfully execute, avoiding the problem of complex configuration caused by differences in operating systems and ensuring cross-operating system compatibility. In addition, by generating printing tasks on a unified server, the computing burden of the client is reduced, and the printing efficiency and response speed are improved. Not only does it simplify the integration requirements in a multi-operating system environment and reduce maintenance costs, it also enhances the user experience and achieves efficient and accurate document printing.
[0112] In an optional embodiment of the present specification, in step 102, the printing policy corresponding to the operating system running the client is called from the printing policies corresponding to multiple operating systems, and before generating the target printing task, the following specific steps are also included: based on the client identifier of the client, the operating system running the client is determined.
[0113] The client identifier of the client is label information for identifying the operating system running the printing software client. The client identifier is usually automatically determined by the compiler according to the operating system environment at compile time, allowing developers to write conditional compilation code to ensure that the code is only compiled and run on a matching target operating system. The client identifier includes, but is not limited to: operating system type identifier (such as windows, macos, linux, etc.), architecture type identifier (such as x86, x86_64, arm, aarch64, etc.). For example, in the Rust language, #[cfg(...)] is a conditional compilation attribute that can determine the corresponding printing strategy (module) according to different operating systems. target_os is one of the configuration keys that can be used to specify the target operating system. By setting target_os to a specific value, such as "windows", "macos", etc., the operating system can be checked at compile time and the code can be compiled accordingly, for example, #[cfg(target_os="windows")], #[cfg(target_os="macos")].
[0114] Exemplarily, the conditional compilation instructions provided by the Rust language: #[cfg(target_os="windows")] and #[cfg(target_os="macos")] are used to determine the operating system running the client based on the client identifier of the client.
[0115] During the implementation of this manual, the operating system running the client is determined based on the client identification, and the printing policy of the corresponding operating system is called to generate the target printing task more intelligently and efficiently, which not only enhances the cross-platform compatibility and stability of the application, but also improves the user experience.
[0116] In an optional embodiment of the present specification, determining the operating system running the client based on the client identification of the client includes the following specific steps: determining the type of the operating system running the client based on the client identification of the client; when the type of the operating system is the first type, calling the kernel version number identification function to identify the version number of the operating system, and determining the operating system running the client based on the version number; when the type of the operating system is the second type, calling the conditional compilation instruction to detect the operating environment of the operating system to determine the operating system running the client.
[0117] Different operating system types differ in terms of API support, system calls, file system structure, and user interface, which affect the behavior and compatibility requirements of printing software. Operating system types include, but are not limited to: Windows type, MacOS type. For example, Windows type operating systems provide a unique Windows API set, support specific registry configurations, and usually use the NTFS file system; while MacOS type is based on Unix, provides POSIX-compatible APIs, uses HFS+ or APFS file systems, and has unique user interfaces and system services.
[0118] The first type is the type of operating system that needs to be additionally identified as a version number, usually because there are significant differences between different versions of these operating systems, which affects the behavior or compatibility of the application. For example, Windows types include multiple versions such as Windows 7, Windows 8, and Windows 10. Since each version may have different API support or other features, it is necessary to further identify the specific version number.
[0119] The second type is the type of operating system that does not require additional identification of specific version numbers, and can be determined by simply detecting the operating environment through conditional compilation instructions. For the second type of system, because the changes between different versions are relatively small, or the API consistency across versions is high, it is only necessary to confirm that it is running on this type of operating system, and it is not necessary to be precise to the specific version number. For example, MacOS type: Although MacOS also has multiple versions, the consistency and stability of its API means that in most cases it is sufficient to know that it is running on MacOS, without having to delve into specific version information.
[0120] The version number of an operating system is a set of numbers or strings used to identify a specific version of an operating system. It usually includes information such as the major version number, minor version number, and build number. The version number is the basis for distinguishing different versions of the same type of operating system, especially when there are functional differences or incompatibilities between the new and old versions. Accurately identifying the version number can help developers provide more refined control and support. The major version number of Windows 7 is 6.1, while the major version number of Windows 10 is 10.0.
[0121] The kernel version identification function is an API or library function used to obtain the operating system kernel version information. The data structure returned by the kernel version identification function contains detailed information about the operating system version. For example, the RtlGetVersion API function, through the structure OSVERSIONINFOEXW provided by RtlGetVersion, the system can read the major version number (dwMajorVersion), minor version number (dwMinorVersion) and internal version number (dwBuildNumber) and other version numbers.
[0122] Conditional compilation instructions are programming language instructions that allow part of the code to be selectively compiled based on certain preset conditions. When writing cross-operating system software, conditional compilation instructions can adapt the same source code to different operating systems. For example, #[cfg(target_os="macos")] in the Rust language controls the compiler to compile the code content immediately following the conditional compilation instruction only when the operating system is macOS.
[0123] Exemplarily, during the compilation stage, the type of the currently compiled operating system is determined to be Windows or MacOS through conditional compilation instructions (such as #[cfg(target_os="windows")] or #[cfg(target_os="macos")] in Rust). If the type of the operating system is Windows, an auxiliary function is_windows_7_or_newer() is written, which calls the kernel version number identification function (such as WindowsAPI RtlGetVersion) and determines whether the current version is Windows 7 or later based on the returned major version number (dwMajorVersion) and minor version number (dwMinorVersion). If the major version number>6 or (major version number=6 and minor version number>1), it is judged to be Windows 7 or later. Use the conditional compilation instruction "#[cfg(target_os="macos")]" to detect the operating system environment. When a MacOS environment is detected, a printing strategy compatible with MacOS is automatically selected without relying on Windows-specific API support.
[0124] In the embodiments of this specification, based on the client identifier, the type of operating system is determined and combined with conditional compilation instructions and kernel version number identification functions, the corresponding printing strategies can be accurately matched on operating systems of different versions and operating environments, significantly enhancing the stability of the printing software.
[0125] In an optional embodiment of the present specification, in step 102, the printing policy corresponding to the operating system running the client is called to generate a target printing task, including the following specific steps: when the operating system is of the first type and the version number is the first version number, the printing function interface of the operating system is used to query the printer information on the operating system; the printer information is converted into a string for constructing a first type of operating system management script, and the string is saved to a temporary file path of the target document on the operating system; the operating system management script is used to encapsulate the temporary file path to generate a target printing task.
[0126] The print function interface of the operating system is an application programming interface (API) that provides a print function on the operating system of the first type and version number, the first version number, and is used to manage and control the printer and execute print tasks. The print function interface of the operating system allows the printing software to query, configure and manage the printer, and send print tasks to the printer to complete the call. For example, the Win32_Printer interface in winapi.
[0127] Printer information on the operating system is information about physical or virtual printers connected to the operating system, including but not limited to printer name, model, status, location, driver version, supported features, etc. Printer information specifies which printers are available, what their status is, and whether any specific actions need to be taken to prepare or optimize the print job. For example,
[0128] letprinters_output=String::from_utf8_lossy(&output.stdout);
[0129] info! ("[Desktop win7] Successfully obtained the Windows printer list: {}", printers_output);
[0130] The string of the first type of operating system management script is a code or command sequence written for a specific operating system. The script is used to perform a series of management tasks, including but not limited to querying printer information, configuring printer settings, generating print tasks, etc. The string of the operating system management script is in a format that can be recognized and executed by the operating system management script, such as the JSON format that can be recognized and executed by the Powershell script of the Windows 7 operating system. For example,
[0131]
[0132] The temporary file path of the target document on the operating system is the location of the temporary file created by the printing software in the operating system, which is used to store the intermediate results of the target document printing process, such as the output results of the printer information. This path is usually a file name in a directory specified by the application. A common practice is to create a subdirectory in the system's temporary folder and place the required temporary files in it to avoid conflicts with other applications and facilitate the cleanup of no longer needed files. For example,
[0133] let temp_dir="C:\\temp\\";
[0134] let temp_file_path="C:\\temp\\printers_output.txt"; /
[0135] Exemplarily, when the operating system is of Windows type and the version number is Windows 7, the print function interface of the operating system (WMI interface in Windows API) is used, and the query statement SELECT * FROM Win32_Printer is used to query the printer information on the operating system. The printer information is filtered through the pipeline operator (|) to ensure that the printer name is not empty, and the printer's Name, DriverName, JobCount, PrintProcessor and other information are selected, and the printer information is converted into a JSON string for building a Windows type operating system management script (Powershell script), and the JSON string is saved to the temporary file path (temp_file_path) of the target electronic waybill on the operating system. The Powershell script is converted to UTF-16LE byte format and further encoded using Base64 so that the Powershell script can be executed through the Powershell-EncodedCommand parameter. Check and create a temporary directory temp_dir for storing script output files. If the directory creation fails, record the error and return the corresponding error message. Convert the Powershell command string to the CString type so that it can be passed to the Windows API CreateProcessA function for execution. Configure the STARTUPINFOA structure to hide the Powershell window to avoid window pop-ups when running the script. Use the CreateProcessA function to create a new process to execute the encoded Powershell command and capture the returned PROCESS_INFORMATION structure. If the process creation fails, log the error message, release the memory and return the error. Use the WaitForSingleObject function to wait for the Powershell command to complete and ensure that the printer information has been successfully written to the output file. Release the handle resources related to the process to avoid memory leaks. Open and read the Powershell output in the temp_file_path file and convert it to a UTF-8 string. Record the log of successfully obtaining the printer list and return a JSON string of the printer information. If the file read fails, log the error message and return the error string. Use the operating system management script to encapsulate the temporary file path and generate the target printing task. The specific Rust code is as follows:
[0136]
[0137]
[0138]
[0139] In the embodiments of the present specification, the operating system type and version are determined based on the client identifier, and the printing function interface is used to query printer information and the operating system management script executes the printing policy, which significantly enhances the compatibility and stability of the printing software, ensures successful printing behavior under the first type of operating system and its first version, and realizes efficient printer management and control.
[0140] In an optional embodiment of the present specification, in step 102, the printing policy corresponding to the operating system running the client is called to generate a target printing task, including the following specific steps: when the operating system is of the first type and the version number is the second version number, the object attribute selection command of the first type of operating system management script is used to parse and obtain the printer information on the operating system; the printer information is converted into a string for constructing the operating system management script, and the string is saved to the temporary file path of the target document on the operating system; the operating system management script is used to encapsulate the temporary file path to generate the target printing task.
[0141] The object attribute selection command of the first type of operating system management script is a command used in the first type of operating system to extract and filter out the specified attribute object from the object collection. The object attribute selection command is usually used to process and operate the data objects returned by the system API, such as printer information, service status, etc. For example, Select-ObjectName, DriverName, JobCount, ...|ConverTo-Json automatically deconstructs the printer information. In the Windows PowerShell environment, Select-Object is an object attribute selection command that can select specific attributes from one or more input objects and output the results as a new object list. For print task generation, the Select-Object command can be used to select attributes directly related to printing, such as printer name (Name), driver version (DriverName), current job number (JobCount), etc., so as to build a more streamlined and effective print task configuration. In addition, combined with commands such as ConvertTo-Json, the selected object attributes can also be converted into JSON format strings for further storage or transmission.
[0142] Printer information on the operating system is information about physical or virtual printers connected to the operating system, including but not limited to printer name, model, status, location, driver version, supported features, etc. Printer information specifies which printers are available, what their status is, and whether any specific actions need to be taken to prepare or optimize the print job. For example,
[0143] let printers_output=String::from_utf8_lossy(&output.stdout);
[0144] info! ("[Desktop win10] Successfully obtained the Windows printer list: {}", printers_output);
[0145] The string of the first type of operating system management script is a code or command sequence written for a specific operating system. The script is used to perform a series of management tasks, including but not limited to querying printer information, configuring printer settings, generating print tasks, etc. The string of the operating system management script is in a format that can be recognized and executed by the operating system management script, such as the JSON format that can be recognized and executed by the Powershell script of the Windows 10 operating system. For example,
[0146]
[0147] The temporary file path of the target document on the operating system is the location of the temporary file created by the printing software in the operating system, which is used to store the intermediate results of the target document printing process, such as the output results of the printer information. This path is usually a file name in a directory specified by the application. A common practice is to create a subdirectory in the system's temporary folder and place the required temporary files in it to avoid conflicts with other applications and facilitate the cleanup of no longer needed files. For example,
[0148] let temp_dir = "C:\\temp\\";
[0149] lettemp_file_path="C:\\temp\\printers_output.txt"; /
[0150] Exemplarily, when the operating system is of Windows type and the version number is Windows 10, the printer query command of the second type of operating system is called (Select-ObjectName, DriverName, JobCount, ... automatically deconstructs the printer information), the printer information on the operating system is queried, and the printer information is filtered through the pipeline operator (|) to ensure that the printer name is not empty. Through ConverTo-Json, the printer information is converted into a JSON string for building a Windows type operating system management script (Powershell script), and the JSON string is saved to the temporary file path (temp_file_path) of the target electronic waybill on the operating system. The Powershell script is converted to UTF-16LE byte format and further encoded using Base64 so that the Powershell script can be executed through the Powershell-EncodedCommand parameter. Check and create a temporary directory temp_dir for storing script output files. If the directory creation fails, record the error and return the corresponding error message. Convert the Powershell command string to a CString type so that it can be passed to the WindowsAPICreateProcessA function for execution. Configure the STARTUPINFOA structure to hide the Powershell window to avoid window pop-ups when running the script. Use the CreateProcessA function to create a new process to execute the encoded Powershell command, and capture the returned PROCESS_INFORMATION structure. If the process creation fails, record the error message, release the memory and return the error. Use the WaitForSingleObject function to wait for the Powershell command to complete and ensure that the printer information has been successfully written to the output file. Release the handle resources related to the process to avoid memory leaks. Open and read the Powershell output in the temp_file_path file and convert it to a UTF-8 string. Record the log of successfully obtaining the printer list and return a JSON string of the printer information. If the file read fails, record the error message and return the error string. The specific Rust code can be found in the above embodiment, which will not be repeated here.
[0151] In the embodiments of the present specification, the operating system type and version are determined based on the client identifier, and the object attribute selection command is used to parse the printer information and the operating system management script executes the printing policy, which significantly enhances the compatibility and stability of the printing software, ensures successful printing behavior under the first type of operating system and its second version, and realizes efficient printer management and control.
[0152] In an optional embodiment of the present specification, in step 102, the printing policy corresponding to the operating system running the client is called to generate a target printing task, including the following specific steps: when the operating system is of the second type and the operating environment is not running, the printer query command of the second type of operating system is called to query the printer information on the operating system; the printer information is converted into a string for constructing an operating system management script, and the string is saved to a temporary file path of the target document on the operating system; the temporary file path is encapsulated using the second type of operating system management script to generate a target printing task.
[0153] The printer query command of the second type of operating system is a command used to query the installed printer information in the second type of operating system. The printer query command usually obtains the printer list and its properties through the interface provided by the system (such as the CUPS service) to provide necessary data support for the configuration of subsequent printing tasks. For example, for the MacOS operating system, lpstat-p is one of the commonly used printer query commands. It lists all known printers and displays the status of each printer. In addition, the lpstat-r command is used to check whether the CUPS scheduler is running, which is crucial to ensure the effectiveness of subsequent printer queries. If you find that the CUPS service is not running, you can try to start the service using the launchctl startorg.cups.cupsd command.
[0154] Printer information on the operating system is information about physical or virtual printers connected to the operating system, including but not limited to printer name, model, status, location, driver version, supported features, etc. Printer information specifies which printers are available, what their status is, and whether any specific actions need to be taken to prepare or optimize the print job. For example,
[0155] info! ("[Desktop MACOS-get_printers_macos] Successfully obtained the MAC printer list: {}", printers_output);.
[0156] The character string of the second type of operating system management script is a code or command sequence written for a specific operating system, and the script is used to perform a series of management tasks, including but not limited to querying printer information, configuring printer settings, generating print tasks, etc. The character string of the operating system management script is in a format that can be recognized and executed by the operating system management script, such as a JSON format character string of a Shell script.
[0157] The temporary file path of the target document on the operating system is the location of the temporary file created by the printing software in the operating system, which is used to store the intermediate results of the target document printing process, such as the output results of the printer information. This path is usually a file name in a directory specified by the application. A common practice is to create a subdirectory in the system's temporary folder and place the required temporary files in it to avoid conflicts with other applications and facilitate the cleanup of no longer needed files. For example,
[0158] lettemp_file_path=" / tmp / myapp / printers_output.txt";
[0159] For example, the lpstat -r command is first executed to check whether the CUPS print service is running on the MacOS operating system. The output() method of Command::new("lpstat") is used to capture the command output. If service_status_result is executed successfully, the output is converted to a string and checked to see if it contains the words scheduler isrunning to confirm whether the CUPS service is running normally. If scheduler isrunning is not included in the output, it means that the CUPS service is not running on the MacOS operating system. An attempt will be made to start the service, log information that the service is not running will be recorded, and the launchctl start org.cups.cupsd command will be called. If the startup command is executed successfully, the log information that the service has been started will be recorded; if it fails, an error log will be recorded, and an empty JSON format string "[]" will be returned to avoid application crashes. If the CUPS service has been started, the code then calls the printer query command (lpstat -p command) to try to obtain a list of printers. If the execution is successful, the standard output is converted to a JSON format string, and a log of successfully obtaining the printer list is recorded. The parse_printers function is used to parse the original printer information into a JSON format string. If printers_json is not empty, the parsed JSON format string is recorded and returned; otherwise, an empty JSON format string "[]" is returned. If the lpstat -p command fails to execute, the error information in stderr is captured and recorded. If the error message contains "No destinations added" or "No destinations added", it means that the system is not configured with any printers, and an empty list is returned and the log is recorded. In other cases, an empty JSON format string is also returned and the error log is recorded to ensure that the application does not crash when an error occurs. The specific Rust code is as follows:
[0160]
[0161]
[0162]
[0163] In the embodiments of the present specification, the operating system type and version are determined based on the client identifier, and the printing strategy is executed using printer query commands and operating system management scripts, which significantly enhances the compatibility and stability of the printing software, ensures successful printing behavior under the second type of operating system, and realizes efficient printer management and control.
[0164] In an optional embodiment of the present specification, before step 104, the following specific steps are also included: obtaining a preview result of the target document; if the preview result is a preview failure, feeding back the reason for the preview failure to the client;
[0165] Correspondingly, step 104 includes the following specific steps: when the preview result is that the preview is successful, running the target printing task, and scheduling the target printer on the client to print the target document.
[0166] The preview result of the target document is the status information returned before the print task is executed, indicating whether the preview of the target document is successful. The preview result contains indicators about whether the target print task can be successfully run, including but not limited to the command type (such as cmd), request ID (used to track specific print requests), task ID (identifies the specific print task), status (success or failure), preview URL (if applicable), and possible message description. The preview result is usually returned in JSON format for easy parsing and processing. For the client, the preview result provides necessary feedback, allowing the user to understand the execution status of the print task in advance and take further actions as needed to ensure the successful execution of the target print task.
[0167] The reason for preview failure is the specific factor that caused the failure when the print task failed. The reason for preview failure can be technical (such as network connection problem, printer offline, etc.) or non-technical (such as missing necessary parameters, insufficient user permissions, etc.). For example, a msg field is included in the JSON response to explain the specific reason for the failure.
[0168] For example, without specifying a printer to use:
[0169]
[0170] Another example is that the printer is offline or unavailable:
[0171]
[0172] Exemplarily, the preview result of the target electronic waybill is obtained. If the preview result is a preview failure, the reason for the preview failure is fed back to the client. The specific code is as follows:
[0173] When preview is turned on:
[0174] {"cmd":"print","status":"success","previewURL":" / var / folders / f4 / ldmpclhs71n9bsnzyqtmsp740000gn / T / 25950796_1726837889660.pdf"}
[0175] When preview is not enabled:
[0176] Successful situation: [Successfully issued the printing task]
[0177] {"cmd":"print","requestID":"123456789","taskID":"1","status":"success","previewURL":"","msg":""}
[0178] Failure condition: [Failed to pass the printer name]
[0179] {"cmd":"print","requestID":"123456789","taskID":"1","status":"failed","previewURL":"","msg":"Please select a printer"}
[0180] In the embodiments of this specification, the preview results of the target document are fed back in a timely manner, and the specific reasons are fed back to the client when the preview fails, which significantly enhances the user experience, improves the transparency and reliability of the system, facilitates developers to parse, process, debug and maintain, improves the stability and efficiency of the overall service, and ensures the effective execution of printing tasks.
[0181] Since different operating systems have different document drawing methods, it is necessary to integrate a high-precision vector drawing method to complete unified target document drawing on different operating systems.
[0182] For example, macOS's Core Graphics and PDF support: macOS uses the Core Graphics framework as the basis for its graphics rendering, and Core Graphics has native vector support when rendering PDF. This means that macOS has better anti-aliasing and detail rendering capabilities for vector content such as PDF text, graphics (such as lines, shapes), etc. The printing system can directly use vector information to output text and graphics with high quality without relying on additional processing by the printer driver. For macOS's PDFKit: PDFKit on macOS is highly optimized for PDF rendering, especially the processing of text and vector graphics. This optimization makes PDF output more accurate, retains the details and resolution in the file, and maintains good clarity and anti-aliasing effects even if the PDF is enlarged when printing.
[0183] Another example is the dependency on Windows GDI and drivers: Graphics rendering on Windows mainly relies on GDI (Graphics Device Interface) or the newer Direct2D to process graphics, but these APIs do not fully optimize PDF vector rendering. Especially in lower versions of Windows and some printer drivers, the vector content of PDF may be converted to bitmap or rasterized, resulting in reduced clarity. In addition, the Windows printing system relies on the support of printer drivers of various brands, and the quality of drivers varies. Some printer drivers may not optimize the output of PDF details, resulting in distorted or blurred images. For Windows print rendering: In Windows, the default PDF rendering often relies on third-party software (Ghostscript) for transfer. Because different software may have different rendering and compression algorithms when processing PDF, the details of PDF content (especially vector content) may be lost in the conversion, resulting in unstable print quality. Although tools such as Ghostscript support vector rendering, they are easily downgraded to bitmap printing when not configured properly, affecting quality.
[0184] In an optional embodiment of the present specification, the printing instruction carries the attribute parameters of the target document; before step 104, the following specific steps are also included: parsing the attribute parameters of the target document, determining multiple layers and at least one component on the multiple layers; calling the component drawing function, drawing each component on the current layer on the current layer, and resetting the current layer when the drawing is completed, until multiple layers are drawn; superimposing multiple layers to generate the target document.
[0185] The attribute parameters of the target document are attribute parameters used to describe and configure the appearance and content of the target document. The attribute parameters include but are not limited to size, color mode, font type, text content, barcode information, etc. The attribute parameters determine the specific style and layout of the target document that is finally generated.
[0186] Layers are logical hierarchical structures used when drawing a target document. Each layer contains at least one component, which is used to build different parts of the document. By dividing the content of a document into multiple layers, you can more flexibly manage and organize the elements during the drawing process, making it easier to achieve complex layouts and effects (such as transparency, stacking order, etc.).
[0187] Components are the basic units that make up a document. Each component represents a specific element or functional block on a document, such as a text box, image, barcode, etc. Components have their own properties, such as position, size, color, content, etc., and can be rendered through specific drawing functions.
[0188] The component drawing function is a method function used to draw the specific content of the component on the current layer. It implements the specific drawing logic to ensure that the component appears on the document as expected. The drawing function usually handles the position, size, color and other visual attributes of the component. For example, the execute_component_main function is the entry point for vector drawing. The process is: traverse the children array in the input JSON; call the draw method of the corresponding component according to the componentName (such as OnixBarleyElectronicText::draw); after drawing, call reset_layer_defaults to reset the layer state to ensure that the drawing environment of the next layer component is independent and clean. Through the above mechanism, data integrity verification (avoiding exceptions caused by empty arrays and invalid properties), component execution isolation (errors in a single component do not affect the overall process) and strict management of layer status are achieved. The execute_component_main function includes multiple component drawing functions:
[0189] OnixBarleyElectronicBarcode (barcode drawing component);
[0190] OnixBarleyElectronicBarcodeVertical (vertical barcode drawing component);
[0191] OnixBarleyElectronicImage (picture drawing component);
[0192] OnixBarleyElectronicIsv (specific ISV data component);
[0193] OnixBarleyElectronicLine (horizontal line drawing component);
[0194] OnixBarleyElectronicLineVertical (vertical line drawing component);
[0195] OnixBarleyElectronicQrcode (QR code drawing component);
[0196] OnixBarleyElectronicRectangle (rectangle drawing component);
[0197] OnixBarleyElectronicText (text drawing component);
[0198] OnixBarleyElectronicTextVertical (vertical text drawing component).
[0199] When implementing high-precision vector drawing based on Rust's high-precision vector drawing library (printpdf library), it is necessary to take into account multiple levels of logical complexity:
[0200] Component parsing complexity:
[0201] Parse component properties (color, font, alignment, rotation angle, etc.) from JSON input, strictly verify and set default values to ensure that abnormal input does not affect drawing stability.
[0202] Coordinate transformation and alignment complexity:
[0203] Convert units such as millimeters and pixels to PDF coordinates through functions such as convert_to_pdf_coordinates, and dynamically adjust the position according to alignment requirements (left, right, center).
[0204] At the same time, use methods such as adjust_y_for_top_alignment to precisely control the vertical positioning of text and graphics on the page to ensure accurate layout.
[0205] Text and image drawing complexity:
[0206] Text drawing requires loading external fonts, calculating line spacing, and adjusting letter spacing (letter_spacing). If the text is too long, the draw_text_with_wrapping function will automatically wrap and scale it to ensure a beautiful layout.
[0207] Image drawing requires precise control of position, scaling, and background processing, and may combine rotation operations and a specific drawing order to achieve the desired visual effect.
[0208] The complexity of graphics state preservation and restoration:
[0209] After each rotation, scaling, or color change, save_graphics_state and restore_graphics_state are needed to ensure that the drawing of subsequent components is not affected, thereby realizing a modular and scalable drawing process.
[0210] Core protection logic example:
[0211] Component calling and execution order
[0212] The execute_component_main function is the entry point for vector drawing. Its flow is as follows:
[0213] Iterate over the children array in the input JSON.
[0214] Call the draw method of the corresponding component according to componentName (such as OnixBarleyElectronicText::draw).
[0215] After drawing is completed, call reset_layer_defaults to reset the layer state to ensure that the drawing environment of the next component is independent and clean.
[0216] Through the above mechanism, data integrity verification (avoiding exceptions caused by empty arrays and invalid properties), component execution isolation (errors in a single component do not affect the overall process) and strict management of layer status are achieved.
[0217] For example, take OnixBarleyElectronicText as an example to explain: this component parses text-related attributes (font color, background color, content, alignment, rotation parameters, etc.) through the draw method, and automatically handles complex logic such as font size, line height, word spacing and line breaks. When drawing, you can first fill in the background color, then render the text according to the specified alignment and coordinates, and use set_ctm to rotate and position the text. After drawing, restore the environment through save_graphics_state and restore_graphics_state to maintain the independence and neatness of other components.
[0218] Core code example:
[0219] Main execution process (execute_component_main) example:
[0220]
[0221]
[0222] The key logic points of the OnixBarleyElectronicText component are as follows (pseudo code)
[0223]
[0224] Font subsetting (Python implementation)
[0225] Since directly using the complete font file may cause the PDF to be too large, Python tools are used to subset the fonts and only retain the glyphs of the required text, thereby reducing the volume of embedded font data and improving the efficiency of PDF generation and transmission.
[0226] Example Python code (using fonttools's pyftsubset command-line tool):
[0227] Python
[0228] Copy code
[0229]
[0230] After subsetting, the Rust code will reference the simplified subset_Medium.otf as the font file embedded in the PDF, which can significantly reduce the size of the PDF file when used with the printpdf library for vector drawing.
[0231] The drawing logic of each component is executed in an independent OnixBarleyElectronicText::draw component drawing function to ensure that even if an error occurs in a component, it will not affect the execution of other components. After each call to the component drawing method, the reset_layer_defaults function is called to reset the layer state to avoid layer influences between components and realize a modular drawing process.
[0232] In the embodiments of this specification, cross-operating system document drawing is completed by integrating the characteristics of different operating systems. By determining multiple layers and components and calling drawing functions to render layer by layer, high-quality target documents are generated by superposition, achieving consistent high-quality output across platforms, greatly improving the printing quality and efficiency of documents, adapting to various printing needs, and improving compatibility and stability.
[0233] The following combination Figure 7 , taking the application of the document printing method provided in this specification in the field of e-commerce platform logistics as an example, the document printing method is further explained. Figure 7 A flowchart of a processing process of a document printing method applied to the field of e-commerce platform logistics provided by an embodiment of this specification is shown. The method is applied to a cloud platform of printing software for e-commerce platform logistics, and includes the following specific steps:
[0234] Step 702: Receive a printing instruction for the target electronic waybill sent by the client of the printing software of the e-commerce platform logistics.
[0235] Step 704: parse the attribute parameters of the target electronic waybill, determine multiple layers and at least one component on the multiple layers, call the component drawing function, draw each component on the current layer on the current layer, and reset the current layer when the drawing is completed, until multiple layers are drawn, superimpose the multiple layers, and generate the target electronic waybill.
[0236] Step 706: Based on the client identifier of the client, determine the type of the operating system running the client.
[0237] Step 708: When the operating system type is Windows type, call the kernel version number identification function to identify the version number of the operating system, and determine the operating system running the client based on the version number.
[0238] Step 710: When the operating system is of Windows type and the version number is WIN7, use the operating system's print function interface to query the printer information on the operating system, convert the printer information into a string for building a Windows type operating system management script, and save the string to the temporary file path of the target electronic waybill on the operating system. Use the operating system management script to encapsulate the temporary file path and generate the target printing task.
[0239] Step 712: When the operating system is of Windows type and the version number is WIN10, use the object property selection command of the Windows type operating system management script to parse and obtain the printer information on the operating system, convert the printer information into a string for constructing the operating system management script, and save the string to the temporary file path of the target electronic waybill on the operating system. Use the operating system management script to encapsulate the temporary file path and generate the target printing task.
[0240] Step 714: When the operating system type is MacOS type, a conditional compilation instruction is called to detect the operating environment of the operating system to determine the operating system running the client.
[0241] Step 716: When the operating system is of MacOS type and the CUPS operating environment is not running, call the printer query command of the MacOS type operating system to query the printer information on the operating system, convert the printer information into a string for constructing the operating system management script, and save the string to the temporary file path of the target electronic waybill on the operating system. Use the MacOS type operating system management script to encapsulate the temporary file path and generate the target printing task.
[0242] Step 718: Obtain a preview result of the target electronic waybill.
[0243] Step 720: When the preview result is successful, run the target printing task and schedule the target printer on the client to print the target electronic waybill.
[0244] Step 722: When the preview result is preview failure, the reason for the preview failure is fed back to the client.
[0245] In the embodiments of this specification, an efficient and reliable electronic waybill generation and printing process is achieved through a unified cloud platform. The solution first receives the print instruction sent by the client, parses the attribute parameters of the target electronic waybill, determines multiple layers and their components, calls the drawing function to render layer by layer, and finally generates a high-quality electronic waybill by superposition. Then, the operating system type is identified based on the client identifier, and specific strategies are adopted for different operating systems (such as Windows and MacOS) and their versions to generate printing tasks. In addition, a preview function is supported to ensure that the user can check the content of the waybill before printing. If the preview is successful, the printing task is executed, and if it fails, the reason is fed back to the client. It not only improves cross-platform compatibility and adaptability of the operating system, but also enhances the user experience, reduces the possibility of human error, and ensures the consistency and accuracy of the printing results, realizing a more intelligent and automated printing process, greatly improving the work efficiency and service quality of the e-commerce logistics link, reducing operation and maintenance costs, and improving the processing speed and user satisfaction of the logistics business of the e-commerce platform.
[0246] Corresponding to the above method embodiment, this specification also provides a cloud platform embodiment of printing software. Figure 8 FIG. 1 shows a schematic diagram of a cloud platform structure of a printing software provided by an embodiment of the present specification. Figure 8 As shown, the cloud platform 800 includes a printing interface 802, a printing policy module 804 corresponding to multiple operating systems, and a printing driver 806;
[0247] The printing interface 802 is used to determine the printing policy module 804 corresponding to the operating system running the client from the printing policy modules corresponding to the multiple operating systems in response to the printing instruction for the target document sent by the client of the printing software;
[0248] The printing policy module 804 is used to call the printing policy corresponding to the operating system running the client and generate a target printing task;
[0249] The print driver 806 is used to run the target print task and schedule the target printer on the client to print the target document.
[0250] Optionally, the printing interface 802 is further used to determine the operating system running the client based on the client identifier of the client.
[0251] Optionally, the printing interface 802 is specifically used to determine the type of operating system running the client based on the client identifier of the client; when the type of the operating system is the first type, the kernel version number identification function is called to identify the version number of the operating system, and based on the version number, the operating system running the client is determined; when the type of the operating system is the second type, the conditional compilation instruction is called to detect the operating environment of the operating system to determine the operating system running the client.
[0252] Optionally, the printing policy module 804 is specifically used to query the printer information on the operating system by using the printing function interface of the operating system when the operating system is of the first type and the version number is the first version number; convert the printer information into a string for constructing the first type of operating system management script, and save the string to the temporary file path of the target document on the operating system; use the operating system management script to encapsulate the temporary file path and generate a target printing task.
[0253] Optionally, the printing policy module 804 is specifically used to, when the operating system is of the first type and the version number is of the second version number, utilize the object attribute selection command of the first type of operating system management script to parse and obtain printer information on the operating system; convert the printer information into a string for constructing the operating system management script, and save the string to a temporary file path of the target document on the operating system; utilize the operating system management script to encapsulate the temporary file path and generate a target printing task.
[0254] Optionally, the printing policy module 804 is specifically used to call the printer query command of the second type of operating system to query the printer information on the operating system when the operating system is of the second type and the operating environment is not running; convert the printer information into a string for constructing an operating system management script, and save the string to a temporary file path of the target document on the operating system; use the second type of operating system management script to encapsulate the temporary file path and generate a target printing task.
[0255] Optionally, the printing interface 802 is further used to obtain a preview result of the target document; if the preview result is a preview failure, the reason for the preview failure is fed back to the client;
[0256] Correspondingly, the print driver 806 is specifically used to run the target print task and schedule the target printer on the client to print the target document when the preview result is that the preview is successful.
[0257] Optionally, the printing instruction carries attribute parameters of the target document; the cloud platform 800 further includes:
[0258] The vector drawing module is configured to parse the attribute parameters of the target document, determine multiple layers and at least one component on the multiple layers; call the component drawing function, draw each component on the current layer on the current layer, and reset the current layer when the drawing is completed until the multiple layers are drawn; overlay the multiple layers to generate the target document.
[0259] In the embodiments of this specification, the cloud platform of the printing software centrally manages the document printing process of different operating systems, the printing interface responds to the printing instruction, intelligently identifies the operating system of the client, and accurately matches and calls the corresponding printing policy module from the printing policies corresponding to multiple operating systems to generate the target printing task that the operating system can successfully execute, avoiding the problem of complex configuration caused by differences in operating systems and ensuring compatibility across operating systems. In addition, by generating printing tasks in the printing policy module of the unified cloud platform, the computing burden of the client is reduced, and the printing efficiency and response speed are improved. It not only simplifies the integration requirements in a multi-operating system environment and reduces maintenance costs, but also enhances the user experience and achieves efficient and accurate document printing.
[0260] The above is a schematic scheme of a cloud platform for printing software of this embodiment. It should be noted that the technical scheme of the cloud platform for printing software and the technical scheme of the document printing method described above are of the same concept, and the details of the technical scheme of the cloud platform for printing software that are not described in detail can be found in the description of the technical scheme of the document printing method described above.
[0261] Fig. 9 The structure block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and the database 950 is used to store data.
[0262] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0263] In one embodiment of the present specification, the above components of the computing device 900 and Fig. 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0264] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 900 may also be a mobile or stationary server.
[0265] The processor 920 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned document printing method when executed by the processor.
[0266] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the document printing method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the document printing method described above.
[0267] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned document printing method when executed by a processor.
[0268] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the document printing method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the document printing method described above.
[0269] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned document printing method when executed by a processor.
[0270] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the document printing method described above are of the same concept, and the details not described in detail in the technical solution of the computer program product can be found in the description of the technical solution of the document printing method described above.
[0271] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0272] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents contained in the computer readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0273] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0274] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0275] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.< / path> < / id>
Claims
1. A document printing method, characterized in that: The server side used for printing software includes: In response to a print instruction for a target document sent by a client of the printing software, a print policy corresponding to an operating system running the client is called from print policies corresponding to a plurality of operating systems to generate a target print task; The target printing task is run to schedule the target printer on the client to print the target document.
2. The method according to claim 1, characterized in that Before calling the printing policy corresponding to the operating system running the client from the printing policies corresponding to the multiple operating systems and generating the target printing task, the method further includes: An operating system running the client is determined based on the client identifier of the client.
3. The method according to claim 2, characterized in that The determining, based on the client identifier of the client, an operating system running the client includes: Determining the type of the operating system running the client based on the client identifier of the client; In the case where the type of the operating system is the first type, calling a kernel version number identification function to identify the version number of the operating system, and determining the operating system running the client based on the version number; In the case that the type of the operating system is the second type, a conditional compilation instruction is called to detect the operating environment of the operating system to determine the operating system running the client.
4. The method according to claim 3, characterized in that The calling of the printing policy corresponding to the operating system running the client to generate a target printing task includes: When the operating system is of the first type and the version number is the first version number, querying printer information on the operating system using a print function interface of the operating system; Convert the printer information into a character string for constructing the first type of operating system management script, and save the character string to a temporary file path of the target document on the operating system; The operating system management script is utilized to encapsulate the temporary file path and generate a target printing task.
5. The method according to claim 3, characterized in that: The calling of the printing policy corresponding to the operating system running the client to generate a target printing task includes: When the operating system is of the first type and the version number is the second version number, using the object attribute selection command of the operating system management script of the first type to parse and obtain the printer information on the operating system; Convert the printer information into a character string for constructing the operating system management script, and save the character string to a temporary file path of the target document on the operating system; The operating system management script is utilized to encapsulate the temporary file path and generate a target printing task.
6. The method according to claim 3, characterized in that: The calling of the printing policy corresponding to the operating system running the client to generate a target printing task includes: When the operating system is of the second type and the operating environment is not running, calling a printer query command of the operating system of the second type to query printer information on the operating system; Convert the printer information into a character string for constructing the operating system management script, and save the character string to a temporary file path of the target document on the operating system; The second type of operating system management script is used to encapsulate the temporary file path and generate a target printing task.
7. The method according to claim 1, characterized in that Before running the target printing task and scheduling the target printer on the client to print the target document, the method further includes: Obtaining a preview result of the target document; When the preview result is a preview failure, feeding back the reason for the preview failure to the client; The running of the target printing task and scheduling the target printer on the client to print the target document includes: When the preview result is that the preview is successful, the target printing task is run to schedule the target printer on the client to print the target document.
8. The method according to any one of claims 1 to 7, characterized in that: The printing instruction carries attribute parameters of the target document; Before running the target printing task and scheduling the target printer on the client to print the target document, the method further includes: Parsing the attribute parameters of the target document to determine a plurality of layers and at least one component on the plurality of layers; Calling a component drawing function to draw each component on the current layer on the current layer, and resetting the current layer when drawing is completed, until the multiple layers are drawn; The multiple layers are superimposed to generate the target document.
9. A cloud platform for printing software, characterized in that: It includes a printing interface, printing policy modules and printing drivers corresponding to multiple operating systems; The printing interface is used to determine, in response to a printing instruction for a target document sent by a client of the printing software, a printing policy module corresponding to the operating system running the client from printing policy modules corresponding to multiple operating systems; The printing policy module is used to call the printing policy corresponding to the operating system running the client to generate a target printing task; The printing driver is used to run the target printing task and schedule the target printer on the client to print the target document.
10. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which implements the steps of the method described in any one of claims 1 to 8 when executed by a processor.
12. A computer program product, characterized in that The method comprises a computer program / instruction which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Cited By
Multi-platform implementation method and system for controlling printing elements by web
CN120973322A
Personalized printing pushing method and system based on user behavior analysis
CN121541842A