Printer adaptive adjustment method and device, electronic equipment and readable storage medium

CN115495029BActive Publication Date: 2026-08-18BEIJING VRV SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211156633.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2026-08-18
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

由于该打印过程增加了将待打印文档进行格式转化并上传审批的过程,因此无法直接调用操作系统自带的打印服务,例如windows系统的Print Spooler服务,而是直接将中间文档发送给物理打印机进行打印

Benefits of technology

[0046] The printer adaptive adjustment method, apparatus, electronic device, and readable storage medium disclosed herein provide a printer adaptive adjustment scheme for situations where a document to be printed is uploaded for approval. This disclosure allows for adaptive adjustment of the print size of intermediate documents for different print area sizes of various printers, thereby ensuring the correctness of the printed document size. It solves the compatibility problem of printable areas when intermediate documents generated by a virtual printer are output to a physical printer, improving the user's printer experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495029B_ABST
    Figure CN115495029B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a printer adaptive adjustment method and device, electronic equipment and readable storage medium. The method comprises the following steps: obtaining a first document to be printed through a unified interface of a virtual printer, and converting the first document into a first intermediate file; determining target printer information corresponding to the first document; obtaining a first printing parameter of the target printer and a second printing parameter of the virtual printer; wherein the first printing parameter is used to represent a physical printing range of the target printer, and the second printing parameter is used to represent a virtual printing range set by the virtual printer based on the first intermediate file; adjusting the second printing parameter according to the first printing parameter, so that the virtual printing range and the physical printing range are matched; and printing the first document through the target printer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of printing control technology, and in particular to a printer adaptive adjustment method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] In high-security, classified enterprises and institutions, document printing requires monitoring and approval. This approval process typically utilizes a virtual printer to convert the document to be printed into an intermediate document with a standardized format, which is then submitted to the reviewer for approval. After approval, the intermediate document is sent directly to the physical printer for printing. Because this printing process adds the step of format conversion and uploading for approval, it is not possible to directly call the operating system's built-in printing services, such as the Print Spooler service in Windows. Instead, the intermediate document is sent directly to the physical printer. When physical printers come in various sizes, their corresponding print ranges also differ. This can cause scaling, distortion, or stretching of the printed document compared to the electronic document, resulting in poor print quality. Summary of the Invention

[0003] In view of this, embodiments of the present disclosure provide a printer adaptive adjustment method, apparatus, electronic device, and readable storage medium, which can achieve adaptive printing adjustment and ensure consistent display effects for paper documents and electronic documents.

[0004] In a first aspect, embodiments of this disclosure provide a printer adaptive adjustment method, comprising the following steps:

[0005] The first document to be printed is obtained through the unified interface of the virtual printer, and the first document is converted into a first intermediate file.

[0006] Determine the target printer information corresponding to the first document;

[0007] Obtain the first printing parameters of the target printer and the second printing parameters of the virtual printer; wherein, the first printing parameters are used to characterize the physical printing range of the target printer, and the second printing parameters are used to characterize the virtual printing range of the virtual printer based on the first intermediate file;

[0008] Adjust the second printing parameters according to the first printing parameters to match the virtual printing range with the physical printing range;

[0009] The first document is printed using the target printer.

[0010] According to the printer adaptive adjustment method provided in this disclosure, the step of obtaining the first document to be printed through the unified interface of the virtual printer and converting the first document into a first intermediate file includes:

[0011] Obtain the original format of the first document;

[0012] The original format is converted to generate a first intermediate file with a first format, wherein the first format is a vector graphic format.

[0013] According to the printer adaptive adjustment method provided in this disclosure, the step of determining the target printer information corresponding to the first document includes:

[0014] Send the user information related to the first document to the remote server;

[0015] Receive one or more candidate printer information corresponding to the user information returned by the remote server;

[0016] If only one candidate printer is available, the candidate printer is determined to be the target printer.

[0017] In the case of two or more candidate printers, the target printer determined by the user from the candidate printers is received.

[0018] According to the printer adaptive adjustment method provided in this disclosure, obtaining the first printing parameters of the target printer and the second printing parameters of the virtual printer includes:

[0019] Obtain the first width, first height, first left margin, and first top margin of the target printer; wherein the first width is the width of the physical printing area, the first height is the height of the physical printing area, the first left margin is the distance between the left edge of the physical printing area and the left edge of the paper, and the first top margin is the distance between the top edge of the physical printing area and the top edge of the paper.

