A printing method, a computing device, and a storage medium

CN122363634APending Publication Date: 2026-07-10BEIJING ZHUONENG XINAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ZHUONENG XINAN TECHNOLOGY CO LTD
Filing Date
2026-04-14
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In the traditional printing process, users need to preview and modify the document content multiple times to adjust the printing effect, resulting in low efficiency and a poor user experience.

Method used

By intercepting the raw print data stream in the virtual printing layer or print service layer, an interactive print job metadata model is constructed, and a unique identifier and interactive event listener are bound to each operable element, allowing users to adjust element attributes in real time in the preview interface and intuitively feedback the results of user operations.

Benefits of technology

It enables continuous operation within a single interface, breaking the traditional cyclical adjustment process and improving the efficiency of print preparation and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363634A_ABST
    Figure CN122363634A_ABST
Patent Text Reader

Abstract

This application discloses a printing method, computing device, and storage medium. The method includes: intercepting the raw print data stream of a first target file in a virtual printing layer or print service layer; parsing the raw print data stream to construct a first print job metadata model; rendering a page view in a preview interface and binding a unique identifier and an interaction event listener to each operable element in the first print job metadata model; responding to an operation command detected by the interaction event listener corresponding to any target operable element in the preview interface, adjusting the target operable element according to the operation command to update the first print job metadata model to a second print job metadata model; generating a second target file using an enhanced rendering strategy and presenting it in the preview interface; and generating the final print data stream of the second target file based on the second print job metadata model. This improves the efficiency and accuracy of print preparation and enhances the user experience of printing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing technology, and more particularly to a printing method, a computing device, and a storage medium. Background Technology

[0002] In traditional computer printing workflows, after a user executes a print command through an application, the system typically displays a print settings dialog box where the user can select the printer, set paper orientation, margins, and other basic parameters. The system then generates a static, non-interactive preview image showcasing the print result with the current settings. If the user is dissatisfied with the preview—for example, finding text overflow, misaligned images, or an unclear layout—they must close the preview window, return to the print settings dialog box or even the original application to modify the document, and then re-enter the preview for confirmation. This cyclical "preview-close-modify-preview" process is cumbersome and inefficient, especially for complex documents where adjustments require multiple attempts, severely impacting print preparation efficiency and user experience. Summary of the Invention

[0003] In view of this, the main objective of the present invention is to provide a printing method, a computing device, and a storage medium, which aim to improve the efficiency of print preparation and the user experience.

[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows: This invention provides a printing method, including: In response to the print command of the first target file, intercept the raw print data stream of the first target file at the virtual print layer or print service layer; Parse the raw print data stream and construct the metadata model for the first print job; Based on the metadata model of the first print job, a page view is rendered in the preview interface, and a unique identifier and interactive event listener are bound to each operable element in the metadata model of the first print job. When an interaction event listener for any operable element in the preview interface detects an operation command, the operable element is adjusted according to the operation command to update the first print job metadata model to the second print job metadata model. Based on the second print job metadata model, a second target file is generated and presented in the preview interface; Upon detecting a user confirmation operation, the system retrieves the final print data stream of the second target file based on the second print job metadata model and executes the print output.

[0005] In the above scheme, in response to the interactive event corresponding to any target operable element in the preview interface, an operation command is listened to, and the target operable element is adjusted according to the operation command to update the first print job metadata model to the second print job metadata model, including: Parse the event object captured by the interactive event listener to obtain the unique identifier, operation instruction type, and operation parameters of the target operable element; Based on the unique identifier, locate the corresponding element node in the metadata model of the first print job; Based on the operation instruction type and operation parameters, determine the first target attribute field to be adjusted for the target operable element; Adjust the first target attribute field based on the target operable element, and determine the metadata modification command; The metadata modification command is applied to the first print job metadata model to update the second attribute field of the corresponding element. The corresponding element includes the target operable element and the associated operable elements affected by the adjustment of the target operable element, so as to update the first print job metadata model to the second print job metadata model. The target attribute field includes the target attribute and the target attribute value.

[0006] In the above scheme, the operation instruction types include at least one of the following: spatial position adjustment instruction, size attribute adjustment instruction, style attribute adjustment instruction, element addition / deletion instruction, and page-level structure adjustment instruction; Based on the operation instruction type and operation parameters, determine the first target attribute field to be adjusted for the target operable element, including at least one of the following: When the operation command type is identified as a spatial position adjustment command, the displacement vector or new position coordinates of the user drag operation in the operation parameters are parsed to determine that the target attribute that needs to be adjusted for the target operable element is the positioning attribute, and the target attribute value corresponding to the positioning attribute is calculated. When the operation instruction type is identified as a size attribute adjustment instruction, the drag direction and distance of the user on the boundary control point in the operation parameters are parsed to determine that the target attribute that needs to be adjusted for the target operable element is the width attribute and / or the height attribute, and the target attribute value corresponding to the width attribute and / or the height attribute is calculated. When the operation instruction type is identified as a style attribute adjustment instruction, the style parameters modified by the user in the attribute editing panel are parsed in the operation parameters. It is determined that the target attributes required by the target operable element include at least one of the following: font type, font size, font color, background color, alignment, border style, and transparency. The target attribute value corresponding to each target attribute is then obtained. When the operation instruction type is identified as an element addition or deletion instruction, the insertion position or the identifier of the element to be deleted triggered by the user is parsed in the operation parameters, the target attributes that need to be adjusted are the element list and page layout information, and the corresponding target attribute values ​​are generated according to the insertion or deletion operation. When the operation instruction type is identified as a page-level structure adjustment instruction, the target position of the user's dragging of the page thumbnail or the position of adding / deleting pages is parsed in the operation parameters. The page sequence information is determined to be the target attribute to be adjusted, and the corresponding target attribute value is generated according to the page order adjustment, page addition or page deletion operation.

[0007] The above scheme, before applying the metadata modification command to the metadata model of the first print job, also includes: Obtain the set of predefined constraint rules in the metadata model of the first print job. The constraint rules include at least one of the following: element alignment relationship, equal indirection relationship, fixed margin relationship, hierarchical relationship, minimum / maximum size limit, and page margin limit. Verify that the metadata modification command conforms to all rules in the constraint rule set; If the verification passes, the update operation of the second attribute field of the corresponding element will be performed; If the verification fails, perform one of the following operations: Reject the metadata modification command and display a conflict message to the user in the preview interface; The system automatically adjusts the target attribute value in the metadata modification command according to the constraint rules, generates a corrected metadata modification command that conforms to the constraint rules, and executes the corrected metadata modification command.

[0008] In the above scheme, when the verification is successful and the element node involved in the metadata modification command has a preset dependency relationship with one or more related elements, the metadata modification command is executed to update the second attribute field of the corresponding element, including: Identify associated elements that have dependencies on the target operable element of the current operation. Dependencies include at least one of parent-child relationships, anchoring relationships, group relationships, and alignment constraint relationships. Based on the type of metadata modification command and dependency relationship, automatically calculate the amount of attribute changes that need to be adjusted synchronously for each element in the associated element set; Generate a set of batch metadata modification commands for the target operable element and its associated elements. The set of batch metadata modification commands includes metadata modification commands and associated metadata modification commands corresponding to each associated element. Execute a set of batch metadata modification commands to update the attribute fields of all affected element nodes in the metadata model of the first print job at once.

[0009] In the above scheme, generating a second target file based on the second print job metadata model and presenting it in the preview interface includes: Based on the second print job metadata model, an enhanced rendering strategy is used to partially refresh the area affected by the operation command in the preview interface, generate the second target file, and display it in real time in the preview interface.

[0010] The above solution employs an enhanced rendering strategy to partially refresh the areas of the preview interface affected by the operation commands, including: Identify the element nodes affected by the operation command and their surrounding related elements, and determine the minimum redraw rectangle area; Re-render the visible content within the smallest redraw rectangle area; The rendering results of the unaffected areas are cached and then combined with the redrawn areas to present the complete result in the preview interface. The minimum redrawn rectangle area is dynamically calculated based on the position coordinates, size attributes, and layout relationship of the element nodes with surrounding elements.

[0011] In the above scheme, a unique identifier and interaction event listener are bound to each operable element in the print job metadata model, including: A unified event listener is registered on the container object of the preview interface using an event delegation mechanism; When a user interacts with any operable element, a unified event listener captures the triggered event through an event bubbling mechanism. Parse the event object to obtain the unique identifier and event type of the target operable element; Locate the corresponding element node in the metadata model of the first print job based on the unique identifier; Based on the event type and event parameters, the corresponding operation instruction processing flow is triggered.

[0012] To achieve the above objectives, embodiments of the present invention also provide a computing device, the computing device comprising: processor; A memory for storing processor-executable instructions; wherein the processor is used to execute the printing method as described in any of the above schemes.

[0013] To achieve the above objectives, embodiments of the present invention also provide a computer storage medium that stores one or more programs, which can be executed by one or more processors to cause the one or more processors to perform the printing method as described in any of the above schemes.

[0014] The present invention provides a printing method, computing device, and storage medium that, in response to a printing instruction for a first target file, intercepts the original printing data stream of the first target file at a virtual printing layer or a printing service layer; parses the original printing data stream to construct a first print job metadata model; renders a page view in a preview interface based on the first print job metadata model, and binds a unique identifier and an interaction event listener to each operable element in the first print job metadata model; in response to an operation instruction being detected by the interaction event listener corresponding to any target operable element in the preview interface, adjusts the target operable element according to the operation instruction to update the first print job metadata model to a second print job metadata model; generates a second target file using an enhanced rendering strategy based on the second print job metadata model and presents it in the preview interface; and in response to detecting a user confirmation operation, generates the final print data stream of the second target file according to the second print job metadata model and executes the print output. Therefore, this embodiment of the invention upgrades the traditional static and passive print preview to a dynamic and editable interactive environment by constructing an interactive print job metadata model and binding an event listening mechanism to page elements. By capturing user commands in real time and mapping them to updates to the metadata model, every adjustment can be immediately presented as visual feedback in the preview interface without refreshing. This breaks the cyclical operation model of "preview-close-modify-preview again" in the traditional printing process, compressing the multi-step, backtracking adjustment process into continuous operations within a single interface, improving the efficiency and smoothness of print preparation, and enhancing the user experience. Attached Figure Description

[0015] Figure 1 A schematic flowchart illustrating a printing method provided in some embodiments of the present invention; Figure 2 Another schematic diagram of the printing method provided in some embodiments of the present invention; Figure 3 A schematic diagram of the hardware structure of a computing device provided in an embodiment of the present invention. Detailed Implementation

[0016] The embodiments of the present invention aim to improve the efficiency and smoothness of print preparation, and enhance the user experience for printing users.

[0017] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.

[0018] Figure 1 This is a flowchart illustrating a printing method provided in some embodiments of the present invention, such as... Figure 1 As shown, this embodiment of the invention provides a printing method applied to a computing device, the method comprising: Step S101: In response to the print command of the first target file, intercept the original print data stream of the first target file in the virtual print layer or print service layer; The computing device mentioned here can be a terminal device, which can be a fixed terminal or a mobile terminal. A fixed terminal can be a desktop computer or an all-in-one computer, while a mobile terminal can be a laptop, tablet, or mobile phone, etc. In some embodiments, the computing device mentioned here can be a computing device within a certain applicable scope, such as a computing device used in a company office. The computing device can be connected to a printer.

[0019] The first target file can refer to the original electronic document that the user currently wishes to print, i.e., the file object that the user opens and executes the print operation in the application. The first target file includes, but is not limited to, at least one of the following: office documents, graphics / images, web page content, or other formats. Office documents can be Word documents, Excel spreadsheets, or PowerPoint presentations; graphics / images can be JPG / PNG images, CAD drawings, or PSD design files; web page content can be web pages opened in a browser or HTML documents; other formats can be PDF files, text files, or any other printable electronic document. It should be noted that the first target file is the source of the print data, and its content will be intercepted, parsed, and reconstructed using virtual printing technology.

[0020] The virtual printing layer can refer to the software layer corresponding to the virtual printer driver in the operating system. It simulates the working mode of a physical printer, but does not actually output paper documents. Instead, it converts the print data into electronic text or other formats.

[0021] Understandably, in an operating system's printing system, the virtual printing layer appears as a registered virtual printer device. When a user selects this virtual printer, the application's print data is redirected to this driver layer. Common examples of virtual printers include Microsoft Print to PDF, Adobe PDF, and Foxit PDF Printer. The virtual printing layer acts as an interception point, capturing the data stream originally destined for the physical printer and guiding it to subsequent processing.

[0022] Understandably, the print service layer can be a system service component in the operating system responsible for managing all print jobs, acting as a bridge between applications and print drivers. In Windows systems, the print service layer corresponds to the PrintSpooler service; it receives print jobs from various applications, manages their queues, distributes print data to the corresponding printer drivers, and handles control operations such as priority, pause, and resumption of print jobs. The print service layer can serve as an alternative interception point, intercepting and processing print jobs at the system level, achieving an interception effect similar to that of a virtual print layer.

[0023] The raw print data stream refers to the low-level print instructions and data set generated by the application and sent to the printing system, before final rendering. The raw print data stream contains page description languages ​​such as Enhanced Metafiles, XML paper specifications, PostScript, and printer control languages; it records complete document information, such as page layout, text content, image data, graphic elements, font information, and color configuration. It is a device-independent intermediate format that can be parsed and rendered by different print drivers. It is understood that the raw print data stream is the raw material of this invention. By parsing the structured information it contains, the logical structure and element attributes of the document can be reconstructed, providing a data foundation for subsequently building an interactive metadata model.

[0024] For example, intercepting the raw print data stream of a first target file at the virtual print layer may include the following steps: First, a virtual printer driver is installed on the operating system. This driver declares the supported printing formats and functions to the system during registration. When a user performs a print operation on the first target file and selects a virtual printer in an application, the operating system redirects the application's print call to this virtual printer driver. After receiving the print job from the application, the virtual printer driver does not immediately convert it to a PDF or XPS file like a traditional virtual printer. Instead, it creates an intercept handle at the driver layer and begins receiving continuously sent print data blocks from the application. These print data blocks are encapsulated in Enhanced Metafile Format and XPS format, forming a complete raw print data stream. The virtual printer driver temporarily stores the received raw print data stream in a memory buffer or temporary file and then executes subsequent processes.

[0025] For example, intercepting the raw print data stream of the first target file at the print service layer can include: registering a print processing component in the operating system's print service layer; when a user performs an operation on the first target file and selects any printer, the print service layer, upon receiving the print job, calls the corresponding print processor based on the job type; the print processor inserts logic before the standard processing flow to obtain the raw data stream of the print job, which exists in EMF or XPS format and contains complete page description information of the first target file. For example, the print processor copies the raw data stream without affecting the normal flow of the original print job. In this way, all print jobs can be intercepted and processed without the user specifically selecting a virtual printer, improving system compatibility and ease of use.

[0026] Thus, through the two methods described above, step 101 achieves the interception of the original data at the system level, making it completely transparent to the upper-level application. The application does not need to make any modifications. At the same time, the intercepted original print data stream completely preserves all the content and structural information of the first target file, providing an accurate data foundation for the subsequent construction of a high-fidelity interactive preview interface, ensuring that the effect seen by the user in the preview interface is completely consistent with the final print output.

[0027] Step S102: Parse the raw print data and construct the metadata model for the first print job.

[0028] The first print job metadata model can refer to a document object model organized in a structured data format, generated by parsing the original print data stream, which fully describes all pages, elements and their attributes in the print job, as well as the logical relationships between elements.

[0029] Understandably, the first print job metadata model is an in-memory data structure, typically organized in a tree or graph structure, containing complete semantic information about the document, not just a rendered pixel image. Each operable element is abstracted as an independent object with unique, readable and writable attribute fields, supporting fast querying, modification, and serialization, serving as the technological foundation for real-time interactive responses. Here, the first print job metadata model is the core data foundation of the entire solution; it is the source of rendering for the preview interface, the object to be modified by user interaction, and the basis for generating the final output file.

[0030] For example, in step S102, parsing the original print data stream and constructing the metadata model of the first print job may include: first, preparing for parsing the original print data stream; then, extracting pages and elements; then, identifying the relationships between elements; and finally, constructing the metadata model.

[0031] Specifically, in the parsing and preparation of the raw print data stream, step S102 may involve first reading the complete raw print data stream from the buffer area or temporary file constructed in step S101. It is understood that the system recognizes the format type of the data stream, including but not limited to at least one of the following: Enhanced metafile format (EMF format), such as the print data format commonly used in Windows systems, records the sequence of GDI drawing instructions; XML paper specification formats, such as XML-based document formats, describe page content and layout in a structured way; PostScript format, such as Adobe's Page Description Language, is widely used in the professional printing industry; Printer control language formats, such as instruction sets specific to printer manufacturers, like PCL, HP-GL, etc.

[0032] As can be seen, the system will call the corresponding parser to perform parsing processing based on the recognized format type.

[0033] For example, in the extraction of pages and elements, taking EMF format parsing as an example, when the original data stream is EMF, step S102, parsing the original print data stream, may include: First, the system traverses each drawing record in the EMF file, and for each record, analyzes its record type and parameters; for the header record, obtain the overall information of the document, such as page size, resolution, device context, etc.; for the object creation record, identify the creation of GDI objects such as pens, brushes, fonts, and color palettes, and record their attributes; for the drawing record, including operations such as picture book text, lines, rectangles, ellipses, and bitmaps, extract the position, size, and style information of the elements; for the transformation record, record coordinate system transformations, viewport mapping, etc., for accurately calculating the final position of the elements.

[0034] For example, when parsing an EMR_EXTTEXTOUTW record, the system extracts at least one of the following: text content string, text output position coordinates, font handle (obtained through the previously created font object), character spacing, text alignment, etc. The system encapsulates this information into a text element object, which contains a unique temporary identifier, content, position, font, and other attributes.

[0035] For example, in the extraction of pages and elements, taking the parsing of XPS format as an example, when the original data stream is in XPS format, XPS itself is a structured XML document. In step S102, parsing the original print data stream may include: the system loading the FixedPage section of the XPS document, traversing each element node in the page: for <glyphs>Nodes represent text elements; extract their UnicodeString, OriginX, OriginY, FontUri, FontRenderingEmSize, and other attributes. <path>Nodes are classified as graphic or image elements based on their fill and stroke properties; for <imagebrush>Extract the URI and transformation matrix of the image resource; each element node is converted into an element object in the metadata model, retaining its original attributes and adding a system-generated unique identifier.

[0036] For example, the relationship between elements is defined by the fact that, based on the extraction of each element, the system further analyzes the logical relationship between the elements.

[0037] It is understandable that the logical relationships between elements can include at least one of the following: parent-child relationship, anchoring relationship, and alignment relationship.

[0038] To identify parent-child relationships, the Z-order of elements and container nesting relationships can be analyzed to determine which elements belong to the same group or container. For example, multiple graphics in a flowchart may belong to the same flowchart group. To identify anchoring relationships, the anchoring relationship between embedded images, tables, and other elements in text and surrounding text can be identified to analyze whether the element's position is absolute or relative to the page or parent container. To identify alignment relationships, the alignment relationships between elements can be automatically detected, such as left alignment, right alignment, center alignment, and equal spacing. These relationships can serve as the basis for subsequent constraint rules.

[0039] For example, in the metadata model construction, after element extraction and relationship identification are completed, the system begins to construct a structured metadata model, namely the metadata model of the first print job.

[0040] For example, the construction of a metadata model includes: The first step is to create a model container, which involves initializing an empty print job metadata model object, including basic metadata such as job ID and creation time.

[0041] The second step is to build the page hierarchy, which involves creating a page object for each page in the original printed data, setting attributes such as page size, margins, and background, and then adding the page object to the page list of the model.

[0042] The third step is to add element nodes, which involves adding each extracted element object to the element list of the corresponding page, and assigning each element the following: a unique identifier, a type label, attribute fields, and metadata. The unique identifier can be a UUID or an auto-incrementing ID to ensure uniqueness throughout the entire job; the type label can include at least one of text, image, and table types; the attribute fields can include at least one read / write attribute such as position, size, and style; and the metadata can include other information from the original data, such as the creator and modification time.

[0043] The fourth step is to recommend a relational index, which may include creating a relational index table at the model level to record the dependencies, constraints, grouping information, etc. between elements, facilitating quick queries and updates later.

[0044] The fifth step, serialization and caching, may include: serializing the completed metadata model, i.e., the metadata model of the first print job, into an efficient data structure in memory, such as key-value pair storage or object graphs, and optionally persisting it to a temporary file to prevent data loss due to system crashes.

[0045] For example, for documents with complex layouts, such as multi-column text, floating images, nested tables, etc., at least one of the following enhancement strategies can also be used: Text flow analysis involves analyzing the reading order and line break rules of text to reconstruct the logical relationships between text blocks. Table recognition, which is to identify the table structure and treat it as a composite element by analyzing the arrangement rules of lines and text; Stacking order, that is, establishing the stacking relationship of elements based on Z-order and transparency information.

[0046] For example, font information extracted from the raw data stream may be incomplete or dependent on system fonts, and can be processed using at least one of the following methods: Record the logical attributes of the font, such as font family, size, weight, italics, etc., rather than the font handle that the system depends on; For missing font information, search for matching alternative fonts from the system font library; Standardize font information into a cross-platform description format.

[0047] For example, image data extracted from the raw data stream may be encoded in various formats, such as converting the image data into a uniform format, such as PNG or JPEG for storage; recording information such as the original size, color space, and DPI of the image; and generating thumbnails for excessively large images for preview rendering.

[0048] Thus, through the parsing and construction in step S102, the flat and difficult-to-operate raw print data stream is transformed into a metadata model with a clear structure, complete semantics, and programmable access. This metadata model has the technical effects of element-level operability, attribute read and write, relationship maintainability, rendering independence, and lightweight and efficient operation. This means that the construction of the metadata model of the first print job is completed, and the process moves from the data interception stage to the subsequent interactive preview stage, providing sufficient data preparation for subsequent user operations and real-time feedback.

[0049] Step S103: Based on the first print job metadata model, render the page view in the preview interface, and bind a unique identifier and interaction event listener to each operable element in the first print job metadata model.

[0050] The preview interface refers to the visual operation window presented to the user, which is a graphical user interface for the user to interact with the print job.

[0051] Specifically, the preview interface is a standalone application window or embedded view panel that automatically pops up after the user initiates a print request. It includes a visual display area of ​​the document pages, as well as auxiliary operation tool panels, property editing areas, page thumbnail navigation, etc. It supports user interaction through multiple input methods such as mouse, touch, and keyboard. It has real-time responsiveness, providing immediate visual feedback on every user action. In essence, the preview interface acts as a bridge connecting the user and the metadata model, transforming abstract metadata into a visual page while capturing the user's interaction intent and transmitting it to the underlying processing module.

[0052] The page view refers to the visual presentation of the page rendered in the preview interface that is completely consistent with the final printed result.

[0053] Understandably, the metadata model can be source code, and the page view can be an edited executable program; the page view will be updated accordingly every time the metadata model changes, maintaining consistency with the final printed output.

[0054] In this context, operable elements refer to independent page components that are parsed from the original print data stream and can be directly selected and manipulated by the user in the preview interface. For example, operable elements can be basic building blocks in the metadata model, corresponding to logical objects in the document; each operable element has an independent identity and a set of readable and writable attributes; visually, it is represented as an independent area on the page, which the user can select using mouse clicks, selection boxes, or other methods.

[0055] It is understood that the types of operable elements can include at least one of the following: text blocks, images, graphics, tables, and composite elements.

[0056] The text block can be at least one of paragraphs, headings, and text boxes, and its adjustable properties can be at least one of content, font, color, alignment, position, and size. The image can be at least one of photographs, illustrations, and icons, and its adjustable properties can be at least one of position, size, rotation angle, transparency, and cropping area. The graphic can be at least one of lines, rectangles, circles, and arrows, and its adjustable properties can be at least one of position, size, line type, fill color, and rotation angle. The table can be at least one of data tables and schedules, and its adjustable properties can be at least one of row height, column width, cell merging, and border style. The combined element can be at least one of flowcharts and organization charts, and its adjustable properties can be at least one of the relative position of internal elements and overall scaling.

[0057] Interactive event listeners can refer to callback mechanisms registered for each operable element to capture user input events. Essentially, interactive event listeners are a form of event-driven programming used in software design to implement user interfaces. They can continuously monitor user actions occurring on specified elements; or they can be automatically triggered and execute pre-defined processing logic when a specific event occurs (such as mouse click, drag, or hover). It's understood that each operable element can be bound to multiple types of event listeners. Event types can include at least one of the following: mouse click on an element, mouse double-click on an element, mouse press, mouse move, mouse release, mouse enters an element's area, mouse leaves an element's area, drag begins, dragging occurs, drag ends, or drag control point.

[0058] Understandably, after the event listener is triggered, it obtains the unique identifier of the target operable element through the event object, locates the corresponding node in the metadata model based on the unique identifier, reads or modifies the node's attributes, and triggers the subsequent update process.

[0059] For example, rendering a page view may include: The first step is to iterate through the page list, which means obtaining the page list in the metadata model. For each page, create a drawing canvas that matches the page size and set page-level attributes such as background color and margins.

[0060] The second step is to render the elements in Z order, that is, to sort the elements from low to high according to their zIndex property and render each element in turn.

[0061] The third step is to generate the final view, which combines the rendering results of all pages into a complete page view and displays the current page in the preview interface.

[0062] For example, the binding of a unique identifier can be achieved through data attribute binding or spatial index mapping.

[0063] Among them, the data attribute binding can store the elementId through a custom attribute in the generated DOM element or the drawing area: html <!-- If implemented with web technologies --> ... Among them, the spatial index mapping can be that in a Canvas or vector drawing scenario, the system maintains a spatial index structure: javascript / / Maintain the mapping between element positions and elementIdsconst spatialIndex = new QuadTree();spatialIndex.insert({id: 'textbox_1',bounds: { x: 100, y: 150, width: 200,height: 50}}); / / When the user clicks on the coordinates (x, y), query the element corresponding to that positionconst elementId = spatialIndex.query(x, y).

[0064] The binding of interaction event listeners can adopt the event delegation mechanism, registering a unified event listener on the container of the preview interface. Specifically, it includes: The first step is to register the mouse event listener; The second step is to implement the event handling function. Taking dragging and moving as an example, first, obtain the click coordinates, then query the element at that position through the spatial index, then record the currently selected element, then record the initial position of the element; then highlight the selected element; then display the property panel; then calculate the displacement; then calculate the new position; then update the position of the element in the preview interface in real time (temporary effect, without modifying the metadata), then display the intelligent auxiliary line; then calculate the final position, trigger the metadata update (which will trigger the subsequent step S104); finally, reset the dragging state.

[0065] The third step is to handle special interactions. For example, in the scaling condition, when the mouse hovers over the edge of the element, display the control points; when dragging the control points, trigger the size adjustment; for example, in the style modification, when double-clicking on the element, pop up the property editing panel to modify the style parameters; for example, in the right-click menu, when right-clicking, pop up the context menu to provide operations such as copy, delete, bring to front, etc.

[0066] Thus, step S103 transforms the extracted metadata model into a user-friendly page view, enabling a visual preview of the printed content. Furthermore, each operable element is bound to a unique identifier and event listener, upgrading the static preview to a dynamic interactive environment, allowing users to interact directly with page elements as if using graphic editing software. Then, the event listener mechanism captures user actions, establishing an interactive channel for subsequent real-time adjustments and feedback, ensuring that every user action is promptly perceived and processed by the system. Unique identifiers are used to map visual elements on the interface to nodes in the metadata model, ensuring that user actions are accurately mapped to the data objects that need modification. Finally, optimization techniques such as event delegation and spatial indexing are employed to maintain smooth interactive responses even on complex pages with numerous elements, enhancing the user experience. Ultimately, this prepares the ground for timely adjustments and dynamic feedback.

[0067] Step S104: In response to the operation command being detected by the interaction event listener corresponding to any target operable element in the preview interface, adjust the target operable element according to the operation command to update the first print job metadata model to the second print job metadata model.

[0068] It should be noted that the target operable element refers to the operable element currently selected by the user in the preview interface, which is about to be operated on or is currently being operated on. In essence, the target operable element is one of the many operable elements in the interaction event listener bound in step S103. It is explicitly selected by the user in the preview interface through clicking, selecting, or other methods. Visually, it is usually marked with a highlighted border, control points, etc., to indicate the object currently being operated on by the user. It is the target of operation commands, and all commands will be executed on this element.

[0069] In this context, an operation instruction refers to a structured instruction formed after the system parses an interactive event performed by a user on a target operable element, intending to change its attributes or state. Essentially, operation instructions serve as a bridge connecting interactive events and metadata modification.

[0070] Thus, through step S104, the user's operational intent can be transformed into actual changes in the metadata model, preparing for the next step of real-time visual feedback.

[0071] Step S105: Based on the second print job metadata model, generate the second target file and present it in the preview interface.

[0072] The second print job metadata model can refer to the print job metadata model updated by user operation instructions. In essence, the second print job metadata model is the new state of the first print job metadata model after one or more modifications; it includes the attribute changes brought about by the operation instructions executed by the user in step S104; and it is the direct basis for generating the final print output file in subsequent steps.

[0073] For example, the second print job metadata model is not a static, single version, but a series of dynamically generated versions based on each user operation command. It should be noted that multiple second print job metadata models may be generated during a complete print preparation process, and each second print job metadata model corresponds to a visual refresh in the preview interface.

[0074] The second target file can refer to a visualization file generated based on the metadata model of the second print job, used for presentation in the preview interface.

[0075] Thus, step S105 allows the preview interface to update immediately after each user operation, enabling users to view the update effect in the preview interface and providing them with instant visual feedback, thereby improving printing efficiency.

[0076] Step S106: In response to detecting the user confirmation operation, generate the final print data stream of the second target file according to the second print job metadata model, and execute the print output.

[0077] In this context, the user confirmation operation can refer to the instruction issued by the user after completing all adjustments in the preview interface, such as by clicking a confirmation button on the interface, such as print, generate PDF, or confirm output, indicating that they are satisfied with the current preview effect and want to execute the final output.

[0078] Understandably, the user confirmation action is the endpoint signal of the user interaction process, marking the end of the interactive adjustment phase and the beginning of the final output phase. It triggers the system to switch from preview mode to output mode, usually accompanied by changes in the interface state, such as closing the preview window or displaying progress indicators.

[0079] The final print data stream can refer to formatted data generated based on the second print job metadata model, which meets the requirements of the target printing or output device and can be directly sent to the printing device or virtual printer for output.

[0080] Understandably, the final print data stream is a sequence of device-specific print commands or a standardized electronic document format. The final print data stream can include various formats: for physical printers, it generates printer languages ​​such as PCL, PostScript, and GDI commands; for virtual printers, it generates electronic document formats such as PDF, XPS, and TIFF; and for image output, it generates bitmap formats such as JPEG and PNG.

[0081] In this way, the embodiments of the present invention achieve a closed-loop process from intercepting the original print data stream, constructing the metadata model, presenting an interactive preview interface, allowing users to make real-time adjustments, providing immediate visual feedback, to the final print output. That is, by constructing an interactive print job metadata model and binding an event listening mechanism to page elements, the traditional static and passive print preview is upgraded to a dynamic and editable interactive environment. By capturing user commands in real time and mapping them to updates of the metadata model, every adjustment can be immediately presented as visual feedback in the preview interface without refreshing. This breaks the cyclical operation model of "preview-close-modify-preview again" in the traditional printing process, compressing the multi-step, backtracking adjustment process into continuous operations within a single interface, improving the efficiency and smoothness of print preparation, and enhancing the user experience.

[0082] In some embodiments, Figure 2 This is another schematic flowchart illustrating the printing method provided in some embodiments of the present invention, such as... Figure 2 As shown, in step S104, in response to the interaction event listener corresponding to any target operable element in the preview interface listening for an operation command, the target operable element is adjusted according to the operation command to update the first print job metadata model to the second print job metadata model, including: Step S1041: Parse the event object captured by the interactive event listener to obtain the unique identifier, operation instruction type, and operation parameters of the target operable element; Step S1042: Locate the corresponding element node in the metadata model of the first print job based on the unique identifier; Step S1043: Determine the first target attribute field to be adjusted for the target operable element based on the operation instruction type and operation parameters; Step S1044: Adjust the first target attribute field according to the target operable element, and determine the metadata modification command; Step S1045: Apply the metadata modification command to the first print job metadata model, update the second attribute field of the corresponding element, the corresponding element includes the target operable element and the associated operable elements affected by the adjustment of the target operable element, so as to update the first print job metadata model to the second print job metadata model; the target attribute field includes the target attribute and the target attribute value.

[0083] In this context, an event object refers to a data structure automatically created by the operating system or browser when a user interacts with the preview interface using input devices such as a mouse, keyboard, or touchscreen. This structure encapsulates all relevant information related to the interaction. Here, the event object acts as a bridge connecting the user's physical actions with the system's logical processing. Each time a user moves the mouse, clicks a button, or touches the screen, the system generates a corresponding event object, which records the characteristic parameters of that operation in detail.

[0084] The event object includes at least one of the following: event type identifier, event source identifier, keyboard state information, timestamp, and device-related information. The event type identifier distinguishes the basic operation performed by the user, such as mouse press, mouse move, mouse release, mouse double-click, key press, and key release. These basic event types are the raw materials for the system to identify user intent. The event source identifier indicates the specific location or object of the operation, including the screen coordinates and window coordinates of the mouse pointer, as well as the interface element the operation is pointing to. For touch operations, it may also include multi-touch touch point information. The keyboard state information records the pressed state of function keys when the operation occurs. This information is crucial for distinguishing operations with different semantics; for example, holding down the Ctrl key while dragging an element may indicate a copy operation, not just a simple move. The timestamp records the precise event that occurred, used to determine the temporal relationship of operations and identify consecutive operations, such as a double-click. Device-related information may include touch pressure and touch area for touchscreen devices, and pen pressure and tilt angle for drawing tablets.

[0085] For example, during the parsing of the captured event object, the unique identifier of the target operable element can be obtained in at least one of the following ways: For implementations based on vector graphics or the DOM, the event object typically contains a reference to the target object that triggered the event, which is pre-bound with a unique identifier for the corresponding operable element; For the canvas-based implementation, the system uses the coordinate information in the event object, combined with a pre-built spatial index structure, to query the operable element corresponding to that coordinate position, thereby obtaining its unique identifier.

[0086] For example, when the system parses the captured event objects, in obtaining the operation instruction type, the system does not directly use the original event type as the operation instruction. Instead, it analyzes the event sequence and context to convert the original event into an operation instruction type with clear semantics. For example, a sequence of events from continuous mouse press to mouse movement and release, if it occurs inside an element and does not trigger a control point, is identified as a move instruction; if the mouse press occurs at an edge control point of the element, it is identified as a zoom instruction; if the event type is a double-click, it is identified as a style modification instruction; and if the event type is a key press and the key value is Delete, it is identified as a delete instruction.

[0087] For example, during the parsing of the captured event objects, the system obtains operation parameters. These operation parameters are specific quantitative descriptions of the operation instructions. Different types of operation instructions carry different parameters. For instance, for a movement instruction, operation parameters include at least one of the following: displacement vector, starting coordinates, current coordinates, etc.; for a scaling instruction, operation parameters include at least one of the following: control point type, width change, whether to maintain aspect ratio, etc.; for a style modification instruction, operation parameters include the name of the style to be modified and the modified style value; for a keyboard-triggered instruction, operation parameters include at least one of the following: key name, function key state, etc. Thus, step S1041 transforms the original, low-level interactive events into high-level operation descriptions with clear semantics and quantitative parameters, providing standardized input for subsequent processing.

[0088] Here, based on the identifier, the corresponding element node is located in the first print job metadata model. This means the first print job metadata model is a structured dataset that maintains a fast index table from element identifiers to element objects. For example, the system locates the complete data node of the target element in the model in constant time using hash lookup or tree traversal. The location result includes not only all attributes of the target element itself (such as position, size, style, content, etc.) but also the element's contextual information in the model, such as its page, parent container, list of child elements, and associated constraints. This contextual information will be used in subsequent steps to determine the rationality and propagation of element adjustments.

[0089] In this context, the target attribute refers to the element characteristic parameter that the user intends to modify; it is a specific field in the metadata model that can be modified. Each operable element contains a set of modifiable attributes, which together determine how the element is presented on the page.

[0090] For example, the target attributes that can be modified vary depending on the element type. Specifically, the target attributes common to all elements include at least one of the following: position attribute, size attribute, stacking attribute, rotation attribute, and visibility attribute. Among them, the position attribute includes X-axis and Y-axis coordinates, which determine the placement position of the element on the page; the size attribute includes width and height, which determine the size of the area occupied by the element; the stacking attribute, i.e., the Z-axis order, determines the front-to-back occlusion relationship when multiple elements overlap; the rotation attribute determines the rotation angle of the element; and the visibility attribute determines whether the element is displayed on the page.

[0091] The target attributes for text elements can include at least one of the following: content attributes, font attributes, style attributes, and paragraph attributes. Content attributes are the text string itself; font attributes include font type, font size, and font color; style attributes include bold, italic, underline, and strikethrough; and paragraph attributes include alignment, line spacing, character spacing, and indentation. The target attributes for image elements can include at least one of the following: image source attributes, transparency attributes, and cropping attributes. The target attributes for graphic elements can include at least one of the following: fill attributes, border attributes, and shape attributes.

[0092] Understandably, the target attribute value can refer to the specific numerical value, string, or state that the user wishes to modify the target attribute to. The target attribute, together with the target attribute, forms an attribute-value pair that fully expresses the user's modification intent.

[0093] Determining the target attribute value may include the following factors: Operation command type: different types of operation commands correspond to different attribute value calculation methods. For example, for the move command, the target attribute value is the new coordinates calculated by the displacement vector; for the scale command, the target attribute value is the new size calculated by the drag distance of the control point; for the style modification command, the target attribute value is the style parameter directly obtained from the attribute panel.

[0094] The specific values ​​of the operation parameters, such as the displacement, scaling ratio, and style selection in the operation parameters, are combined with the current attribute value of the element, i.e. the first target attribute field, to calculate the final target attribute field, i.e. the second target attribute field.

[0095] For example, for scaling operations, when a user drags the edge control points of an element, the system calculates the new size of the element based on the control point type (such as top-left, top-right, bottom-left, bottom-right, left border, right border, etc.) and the drag displacement vector. For scaling operations that maintain the aspect ratio (such as dragging while holding down the Shift key), the system maintains the element's original aspect ratio when calculating the new size. The newly calculated width and height values ​​are the target attribute values ​​for the size property. Simultaneously, depending on the control point type, the element's position property may also need to be adjusted accordingly. For example, when dragging the top-left control point, not only will the size change, but the top-left corner of the element will also move, at which point the position property will also generate a corresponding target attribute value.

[0096] For example, when a user selects new style parameters such as font, color, and alignment in the attribute editing panel, the system directly uses these parameter values ​​as the target attribute values ​​for the corresponding style attributes. For instance, if a user changes the font from "SimSun" to "Heiti" in the panel, the target attribute value for the "Font Type" attribute is "Heiti"; if the user changes the font size from "12pt" to "14pt", the target attribute value for the "Font Size" attribute is "14".

[0097] For example, when a user drags a new element from the toolbar or inserts an element via paste, the system determines the initial values ​​of the new element's attributes based on the insertion position, element type, and default configuration. These initial values ​​serve as the target attribute values. For instance, when inserting a text block, its position attribute is the coordinates of the mouse release point, its size attribute is the default width and height of the text block, and its content attribute is the default text.

[0098] For example, for the element deletion operation, the deletion operation does not produce a specific attribute value modification, but the system will treat "delete" as a special operation instruction, marking that the entire element node needs to be removed from the model.

[0099] It should be noted that in step S1045, the system not only updates the attributes of the target operable element, but also identifies and updates the associated operable elements affected by the adjustment of the target element. These associated elements have preset dependencies on the target element. When the target element changes, these dependencies require the associated elements to be adjusted accordingly to maintain the overall consistency of the page.

[0100] In this context, associated operable elements can refer to other page elements that have some logical or spatial dependency on the target operable element of the current operation, and therefore need to be adjusted synchronously. These dependencies may already exist in the original document, may have been established in the user's previous operations, or may have been automatically identified by the system based on layout rules.

[0101] Thus, this embodiment improves the intelligence level of interactive adjustment and user experience during virtual printing by refining the decomposition of step S104 and introducing a related element processing mechanism, and solves the problem of low printing preparation efficiency caused by users having to manually adjust multiple related elements one by one in traditional print preview.

[0102] In some embodiments, the operation instruction type includes at least one of spatial position adjustment instruction, size attribute adjustment instruction, style attribute adjustment instruction, element addition / deletion instruction, and page-level structure adjustment instruction; Based on the operation instruction type and operation parameters, determine the first target attribute field to be adjusted for the target operable element, including at least one of the following: When the operation command type is identified as a spatial position adjustment command, the displacement vector or new position coordinates of the user drag operation in the operation parameters are parsed to determine that the target attribute that needs to be adjusted for the target operable element is the positioning attribute, and the target attribute value corresponding to the positioning attribute is calculated. When the operation command type is identified as a size attribute adjustment command, the drag direction and distance of the user on the boundary control point in the operation parameters are parsed to determine that the target operable element needs to adjust the width attribute and / or height attribute, and the target attribute value corresponding to the width attribute and / or height attribute is calculated. When the operation instruction type is identified as a style attribute adjustment instruction, the style parameters modified by the user in the attribute editing panel are parsed in the operation parameters. The target attributes required by the target operable element include at least one of the following: font type, font size, font color, background color, alignment, border style, and transparency. The target value corresponding to the target attribute is then obtained. When the operation instruction type is identified as a page-level structure adjustment instruction, the target position of the user's dragging of the page thumbnail or the position of adding / deleting pages is parsed in the operation parameters. The target attribute to be adjusted is determined to be the page sequence information, and the corresponding target attribute value is generated according to the page order adjustment, page addition or page deletion operation.

[0103] Thus, this embodiment categorizes user interactions into five main types of operation commands: spatial position adjustment, size attribute adjustment, style attribute adjustment, element addition / deletion, and page-level structure adjustment. This covers all scenarios requiring print adjustments. Each operation type corresponds to a clear recognition logic and parameter parsing method, ensuring the system can accurately understand each user's operational intent and reducing ambiguity and misjudgment. Furthermore, by establishing a mapping relationship between operation command types and target attribute fields—spatial position adjustment mapped to positioning attributes, size adjustment to width and height attributes, and style adjustment to various style parameters—this operation mapping attribute allows user operational intents to be translated into specific modifications to the metadata model. Users drag to modify the position, zoom to adjust the size, and select values ​​to change the style, achieving truly intuitive operation. Further, this embodiment employs differentiated parameter calculation methods for different types of operation commands: for spatial position adjustment, new coordinates are calculated based on the displacement vector; for size adjustment, new width and height are calculated based on the control point type and drag distance; and for style adjustment, panel parameter values ​​are directly obtained. This adaptive calculation method ensures that each operation yields attribute values ​​that most closely align with physical intuition. The distance an element moves is directly proportional to the amount of data dragged, and the scaling is precisely matched to the user's expectations. Furthermore, this embodiment covers operation types ranging from element-level adjustments to position, size, and style, to page-level additions, deletions, and sorting adjustments, forming a complete operational system from micro to macro levels. Users can fine-tune individual elements or restructure the entire document's page structure to meet the diverse adjustment needs of complex printing tasks. Moreover, by transforming raw interactive events into structured operation instructions and parameters, this embodiment achieves faithful transmission of user intent between system modules. The preview interface captures the user's physical operations; through parsing and mapping in this embodiment, accurate attribute modification instructions are transmitted to the metadata model, ensuring that the user's intent for each operation is executed completely and accurately. Furthermore, the mapping framework of "operation instruction type - target attribute - calculation method" established in this embodiment has excellent scalability. When new operation types need to be supported in the future, simply adding the new instruction types and their corresponding attribute mappings and calculation logic to this framework will allow for seamless integration into the existing system without requiring a complete architecture refactoring. Finally, the operation instruction type design in this embodiment aligns with user intuition: moving an element changes its position, dragging an edge changes its size, and double-clicking modifies its style. Users do not need to learn abstract parameter settings; they can complete all adjustments directly through physical operations, significantly lowering the barrier to entry and enhancing the user experience. In summary, this embodiment, through the systematic classification and targeted processing of operation instruction types, constructs an interactive instruction processing system that is both comprehensive and precisely responsive, providing solid technical support for WYSIWYG adjustments in virtual printing.

[0104] In some embodiments, before applying the metadata modification command to the metadata model of the first print job, the method further includes: Obtain the set of predefined constraint rules in the metadata model of the first print job. The constraint rules include at least one of the following: element alignment relationship, equal spacing relationship, fixed margin relationship, hierarchical relationship, minimum / maximum size limit, and page margin limit. Verify that the metadata modification command conforms to all rules in the constraint rule set; If the verification passes, the update operation of the second attribute field of the corresponding element will be performed; If the verification fails, perform one of the following operations: Reject the metadata modification command and display a conflict message to the user in the preview interface; The system automatically adjusts the target attribute value in the metadata modification command according to the constraint rules, generates a corrected metadata modification command that conforms to the constraint rules, and executes the corrected metadata modification command.

[0105] Among them, constraint rules can refer to predefined conditions and restrictions used to regulate the layout and attributes of page elements. These rules ensure that no matter how the user adjusts them, the final printed output can maintain visual consistency and technical printability.

[0106] The essence of constraint rules is to regulate the behavior of elements, and their sources include at least one of the following: The inherent properties of the document itself, such as the alignment settings in the original document; Physical limitations of printing equipment, such as printers that do not support borderless printing; Design specifications, such as fixed margins in corporate VI specifications; User-defined preferences, such as the minimum font size set by the user.

[0107] The constraint rule set can refer to the complete set of all constraint rules applied to the current print job. This set is stored in a structured form in the metadata model and organized according to different scopes and priorities.

[0108] The alignment relationship between elements refers to the constraint that two or more elements maintain a certain alignment in spatial position, ensuring that the related elements are arranged visually in a neat and uniform manner. The types of alignment relationships between elements can include at least one of the following: left alignment, right alignment, top alignment, bottom alignment, horizontal center alignment, and vertical center alignment.

[0109] In practical applications, alignment is usually achieved through the master-slave pattern, which specifies a master element and other slave elements follow the alignment position of the master element. When the user adjusts the master element, the slave elements automatically adjust synchronously. When the user adjusts the slave elements, the system may allow the alignment relationship to be temporarily broken or the master element to be redefined.

[0110] For example, three text boxes are left-aligned, with text boxes B and C left-aligned relative to text box A. When the user drags text box A 50 pixels to the left, the system automatically reduces the coordinates of text boxes B and C by 50 pixels to maintain left-edge alignment. If the user attempts to drag text box B alone, the system may prompt the user to either remove the alignment or set text box B as the main element.

[0111] In this context, equal spacing refers to maintaining an equal distance between a group of elements. This relationship ensures that the elements are evenly distributed and form a neat visual rhythm. The types of equal spacing can include at least one of the following: equal horizontal spacing, equal vertical spacing, and equal side spacing.

[0112] In practical applications, the equal spacing relationship defines the arrangement rules of a set of elements. When the user adjusts the position or size of one of the elements, the system will recalculate the position of the entire set of elements to ensure that the spacing between all adjacent elements remains consistent.

[0113] For example, five icons are arranged horizontally with equal spacing, initially spaced 20 pixels apart. When the user drags the third icon to the right, increasing the spacing between it and the second icon to 30 pixels, the system automatically recalculates the positions of the fourth and fifth icons, ensuring that all adjacent icons are spaced 30 pixels apart, maintaining an equal spacing relationship.

[0114] Fixed margin relationships refer to maintaining a fixed distance between an element and the page boundary or other reference elements, ensuring the element's relative position on the page remains stable. Types of fixed margin relationships can include at least one of the following: fixed page margins, fixed element spacing, and fixed container margins.

[0115] In practical applications, fixed margin relationships are achieved by recording reference points and offsets. When the reference element moves, the target element automatically adjusts its position according to the fixed offset. For example, a company logo is set to a fixed margin from the top left corner of the page (e.g., X=20 mm, Y=15 mm). Regardless of how the user adjusts other elements on the page, when attempting to move the logo, the system will prevent it from exceeding the fixed margin range, or automatically snap it back to the nearest compliant position after movement.

[0116] In this context, hierarchy refers to the stacking order of elements along the Z-axis, determining the occlusion relationship when multiple elements overlap. It's understandable that hierarchy can be represented in at least one of the following ways: Z-order value, parent-child hierarchy, and floating hierarchy. Z-order value means each element has a unique Z-order value, with larger values ​​indicating higher positions. Parent-child hierarchy means child elements are always displayed above their parent elements, such as text in a text box always appearing above the text box background. Specific elements, such as floating toolbars, are always on the top layer.

[0117] It is understood that the constraint rules for hierarchical relationships may include at least one of the following: Z-order range restriction, that is, the Z-order value of an element must be within a valid range, such as 1-100; Z-order uniqueness means that the Z-order values ​​of different elements within the same container are usually not repeated. The parent-child relationship constraint, that is, the Z-order of the child element is defined relative to the parent element, and the child element follows when the parent element moves.

[0118] For example, a text box (Z-order=5) contains an image (Z-order=relative). When the user attempts to adjust the image's Z-order to an absolute value, the system will prompt "The image is a child element, and its hierarchy should be relative to the parent text box definition," and automatically maintain the correct parent-child hierarchy relationship.

[0119] The minimum / maximum size limit refers to the allowed range of element size, ensuring that the element does not become too small to be identifiable, nor too large to exceed the page limits. The type of size limit includes at least one of the following: minimum width, maximum width, minimum height, maximum height, minimum font size, and maximum font size.

[0120] In practical applications, when a user zooms in or out of an element, the system calculates the new size in real time and compares it with a preset limit. If the new size exceeds the limit, the system automatically truncates the size to the boundary value or prevents further zooming. For example, if an image element has a minimum width of 50 pixels and a maximum width of 300 pixels, when the user attempts to drag the image width down to 30 pixels, the system will zoom out further after reaching 50 pixels and display a message in the preview interface stating "Minimum size limit reached." When the user attempts to zoom in to 350 pixels, the system will prevent further zooming after reaching 300 pixels.

[0121] Page margin constraints refer to the boundary constraints of non-printable or safe areas around the page, ensuring that elements do not exceed the printable area of ​​the page. Page margin types include at least one of the following: top margin, bottom margin, left margin, right margin, and gutter margin. Page margin constraints can be implemented by defining a safe area on the page, where the position and size of all elements must ensure that the elements fall completely within that safe area.

[0122] For example, the position and size of the element satisfy at least one of the following: The left boundary of the element is greater than or equal to the left boundary of the safe region; The right boundary of an element is less than or equal to the boundary of the safe region; The upper boundary of the element is greater than or equal to the upper boundary of the safe region; The lower boundary of an element is less than or equal to the lower boundary of the safe region.

[0123] For example, an A4 page (width = 595 pixels, height = 842 pixels) has a uniform margin of 72 pixels. The safe area is: left margin 72, right margin 523 (595-72), top margin 72, and bottom margin 770 (842-72). When a user attempts to drag an image to coordinates (50, 50), the system detects that the image's left margin (50) is smaller than its right margin (72), automatically snaps the image to (72, 72), and displays the message "Automatically aligned to margins."

[0124] For example, verifying whether the metadata modification command conforms to the rules in the constraint rule set may include: Obtain the set of constraint rules; Verify metadata modification commands; Verification result processing.

[0125] The set of constraint rules obtained may include: Before applying the metadata modification command, the system first obtains the currently effective set of constraint rules from the metadata model of the first print job. This set contains rules at multiple levels and is organized in the following priority order: User-defined rules (highest priority); Document-level rules (such as style definitions in the original document); Printer hardware limitations (such as the minimum margins supported by the printer). System default rule (lowest priority).

[0126] The system iterates through each rule in the constraint rule set and verifies whether the metadata modification command meets the rule requirements.

[0127] For example, suppose a metadata modification command requests that the width of a text box be changed from 200 pixels to 250 pixels, and its position be changed from (100, 100) to (80, 80). The system performs the following verification: Verify page margin limits; Verify minimum / maximum size limits; Verify alignment; Verify the hierarchical relationship.

[0128] In verifying page margin constraints, for example, checking whether the new position (80,80) is within the safe area: assuming the left margin is 72 and the top margin is 72, then 80≥72, verification passes; checking whether the new size of 250 pixels causes the element's right boundary to exceed the page's right boundary: right boundary = 80+250=330, assuming the page's right margin is 72 and the page width is 595, then 330≤523(595-72), verification passes.

[0129] Among them, in verifying the minimum / maximum size limit, for example, assuming the minimum width of the text box is 50 and the maximum width is 400, then 250 is within the range and the verification passes.

[0130] The verification result processing may include at least one of the following three processing methods: If the verification is successful and the metadata modification command meets all constraint rules, the system will execute the update operation normally, apply the modification command to the metadata model, and update the second attribute field of the corresponding element.

[0131] If the verification fails and modification is rejected, the system will refuse to execute the command when the metadata modification command seriously violates the constraint rules and cannot be automatically corrected. The system will then display a conflict message to the user in the preview interface. The message will be presented in at least one of the following ways: displaying a warning icon next to the element, popping up a brief message box explaining the specific rule violated, highlighting the attribute value that violated the rule in red, or providing suggested solutions. For example, a user attempts to change the width of a text box to 0 pixels, but the minimum width requirement is 50 pixels. The system will refuse to execute the modification, display a red warning border around the text box, and pop up a message stating: "Width cannot be less than 50 pixels."

[0132] If the verification fails but automatic correction is performed, when a metadata modification command violates a constraint rule but the rule allows for automatic correction, the system will automatically adjust the target attribute value in the command according to the constraint rule, generate a corrected command that conforms to the constraint rule, and execute the corrected command.

[0133] The automatic correction strategy can automatically match the rules based on the type of rule being violated.

[0134] For example, if the element exceeds the page margins, the autocorrect strategy is to snap the element to the nearest compliant position; if the element exceeds the maximum size, the autocorrect strategy is to truncate the size to the maximum value; if the alignment is broken, the autocorrect strategy is to adjust related elements synchronously to maintain alignment.

[0135] For example, a user attempts to drag an image to coordinates (50, 50), but the left margin of the page is 72. The system automatically corrects the target position to (72, 72) and executes the corrected command. Simultaneously, a brief notification appears in the preview interface stating "Automatically aligned to page margins," informing the user that the automatic correction has occurred. Thus, this embodiment introduces a constraint verification mechanism before applying the metadata modification command to the metadata model of the first print job, ensuring that all user adjustments comply with preset rules and restrictions, thereby reducing the generation of invalid or unreasonable page layouts. Through this mechanism, the system can maintain the overall standardization and printability of the document while ensuring user adjustments.

[0136] In some embodiments, when verification is successful and the element node involved in the metadata modification command has a preset dependency relationship with one or more associated elements, the metadata modification command is executed to update the second attribute field of the corresponding element, including: Identify associated elements that have dependencies on the target operable element of the current operation. Dependencies include at least one of parent-child relationships, anchoring relationships, group relationships, and alignment constraint relationships. Based on the type of metadata modification command and dependency relationship, automatically calculate the amount of attribute changes that need to be adjusted synchronously for each element in the associated element set; Generate a set of batch metadata modification commands for the target operable element and its associated elements. The set of batch metadata modification commands includes metadata modification commands and associated metadata modification commands corresponding to each associated element. Execute a set of batch metadata modification commands to update the attribute fields of all affected element nodes in the metadata model of the first print job at once.

[0137] In this context, a parent-child relationship refers to a hierarchical containment relationship between elements. One element (the parent element) acts as a container, containing one or more other elements (child elements). The existence and position of child elements depend on the parent element. For example, consider a text box and its inner text; the text box is the parent element, and the inner text block is the child element. When the text box moves, the inner text moves accordingly; when the text box is resized, the inner text may need to be rearranged.

[0138] Anchoring refers to the fixed relationship between an element (the subordinate element) and another element (the anchor element) or a page reference point, where the position, size, or behavior of the subordinate element remains constant. Anchoring defines how the subordinate element responds to changes in the anchor element.

[0139] The anchoring relationship can include at least one of the following types: top-left corner anchoring, center anchoring, edge anchoring, and proportional anchoring. For example, in an image and caption, the caption text is anchored below the image, at a fixed distance of 5 mm from the bottom edge. When the image moves, the caption follows; when the image height changes, the caption position automatically adjusts to maintain a fixed distance.

[0140] In this context, a group relationship can refer to multiple elements being logically combined together and operated and processed as a whole. The elements within the group maintain their relative positions, but can be moved, scaled, rotated, or otherwise manipulated as a single unit.

[0141] The group relationship type can include at least one of the following: temporary group, permanent group, and smart group. A temporary group can be multiple elements temporarily selected by the user for unified operation; a permanent group can be a fixed combination that is explicitly created and needs to be ungrouped for individual adjustment; a smart group can be a group automatically identified by the system based on logical relationships, such as data series in an icon being automatically grouped. For example, in a flowchart component, a flowchart consists of multiple rectangles, diamonds, and connecting lines, and these elements are permanently grouped. When the user moves the entire flowchart, all elements maintain their relative positions; when the user zooms in on the flowchart, all elements scale proportionally, and the connecting lines automatically adjust their endpoint positions.

[0142] Alignment constraints refer to spatial constraints that maintain a certain alignment between multiple elements. This ensures that related elements maintain a visually uniform arrangement, which is crucial for ensuring the standardization of page layout. Types of alignment constraints can include at least one of the following: edge alignment, center alignment, baseline alignment, and distribution alignment. For example, in form tags, all tags are set to left alignment, forming a neat vertical line. When a user adjusts the position of one tag, the system automatically adjusts the other tags to maintain the left alignment. Another example is in footer elements, where elements such as copyright information and contact details are set to bottom alignment to ensure they are neatly arranged vertically.

[0143] Thus, this application embodiment constructs an intelligent and efficient linkage adjustment mechanism through dependency identification and batch processing, which improves user operation efficiency and experience while ensuring the integrity of document structure and visual standardization.

[0144] In some embodiments, step S105, based on the second print metadata model, generates a second target file and presents it in the preview interface, including: Based on the second print job metadata model, an enhanced rendering strategy is used to partially refresh the area affected by the operation command in the preview interface, generate the second target file, and display it in real time in the preview interface.

[0145] Enhanced rendering strategy refers to an intelligent page refresh method that differs from traditional full-page redrawing. By precisely locating the area affected by the operation and re-rendering only that area, it improves rendering performance and interaction smoothness while maintaining visual feedback quality. In short, enhanced rendering strategy only redraws the parts that need to change, rather than the entire page. This strategy, based on a deep understanding of human visual perception characteristics and computer graphics rendering principles, achieves an optimal balance between performance and image quality.

[0146] In some embodiments, an enhanced rendering strategy is used to partially refresh the area of ​​the preview interface affected by the operation command, including: Identify the element nodes affected by the operation command and their surrounding related elements, and determine the minimum redraw rectangle area; Re-render the visible content within the smallest redraw rectangle area; The rendering results of the unaffected areas are cached and then combined with the redrawn areas to present the complete results in the preview interface. The minimum redraw distance area is dynamically calculated based on the position coordinates, size attributes, and layout relationship of the element node with its surrounding elements.

[0147] Thus, in this embodiment of the application, by accurately calculating the minimum redraw rectangle area and introducing a cache splicing mechanism, the technical advantages of the enhanced rendering strategy are maximized, achieving the best balance between rendering efficiency and visual quality, and providing users with a smooth, natural, and efficient interactive experience.

[0148] To achieve the above objectives, embodiments of the present invention also provide a computing device, such as... Figure 3 As shown, the computing device includes a processor 301 and a memory 303 connected to the processor 301 via a communication bus 302; wherein, the memory 303 is used for an automatic processing program for a business process; the processor 301 is used to execute the automatic processing program for the business process to implement the automatic processing method for the business process described in any of the above schemes.

[0149] Optionally, the processor 301 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Here, the program executed by the processor 301 may be stored in a memory 303 connected to the processor 301 via a communication bus 302. The memory 303 may be volatile memory or non-volatile memory, or may include both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache.By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The memory 303 described in this embodiment is intended to include, but is not limited to, these and any other suitable types of memory 303. The memory 303 in this embodiment is used to store various types of data to support the operation of the processor 301. Examples of this data include: any computer programs operated by the processor 301, such as operating systems and applications; contact data; phonebook data; messages; pictures; videos, etc. The operating system contains various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks.

[0150] In some embodiments of the present invention, the memory 302 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0151] The processor 301 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 301 or by instructions in software form. The processor 301 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 302, and the processor 301 reads the information in memory 302 and, in conjunction with its hardware, completes the steps of the above method. In some embodiments, the embodiments described herein can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0152] For software implementation, the techniques described herein can be achieved through modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented within the processor or externally.