[0020] Obtain the second width, second height, second left margin, and second top margin of the virtual printer; wherein the second width is the width of the virtual printing area, the second height is the height of the virtual printing area, the second left margin is the distance between the left edge of the virtual printing area and the left edge of the paper, and the second top margin is the distance between the top edge of the virtual printing area and the top edge of the paper.

[0021] According to the printer adaptive adjustment method provided in this disclosure, the step of adjusting the second printing parameter according to the first printing parameter to match the virtual printing range and the physical printing range includes:

[0022] Calculate the first aspect ratio of the target printer; the first aspect ratio is the ratio of the first width to the first height;

[0023] Calculate the second aspect ratio of the virtual printer; the second aspect ratio is the ratio of the second width to the second height;

[0024] Determine whether the second aspect ratio is the same as the first aspect ratio;

[0025] Under the same conditions, the second width, second height, second left margin, and second top margin are respectively adjusted to the first width, first height, first left margin, and first top margin;

[0026] Adjustments are made based on the text or image content contained in the first intermediate file, depending on the specific circumstances.

[0027] According to the printer adaptive adjustment method provided in this disclosure, the step of matching based on the text content or image content contained in the first intermediate file includes:

[0028] The first intermediate file is identified using a feature recognition model to determine whether it contains text content or image content.

[0029] If the first intermediate file contains text content, the second width, second height, second left margin, and second top margin are adjusted to replace the first width, first height, first left margin, and first top margin, respectively.

[0030] According to the printer adaptive adjustment method provided in this disclosure, the step of matching based on the text content or image content contained in the first intermediate file further includes:

[0031] If the first intermediate file contains graphic content, adjust the second width to the first width;

[0032] Calculate the second updated height of the virtual printing range based on the first width and the second aspect ratio;

[0033] Adjust the second height to the second updated height.

[0034] Secondly, embodiments of this disclosure also provide a printer adaptive adjustment device, comprising:

[0035] The document acquisition module is suitable for acquiring a first document to be printed through the unified interface of a virtual printer and converting the first document into a first intermediate file.

[0036] The target printer module is adapted to determine the target printer information corresponding to the first document;

[0037] The printing parameter module is adapted to acquire first printing parameters of the target printer and second printing parameters of the virtual printer; wherein, the first printing parameters are used to characterize the physical printing range of the target printer, and the second printing parameters are used to characterize the virtual printing range of the virtual printer based on the first intermediate file;

[0038] A print matching module is adapted to adjust the second print parameters according to the first print parameters so that the virtual print range and the physical print range are matched.

[0039] A print output module, adapted to print the first document using the target printer.

[0040] Thirdly, this disclosure also provides an electronic device that adopts the following technical solution:

[0041] The electronic device includes:

[0042] At least one processor; and,

[0043] A memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the printer adaptive adjustment methods described above.

[0045] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer instructions for causing a computer to execute any of the printer adaptive adjustment devices described above.

[0046] The printer adaptive adjustment method, apparatus, electronic device, and readable storage medium disclosed herein provide a printer adaptive adjustment scheme for situations where a document to be printed is uploaded for approval. This disclosure allows for adaptive adjustment of the print size of intermediate documents for different print area sizes of various printers, thereby ensuring the correctness of the printed document size. It solves the compatibility problem of printable areas when intermediate documents generated by a virtual printer are output to a physical printer, improving the user's printer experience.

[0047] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 A schematic flowchart illustrating the printer adaptive adjustment method provided in this embodiment of the disclosure;

[0050] Figure 2 A schematic flowchart illustrating the adjustment of the second printing parameters provided in an embodiment of this disclosure;

[0051] Figure 3 A schematic block diagram of the printer adaptive adjustment device provided in the embodiments of this disclosure;

[0052] Figure 4 This is a schematic block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0053] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0054] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0055] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0056] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0057] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0058] Please see Figure 1 This disclosure provides a printer adaptive adjustment method, including the following steps:

[0059] S100: Obtain the first document to be printed through the unified interface of the virtual printer, and convert the first document into a first intermediate file.

[0060] This embodiment of the disclosure uses a pre-created virtual printer to uniformly receive all document print requests. When a user initiates the printing process for a first document, the document print request and the corresponding first document are first sent through the unified interface of the virtual printer. To facilitate subsequent approval and printing processes, this step can convert the first document from its original format to a first format to obtain a first intermediate file. Original formats include, but are not limited to, .doc, .xml, .pdf, etc., while first formats include, but are not limited to, .bw, .ai, .dwg, etc. Preferably, the first format is a vector graphic format, particularly EMF format. Those skilled in the art understand that vector graphic format files have the characteristic that scaling does not affect clarity, ensuring that the clarity of the display is not affected when the document is scaled and printed. By converting the first document with its original format into a first intermediate file with the first format, the amount of data can be reduced, caching pressure lowered, and transmission speed improved while retaining all valid information in the first document.