[0153] Another embodiment of the present invention provides a computer storage medium storing an executable program, which, when executed by a processor 301, can implement the steps of a printing method applied to the computing device. For example, as... Figures 1-2 One or more of the methods shown.

[0154] In some embodiments, the computer storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0155] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.

[0156] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.< / imagebrush> < / path> < / glyphs>

Claims

1. A printing method, characterized in that, include: In response to a print command for a first target file, the original print data stream of the first target file is intercepted at the virtual print layer or print service layer. Parse the original print data stream and construct the metadata model of the first print job; Based on the first print job metadata model, a page view is rendered in the preview interface, and a unique identifier and interaction event listener are bound to each operable element in the first print job metadata model. In response to the operation command being detected by the interaction event listener corresponding to any target operable element in the preview interface, the target operable element is adjusted according to the operation command to update the first print job metadata model to the second print job metadata model. Based on the second print job metadata model, a second target file is generated and presented in the preview interface; Upon detecting a user confirmation operation, the final print data stream of the second target file is generated according to the second print job metadata model, and the print output is executed.

2. The method according to claim 1, characterized in that, The interaction event listener that responds to any target operable element in the preview interface listens for an operation command, and adjusts the target operable element according to the operation command to update the first print job metadata model to the second print job metadata model, including: Parse the event object captured by the interaction event listener to obtain the unique identifier, operation instruction type, and operation parameters of the target operable element; Based on the unique identifier, locate the corresponding element node in the first print job metadata model; Based on the operation instruction type and operation parameters, determine the first target attribute field to be adjusted for the target operable element; Adjust the first target attribute field according to the target operable element, and determine the metadata modification command; The metadata modification command is applied to the first print job metadata model to update the second attribute field of the corresponding element. The corresponding element includes the target operable element and the associated operable elements affected by the adjustment of the target operable element, so as to update the first print job metadata model to the second print job metadata model. The target attribute field includes the target attribute and the target attribute value.