[0061] S200: Determine the target printer information corresponding to the first document.

[0062] In this embodiment, the target printer information is determined by a remote server searching for user information contained in the document print request to identify the pre-stored target printer information corresponding to that user information. This embodiment can pre-store mapping relationships between different user information and different printer information in the remote server. User information can be a unique identifier related to the user, and printer information can be a unique identifier related to the physical printer. By setting the mapping relationship between users and physical printers, targeted printing can be achieved. This avoids situations where multiple users use the same printer to print documents, resulting in too many print jobs and long waiting times. Furthermore, it clearly identifies the printer corresponding to each user's printed documents, preventing the problem of incorrect or missed paper.

[0063] The remote server can return one or more candidate printer information to the client based on a preset mapping relationship, meaning the user can choose which printer to use. It can be understood that if the remote server returns exactly one candidate printer, that candidate printer is determined as the target printer. If the remote server returns two or more candidate printers, the user selects one of the two or more candidate printers as the target printer.

[0064] S300: Obtain the first printing parameters of the target printer and the second printing parameters of the virtual printer; wherein, the first printing parameters are used to characterize the physical printing range of the target printer, and the second printing parameters are used to characterize the virtual printing range of the virtual printer set based on the first intermediate file.

[0065] The first printing parameters are related to the physical settings of the target printer, such as the physical printing area defined by the printhead position of the target printer, including a first width, a first height, a first left margin, and a first top margin. Here, the first width is the width of the physical printing area, the first height is the height of the physical printing area, the first left margin is the distance between the left edge of the physical printing area and the left edge of the paper, and the first top margin is the distance between the top edge of the physical printing area and the top edge of the paper. The second printing parameters are related to the virtual settings of the virtual printer, typically a default virtual printing area set based on historical experience, including a second width, a second height, a second left margin, and a second top margin. Here, the second width is the width of the virtual printing area, the second height is the height of the virtual printing area, the second left margin is the distance between the left edge of the virtual printing area and the left edge of the paper, and the second top margin is the distance between the top edge of the virtual printing area and the top edge of the paper.

[0066] S400: Adjust the second printing parameters according to the first printing parameters so that the virtual printing range and the physical printing range are matched.

[0067] Figure 2 This is a schematic flowchart illustrating the adjustment of the second printing parameters according to an embodiment of this disclosure. Figure 2 As shown, step S400 includes:

[0068] S410: Calculate the first aspect ratio of the target printer; the first aspect ratio is the ratio of the first width to the first height.

[0069] Assuming the first width is W1, the first height is H1, the first left margin is L1, and the first top margin is T1 in the first printing parameters, then the first aspect ratio R1 in this step is W1 / H1.

[0070] S420: Calculate the second aspect ratio of the virtual printer; the second aspect ratio is the ratio of the second width to the second height.

[0071] Assuming the second width is W2, the second height is H2, the second left margin is L2, and the second top margin is T2 in the second printing parameters, then the second aspect ratio R2 in this step is W2 / H2.

[0072] S430: Determine whether the second aspect ratio is the same as the first aspect ratio.

[0073] S440: Under the same conditions, adjust the second width, second height, second left margin and second top margin to the first width, first height, first left margin and first top margin respectively.

[0074] If R2 = R1, then let W2 = W1, H2 = H1, L2 = L1, and T2 = T1. Since the second aspect ratio is the same as the first aspect ratio in this step, we only need to adjust the second printing parameters to be exactly the same as the first printing parameters. Because the first intermediate file is in vector format, adjusting the scaling by modifying the second printing parameters will not affect the clarity of the printed first intermediate file.

[0075] S450: Adjustments are made according to the text or image content contained in the first intermediate file under different circumstances.

[0076] If R2≠R1, this embodiment can make adjustments based on the different content contained in the first intermediate file. A feature recognition model trained using artificial intelligence technology can be used to identify whether the first intermediate file contains text or graphics. This feature recognition model can be constructed from any existing form of artificial neural network. The coefficients of each neuron in the artificial neural network are trained using a large number of pre-labeled text or graphic features, and a final feature recognition model is obtained after sufficient iterative computation. The training process of this feature recognition model is prior art, and this embodiment will not elaborate on it further.

[0077] On the one hand, when the first intermediate file contains only text, slight changes to the aspect ratio of the text within a certain range will not affect the legibility of the text content. In this case, the first printing parameter can be directly replaced with the second printing parameter to achieve quick adjustment. On the other hand, when the first intermediate file contains only graphics, any change to the aspect ratio of the graphics may affect the accuracy of the graphics. Therefore, parameter adjustments need to be made while keeping the aspect ratio of the graphics unchanged to maximize the match between the second and first printing parameters. Specifically, this can include: adjusting the second width W2 to the first width W1, i.e., setting W2 = W1. Calculating the second updated height H2' of the virtual printing range based on the first width W1 and the second aspect ratio R2, where H2' = W1 / (W2 / H2). The above steps can ensure both the clarity and accuracy of the printed paper, regardless of whether the content is text or graphics.

[0078] S500: Print the first document using the target printer.

[0079] Through the above steps, this embodiment of the disclosure can adaptively set the virtual printing parameters of the virtual printer according to the physical printing parameters of the target printer, achieving consistency between the display effect of electronic documents and the display effect of paper documents. This embodiment of the disclosure is particularly suitable for application scenarios that require intermediate caching and review of print requests and cannot directly call the printing service built into the operating system, thereby enhancing the security level of electronic documents and preventing leaks caused by unauthorized printing.

[0080] This disclosure also provides a printer adaptive adjustment device. For example... Figure 3 As shown, the printer adaptive adjustment device 300 includes:

[0081] The document acquisition module 310 is suitable for acquiring a first document to be printed through the unified interface of a virtual printer and converting the first document into a first intermediate file.

[0082] Target printer module 320 is adapted to determine target printer information corresponding to the first document;

[0083] The printing parameter module 330 is adapted to acquire a first printing parameter of the target printer and a second printing parameter of the virtual printer; wherein the first printing parameter is used to characterize the physical printing range of the target printer, and the second printing parameter is used to characterize the virtual printing range of the virtual printer set based on the first intermediate file;

[0084] The print matching module 340 is adapted to adjust the second print parameters according to the first print parameters so that the virtual print range and the physical print range are matched.

[0085] The print output module 350 is adapted to print the first document through the target printer.

[0086] An electronic device according to embodiments of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), a hard disk, flash memory, etc.

[0087] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the electronic device to perform all or part of the steps of the printer adaptive adjustment method of the foregoing embodiments of this disclosure.

[0088] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.

[0089] like Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the electronic device in the embodiment of the present disclosure. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0090] like Figure 4As shown, an electronic device may include a processing unit (such as a central processing unit, graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0091] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices (such as edge computing devices) to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0092] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, all or part of the steps of the printer adaptive adjustment method of embodiments of this disclosure are performed.

[0093] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0094] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the printer adaptive adjustment methods described in the foregoing embodiments of the present disclosure are performed.

[0095] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).

[0096] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0097] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0098] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.

[0099] Additionally, as used herein, the “or” used in a list of items beginning with “at least one” indicates a separate list, such that a list of, for example, “at least one of A, B, or C” means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word “exemplary” does not imply that the described example is preferred or better than other examples.

[0100] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.

[0101] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0102] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0103] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A method for adaptive adjustment of a printer, characterized in that, This is applicable to confidential printing approval scenarios where the operating system's built-in printing service cannot be directly accessed, including: The first document to be printed is obtained through the unified interface of the virtual printer, and the first document is converted into a first intermediate file. Determine the target printer information corresponding to the first document; Obtaining the first printing parameters of the target printer and the second printing parameters of the virtual printer specifically includes: obtaining the first width, first height, first left margin, and first top margin of the target printer; wherein the first width is the width of the physical printing area, the first height is the height of the physical printing area, the first left margin is the distance between the left edge of the physical printing area and the left edge of the paper, and the first top margin is the distance between the top edge of the physical printing area and the top edge of the paper; obtaining the second width, second height, second left margin, and second top margin of the virtual printer; wherein the second width is the width of the virtual printing area, the second height is the height of the virtual printing area, the second left margin is the distance between the left edge of the virtual printing area and the left edge of the paper, and the second top margin is the distance between the top edge of the virtual printing area and the top edge of the paper; wherein the first printing parameters are used to characterize the physical printing area of ​​the target printer, and the second printing parameters are used to characterize the virtual printing area of ​​the virtual printer set based on the first intermediate file; Adjusting the second printing parameters according to the first printing parameters to match the virtual printing range with the physical printing range specifically includes: calculating the first aspect ratio of the target printer and the second aspect ratio of the virtual printer, where the first aspect ratio is the ratio of the first width to the first height, and the second aspect ratio is the ratio of the second width to the second height; making differentiated adjustments to the second printing parameters based on whether the first aspect ratio and the second aspect ratio are the same and the content type of the first intermediate file to ensure accurate matching between the virtual printing range and the physical printing range, specifically includes: using a feature recognition model to identify the first intermediate file and determine whether the first intermediate file contains text content or image content; if the first aspect ratio and the second aspect ratio are different and the content type of the first intermediate file is image content, adjusting the second width to the first width; calculating the second updated height of the virtual printing range based on the first width and the second aspect ratio, and adjusting the second height to the second updated height, where the second updated height is the ratio of the first width to the second aspect ratio, and the second aspect ratio is the ratio of the second width to the second height before adjustment; Under the same conditions, the second width, second height, second left margin, and second top margin are respectively adjusted to the first width, first height, first left margin, and first top margin; If the first aspect ratio is different from the second aspect ratio and the content type of the first intermediate file is text content, the second width, second height, second left margin and second top margin are adjusted to replace the first width, first height, first left margin and first top margin respectively; The first document is printed using the target printer.