3. The method according to claim 2, characterized in that, The operation instruction types include at least one of the following: spatial position adjustment instruction, size attribute adjustment instruction, style attribute adjustment instruction, element addition / deletion instruction, and page-level structure adjustment instruction; The step of determining the first target attribute field to be adjusted for the target operable element based on the operation instruction type and operation parameters includes at least one of the following: When the operation instruction type is identified as a spatial position adjustment instruction, the displacement vector or new position coordinates of the user drag operation in the operation parameters are parsed, the target attribute that needs to be adjusted for the target operable element is determined to be a positioning attribute, and the target attribute value corresponding to the positioning attribute is calculated. When the operation instruction type is identified as a size attribute adjustment instruction, the drag direction and distance of the user on the boundary control point in the operation parameters are parsed to determine that the target attribute that needs to be adjusted for the target operable element is the width attribute and / or the height attribute, and the target attribute value corresponding to the width attribute and / or the height attribute is calculated. When the operation instruction type is identified as a style attribute adjustment instruction, the style parameters modified by the user in the attribute editing panel are parsed in the operation parameters. The target attributes required by the target operable element include at least one of the following: font type, font size, font color, background color, alignment, border style, and transparency. The target attribute values ​​corresponding to each target attribute are then obtained. When the operation instruction type is identified as an element addition or deletion instruction, the insertion position or the identifier of the element to be deleted triggered by the user in the operation parameters is parsed, the target attributes that need to be adjusted are the element list and page layout information, and the corresponding target attribute values ​​are generated according to the insertion or deletion operation. When the operation instruction type is identified as a page-level structure adjustment instruction, the target position of the user's dragging of the page thumbnail or the position of adding / deleting pages in the operation parameters is parsed to determine that the target attribute to be adjusted is page sequence information, and the corresponding target attribute value is generated according to the page order adjustment, page addition or page deletion operation.