2. The printer adaptive adjustment method according to claim 1, characterized in that, The step of obtaining the first document to be printed through the unified interface of the virtual printer and converting the first document into a first intermediate file includes: Obtain the original format of the first document; The original format is converted to generate a first intermediate file with a first format, wherein the first format is a vector graphic format.

3. The printer adaptive adjustment method according to claim 2, characterized in that, The step of determining the target printer information corresponding to the first document includes: Send the user information related to the first document to the remote server; Receive one or more candidate printer information corresponding to the user information returned by the remote server; If only one candidate printer is available, the candidate printer is determined to be the target printer. In the case of two or more candidate printers, the target printer determined by the user from the candidate printers is received.

4. A printer adaptive adjustment device, characterized in that, This is applicable to confidential printing approval scenarios where the operating system's built-in printing service cannot be directly accessed, including: The document acquisition module is suitable for acquiring a first document to be printed through the unified interface of a virtual printer and converting the first document into a first intermediate file. The target printer module is adapted to determine the target printer information corresponding to the first document; The printing parameter module is adapted to acquire first printing parameters of the target printer and second printing parameters of the virtual printer, specifically including: acquiring a first width, first height, first left margin, and first top margin of the target printer; wherein the first width is the width of the physical printing area, the first height is the height of the physical printing area, the first left margin is the distance between the left edge of the physical printing area and the left edge of the paper, and the first top margin is the distance between the top edge of the physical printing area and the top edge of the paper; acquiring a second width, second height, second left margin, and second top margin of the virtual printer; wherein the second width is the width of the virtual printing area, the second height is the height of the virtual printing area, the second left margin is the distance between the left edge of the virtual printing area and the left edge of the paper, and the second top margin is the distance between the top edge of the virtual printing area and the top edge of the paper; wherein the first printing parameters are used to characterize the physical printing area of ​​the target printer, and the second printing parameters are used to characterize the virtual printing area of ​​the virtual printer set based on the first intermediate file; The print matching module is adapted to adjust the second print parameters according to the first print parameters to match the virtual print range and the physical print range. Specifically, it includes: calculating the first aspect ratio of the target printer and the second aspect ratio of the virtual printer, where the first aspect ratio is the ratio of the first width to the first height, and the second aspect ratio is the ratio of the second width to the second height; and differentially adjusting the second print parameters based on whether the first and second aspect ratios are the same and the content type of the first intermediate file to ensure accurate matching between the virtual print range and the physical print range. Specifically, it includes: using a feature recognition model to identify the first intermediate file and determine whether it contains text or image content; if the first and second aspect ratios are different and the content type of the first intermediate file is image content, adjusting the second width to the first width; calculating the second updated height of the virtual print range based on the first width and the second aspect ratio, and adjusting the second height to the second updated height, where the second updated height is the ratio of the first width to the second aspect ratio, and the second aspect ratio is the ratio of the second width to the second height before adjustment. Under the same conditions, the second width, second height, second left margin, and second top margin are respectively adjusted to the first width, first height, first left margin, and first top margin; If the first aspect ratio is different from the second aspect ratio and the content type of the first intermediate file is text content, the second width, second height, second left margin and second top margin are adjusted to replace the first width, first height, first left margin and first top margin respectively; A print output module, adapted to print the first document using the target printer.

5. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the printer adaptive adjustment method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the printer adaptive adjustment method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Printing method and device, client and server

    CN113377303A

  • Printing controller, printing controlling method, and storage medium storing control program

    JP1997277615A