4. The method according to claim 2, characterized in that, Before applying the metadata modification command to the metadata model of the first print job, the method further includes: Obtain a set of predefined constraint rules from the first print job metadata model. The constraint rules include at least one of the following: element alignment relationship, equal spacing relationship, fixed margin relationship, hierarchical relationship, minimum / maximum size limit, and page margin limit. Verify whether the metadata modification command conforms to the rules in the constraint rule set; If the verification passes, the update operation of the second attribute field of the corresponding element is executed; If the verification fails, perform one of the following operations: The metadata modification command is rejected, and a conflict message is displayed to the user in the preview interface; The target attribute value in the metadata modification command is automatically adjusted according to the constraint rules to generate a corrected metadata modification command that conforms to the constraint rules, and the corrected metadata modification command is executed.

5. The method according to claim 4, characterized in that, When the verification is successful and the element node involved in the metadata modification command has a preset dependency relationship with one or more associated elements, the execution of the metadata modification command to update the second attribute field of the corresponding element includes: Identify a set of associated elements that have dependencies on the target operable element of the current operation, wherein the dependencies include at least one of parent-child relationships, anchoring relationships, group relationships, and alignment constraint relationships; Based on the metadata modification command and the type of the dependency relationship, automatically calculate the amount of attribute change that needs to be synchronously adjusted for each element in the set of associated elements; Generate a set of batch metadata modification commands for the target operable element and its associated elements. The set of batch metadata modification commands includes the metadata modification commands and the associated metadata modification commands corresponding to each associated element. The batch metadata modification command set is executed to update the attribute fields of all affected element nodes in the first print job metadata model at once.

6. The method according to claim 1, characterized in that, The step of generating a second target file based on the second print job metadata model and presenting it in the preview interface includes: Based on the second print job metadata model, an enhanced rendering strategy is used to partially refresh the area in the preview interface affected by the operation command, generate a second target file, and display it in real time in the preview interface.

7. The method according to claim 6, characterized in that, The step of employing an enhanced rendering strategy to partially refresh the area of ​​the preview interface affected by the operation command includes: Identify the element nodes affected by the operation command and their surrounding related elements, and determine the minimum redraw rectangle area; The visible content within the minimum redraw rectangle area is re-rendered; The rendering results of the unaffected cache area are combined with the redrawn area and presented in full in the preview interface; the minimum redrawn rectangle area is dynamically calculated based on the position coordinates, size attributes and layout relationship of the element node with the surrounding elements.

8. The method according to claim 1, characterized in that, The step of binding a unique identifier and an interaction event listener to each operable element in the print job metadata model includes: A unified event listener is registered on the container object of the preview interface using an event delegation mechanism; When a user interacts with any operable element, the unified event listener captures the triggered event through an event bubbling mechanism; Parse the event object to obtain the unique identifier and event type of the target operable element; Locate the corresponding element node in the metadata model of the first print job based on the unique identifier; Based on the event type and event parameters, the corresponding operation instruction processing flow is triggered.

9. A computing device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method as described in any one of claims 1 to 8.

10. A computer storage medium, characterized in that, A computer storage medium stores one or more programs that can be executed by one or more processors to cause the one or more processors to perform the method as described in any one of claims 1 to 8.