Electronic seal processing method and device, electronic equipment and storage medium

By performing lossless magnification and transformation matrix processing on the electronic seal image, the jagged edges and blurriness issues of the electronic seal during magnified preview were resolved, achieving clear display and printing consistency of the electronic seal and improving the application efficiency of electronic documents.

CN121921209APending Publication Date: 2026-04-24BEIJING CERTIFICATE AUTHORITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING CERTIFICATE AUTHORITY
Filing Date
2026-01-12
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

The image of an electronic seal is prone to jagged edges and blurring when magnified and previewed, and the printed seal is not the same size as the physical seal, which affects the mutual trust and recognition of electronic documents and the efficiency of application.

Method used

By acquiring the pixel information of the electronic seal image, a lossless magnification algorithm is used to enlarge it to the target pixel size. Combined with the seal position and size information of the layout document, a transformation matrix is ​​used to scale the enlarged image to the specified position, ensuring that it is displayed at a size smaller than the lossless magnification when the document is enlarged for preview.

Benefits of technology

It effectively eliminates jagged edges and blurriness caused by magnification, improves the clarity and printing consistency of electronic seals, enhances the application efficiency of electronic documents, and avoids repetitive operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921209A_ABST
    Figure CN121921209A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an electronic seal processing method and device, electronic equipment and a storage medium. The method comprises the steps that a first electronic seal image is acquired; determining a second electronic seal image according to the pixel information of the first electronic seal image and the target pixel information; converting the second electronic seal image to obtain a third electronic seal image in the format document; according to the stamp position information and the size information in the format document, the third electronic stamp image in the format document is converted and placed at the position corresponding to the stamp position information and the size information, and the converted target electronic stamp image is obtained. And the electronic seal is still displayed in a size smaller than that after lossless amplification, so that the image of the electronic seal is kept clear, and sawtooth and blurring conditions caused by amplification are eliminated to a greater extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for processing electronic seals. Background Technology

[0002] As a legally binding identifier, the clarity of an official seal is crucial for confirming its authenticity and legality. In the field of electronic signatures, while the size and resolution of electronic seal images are only visual considerations, they still significantly impact the mutual trust and recognition of electronic documents, reflecting the standardized and rigorous actions of the seal holder. Therefore, ensuring the authenticity and clarity of electronic seals is of great importance. However, due to factors such as scanning quality and tool processing parameters, generated electronic seal images often suffer from inconsistent formats, incorrect sizes, and poor clarity. Furthermore, the presence of significant image noise ultimately leads to numerous problems in signed documents, such as severe jagged edges and blurring during magnified previews, and discrepancies between the printed seal and the physical seal. Therefore, it is necessary to improve the clarity of electronic seals. Summary of the Invention

[0003] The purpose of some embodiments of this application is to provide a method, apparatus, electronic device, and storage medium for processing electronic seals. Through the technical solutions of the embodiments of this application, a first electronic seal image is acquired; a second electronic seal image corresponding to the first electronic seal image is determined based on the pixel information and target pixel information of the first electronic seal image; the second electronic seal image is converted to obtain a third electronic seal image in a layout document; based on the seal position information and size information in the layout document, the third electronic seal image in the layout document is converted and placed at a position corresponding to the seal position information and size information to obtain a converted target electronic seal image. The embodiments of this application enlarge the electronic seal image and then scale the enlarged electronic seal image to a specified seal position. Thus, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlarged size, thereby keeping the electronic seal image clear and largely eliminating jagged edges and blur caused by enlargement.

[0004] Firstly, some embodiments of this application provide a method for processing an electronic seal, including: Obtain the image of the first electronic seal; Based on the pixel information and target pixel information of the first electronic seal image, a second electronic seal image corresponding to the first electronic seal image is determined. The second electronic seal image is converted to obtain the third electronic seal image in the layout document; Based on the seal position and size information in the layout document, the third electronic seal image in the layout document is converted and placed in the position corresponding to the seal position and size information to obtain the converted target electronic seal image.

[0005] Some embodiments of this application enlarge the electronic seal image and then scale the enlarged electronic seal image to the specified seal position. In this way, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlarged size, thereby keeping the electronic seal image clear and eliminating jagged edges and blurring caused by enlargement to a large extent.

[0006] Optionally, determining the second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image includes: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain a processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image. Some embodiments of this application determine whether the actual pixel size of the first electronic seal image is smaller than the target pixel information. If it is smaller, a lossless magnification algorithm is used to magnify the first electronic seal image to the target pixel. If it is larger, no processing is performed on the first electronic seal image.

[0007] Optionally, the step of magnifying the first electronic seal image to obtain a processed image includes: A lossless magnification algorithm is used to magnify the image of the first electronic seal to obtain the processed image.

[0008] In some embodiments of this application, if the pixel count of the first electronic seal image is low, the first electronic seal image is enlarged to obtain an electronic seal image with a target pixel count.

[0009] Optionally, the step of converting the third electronic seal image in the layout document according to the seal position information and size information in the layout document, and placing it at the position corresponding to the seal position information and size information to obtain the converted target electronic seal image, includes: Based on the seal position and size information in the layout document, the position and size information of the layout document are converted into the layout document's position and size information, and the image drawing area is determined based on the layout document's position and size information; Based on the seal position and size information of the document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image. In some embodiments of this application, the electronic seal image is first enlarged, and then the enlarged electronic seal image is compressed into a pre-set image drawing area according to the transformation matrix, thus obtaining the target electronic seal image. Optionally, determining the image drawing area based on the seal position and size information of the document includes: The image rectangle is determined based on the seal position and size information of the document.

[0010] Some embodiments of this application generate image rectangles in the layout document based on the seal position information of the layout document and the preset physical size of the electronic seal, for storing electronic seal images.

[0011] Optionally, the first electronic seal image is in image format.

[0012] Secondly, some embodiments of this application provide an electronic seal processing apparatus, including: The acquisition module is used to acquire the image of the first electronic seal; The comparison module is used to determine a second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image. The conversion module is used to convert the second electronic seal image to obtain the third electronic seal image in the layout document; The mapping module is used to convert the third electronic seal image in the layout document according to the seal position information and size information in the layout document, and place it in the position corresponding to the seal position information and size information to obtain the converted target electronic seal image.

[0013] Some embodiments of this application enlarge the electronic seal image and then scale the enlarged electronic seal image to the specified seal position. In this way, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlarged size, thereby keeping the electronic seal image clear and eliminating jagged edges and blurring caused by enlargement to a large extent.

[0014] Optionally, the comparison module is used to: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain a processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image. Some embodiments of this application determine whether the actual pixel size of the first electronic seal image is smaller than the target pixel information. If it is smaller, a lossless magnification algorithm is used to magnify the first electronic seal image to the target pixel. If it is larger, no processing is performed on the first electronic seal image.

[0015] Optionally, the comparison module is used to: A lossless magnification algorithm is used to magnify the image of the first electronic seal to obtain the processed image.

[0016] In some embodiments of this application, if the pixel count of the first electronic seal image is low, the first electronic seal image is enlarged to obtain an electronic seal image with a target pixel count.

[0017] Optionally, the mapping module is used for: Based on the seal position and size information in the layout document, the position and size information of the layout document are converted into the layout document's position and size information, and the image drawing area is determined based on the layout document's position and size information; Based on the seal position and size information of the document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image. In some embodiments of this application, the electronic seal image is first enlarged, and then the enlarged electronic seal image is compressed into a pre-set image drawing area according to the transformation matrix, thus obtaining the target electronic seal image. Optionally, the mapping module is used for: The image rectangle is determined based on the seal position and size information of the document.

[0018] Some embodiments of this application generate image rectangles in the layout document based on the seal position information of the layout document and the preset physical size of the electronic seal, for storing electronic seal images.

[0019] Optionally, the first electronic seal image is in image format.

[0020] Thirdly, some embodiments of this application provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the electronic seal processing method as described in any embodiment of the first aspect.

[0021] Fourthly, some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the electronic seal processing method as described in any embodiment of the first aspect.

[0022] Fifthly, some embodiments of this application provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the electronic seal processing method as described in any embodiment of the first aspect. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of some embodiments of this application, the accompanying drawings used in some embodiments of this application will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating an electronic seal processing method provided in this application embodiment; Figure 2 A schematic diagram of the image transformation process provided in the embodiments of this application; Figure 3 A flowchart illustrating another method for processing electronic seals provided in this application embodiment; Figure 4 This is a schematic diagram illustrating the result of electronic seal processing provided in an embodiment of this application. Figure 5 A schematic diagram of the structure of an electronic seal processing device provided in an embodiment of this application; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of some embodiments of this application will now be described with reference to the accompanying drawings.

[0026] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0027] As a legally binding identifier, the clarity of an official seal is crucial for confirming its authenticity and legality. In the field of electronic signatures, while the size and resolution of electronic seal images are merely visual considerations, they still significantly impact the mutual trust and recognition of electronic documents, reflecting the standardized and rigorous actions of the entity using the seal. Therefore, ensuring the authenticity and clarity of electronic seals is of paramount importance.

[0028] In existing solutions, issues with the quality of stamp images are often only discovered during the electronic signature process. If the image needs to be redrawn at this point, the entire process must be restarted, reducing the user's productivity.

[0029] Scanning and image cutout involves scanning a physical stamped document to obtain an electronic image, which is then processed using image editing software such as Photoshop to achieve the closest possible match to the physical stamp. However, due to factors such as scanning quality and tool processing parameters, the generated images often suffer from inconsistent formats, incorrect sizes, and poor clarity. Furthermore, because of the high noise levels, images are often produced at low DPI settings with low resolution to accommodate storage needs. Ultimately, this leads to numerous problems with the signed document, such as severe jagged edges and blurring of the stamp when zoomed in, and discrepancies between the printed stamp and the actual stamp size.

[0030] Electronic seals, on the other hand, are dynamically generated using software with the same font and layout as physical seals, which can ensure clarity. However, achieving perfect consistency between electronic and physical seals requires time-consuming and labor-intensive optimization and calibration. Generally, they differ significantly from physical seals in terms of authenticity, which reduces the authority of the seal and causes public concerns about its use.

[0031] Under the premise of "same model, same track", the generated electronic seal is used to maximize its real clarity in electronic documents and ensure the efficiency of seal application. In view of this, some embodiments of this application provide a method for processing electronic seals. This method includes acquiring a first electronic seal image; determining a second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image; converting the second electronic seal image to obtain a third electronic seal image in the layout document; and converting the third electronic seal image in the layout document according to the seal position information and size information, placing it at the position corresponding to the seal position information and size information to obtain the converted target electronic seal image. This application embodiment enlarges the electronic seal image and then scales the enlarged electronic seal image to a specified seal position. Thus, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlargement, thereby maintaining the clarity of the electronic seal image and largely eliminating jagged edges and blurring caused by enlargement.

[0032] like Figure 1 As shown, an embodiment of this application provides a method for processing an electronic seal, the method comprising: S101. Obtain the image of the first electronic seal; Optionally, the first electronic seal image is in image format.

[0033] Specifically, in the process of electronic signature, the lifecycle of the electronic seal image is divided into three stages: the physical seal is converted into an electronic image, electronic seal data is generated (the electronic image is one of the attributes), and the electronic signature process (stored and displayed in the electronic document as the appearance of the signature).

[0034] The process of generating electronic seals and electronic signatures generally does not involve image processing. Therefore, the display quality of the seal in an electronic document mainly depends on the process of converting the physical seal into an electronic image. When generating electronic seal images using scanning cutout or digital drawing methods, the generated electronic seal images need to be realistic, clear, and storage efficient.

[0035] In this embodiment of the application, the terminal device acquires a first electronic seal image, which is in an image format, such as bmp, jpg, png, tif, gif, etc., and is not specifically limited in this embodiment of the application.

[0036] S102. Determine the second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image. The terminal device judges the pixel information of the first electronic seal image. If the pixel information is less than the target pixel information, the first electronic seal image is magnified until it is magnified to the target pixel information. If the pixel information is greater than or equal to the target pixel information, the first electronic seal image is not processed. In this way, a second electronic seal image corresponding to the first electronic seal image is obtained.

[0037] S103. Convert the second electronic seal image to obtain the third electronic seal image in the layout document; Specifically, the terminal device converts the second electronic seal image to obtain the third electronic seal image in the layout document.

[0038] S104. Based on the seal position and size information in the layout document, convert the third electronic seal image in the layout document and place it in the position corresponding to the seal position and size information to obtain the converted target electronic seal image.

[0039] Specifically, the terminal device pre-sets the size information of the electronic seal and the seal position information in the layout document according to the regulations of the electronic seal. It determines the image frame in the layout document to place the electronic seal, and then compresses the third electronic seal image and places it in the image frame to obtain the converted target electronic seal image. This improves the quality of the target electronic seal image, including improving the seal display effect and achieving clear and jagged-free images when the document is enlarged for preview; and improving the overall efficiency from seal creation to seal application, avoiding repeated processes due to image problems.

[0040] In this embodiment of the application, during the electronic signature process, based on the expected magnification during electronic document preview, lossless magnification technology is used to reconstruct the seal image to a uniform pixel size. Then, using the primitive objects in the layout document and the transformation matrix of each space in the layout, the large-pixel image is scaled to the absolute size of the user space and mapped to a container with the same size as the physical seal for display. When the document is magnified to the expected multiple, the seal image is still displayed with a smaller number of actual samples, thereby avoiding the jagged edges caused by magnification. At the same time, it corrects the size differences caused during image creation. During the electronic signature process of the seal image lifecycle, the image resolution is improved by magnifying the electronic seal image. The display area is compressed using the transformation matrix of the layout document and the drawing space, ensuring printing consistency while solving the blurring problem in magnified previews. This avoids or reduces the process reset process and improves application efficiency. In addition, the increased storage pressure of the seal image at the electronic document level is negligible compared to the document size, thus balancing the authenticity, clarity, and storage efficiency of the electronic seal image and improving overall application efficiency.

[0041] Some embodiments of this application enlarge the electronic seal image and then scale the enlarged electronic seal image to the specified seal position. In this way, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlarged size, thereby keeping the electronic seal image clear and eliminating jagged edges and blurring caused by enlargement to a large extent.

[0042] Another embodiment of this application further supplements the description of the electronic seal processing method provided in the above embodiments.

[0043] Based on the size requirements of electronic seals, and since the unit of measurement for formatted documents is absolute size, such as points (pt) or millimeters (mm), the consistency of the printed size of electronic seals in electronic documents is essentially a correspondence between physical size and absolute size. Therefore, specifying the required physical size of the seal image when signing can correct for problems during image generation, such as size differences caused by the lack of DPI (Dots Per Inch) information or inaccurate DPI settings.

[0044] Layout documents define a series of spaces based on the display and rendering of image elements for output to the display device. The page content of an electronic document is ultimately displayed on a computer output device; the coordinate system of this device-specific system is called device space. Layout documents define a coordinate system independent of output devices such as printing or display, which maintains the same relationship with the current page; this device-independent coordinate system is called user space. Each image has its own internal coordinate system or image space. The relationship between the above three coordinate systems or spaces is shown in the figure. Each arrow in the figure represents a transformation from one coordinate space to another, such as... Figure 2 As shown.

[0045] A transformation matrix is ​​an element of the graphical state of a layout document, used to specify the relationship between two coordinate spaces. Through the transformation matrix, objects can be scaled, rotated, translated, or otherwise transformed. Therefore, by adjusting the transformation matrix from user space to device space according to the native resolution of a specific output device, device independence of the layout page description can be maintained; by controlling the transformation matrix from image space to user space, images can be specified to be placed in page space in any orientation and size, and the unit square in user space can be mapped to the rectangle or parallelogram in which the image should be drawn.

[0046] The object data of an image in a document is transformed to the device coordinate system through the following steps: A. The data of the image object is transformed into the image space through the image transformation matrix; B. Image spatial data is transformed into external user space through an outer rectangle; C. The user space is transformed into the device space based on the size of the page area, the actual length of the coordinate units, and the device information.

[0047] Optionally, based on the pixel information of the first electronic seal image and the target pixel information, a second electronic seal image corresponding to the first electronic seal image is determined, including: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain the processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image. Among them, lossless upscaling algorithms are image processing techniques. Other techniques that can improve image quality can be used as extension or upgrade modules to replace lossless upscaling modules. If the limitations and performance losses of lossless upscaling algorithms are not considered, when the difference between the magnification and the expected preview is large enough, an image preview close to a vector effect can be achieved.

[0048] Lossless upscaling algorithms can enlarge images without compromising image quality. These algorithms utilize deep learning and super-resolution reconstruction, intelligently predicting missing pixel details by analyzing image texture, edges, and contextual information to achieve near-lossless upscaling. With the continuous development of artificial intelligence and machine learning technologies, advanced lossless upscaling algorithms can significantly improve the quality of enlarged images. In electronic signatures, improving the image quality of the generated seal is a prerequisite for enhancing the clarity of seal images in electronic documents.

[0049] Some embodiments of this application determine whether the actual pixel size of the first electronic seal image is smaller than the target pixel information. If it is smaller, a lossless magnification algorithm is used to magnify the first electronic seal image to the target pixel. If it is larger, no processing is performed on the first electronic seal image.

[0050] Optionally, the image of the first electronic seal is magnified to obtain a processed image, including: A lossless magnification algorithm is used to magnify the image of the first electronic seal, resulting in a processed image.

[0051] In some embodiments of this application, if the pixel count of the first electronic seal image is low, the first electronic seal image is enlarged to obtain an electronic seal image with a target pixel count.

[0052] Optionally, based on the seal position and size information in the layout document, the third electronic seal image in the layout document is converted and placed at the position corresponding to the seal position and size information to obtain the converted target electronic seal image, including: Based on the seal position and size information in the layout document, convert it into the layout document's position and size information, and determine the image drawing area based on the layout document's position and size information; Based on the seal position and size information of the layout document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image. In some embodiments of this application, the electronic seal image is first enlarged, and then the enlarged electronic seal image is compressed into a pre-set image drawing area according to the transformation matrix. In this way, the target electronic seal image is obtained. During the life cycle of the seal image, if other limitations such as storage are not considered, the image can be generated or optimized and enlarged to a high resolution at any stage, and a clear effect can be achieved through the layout insertion method.

[0053] Optionally, the image drawing area is determined based on the seal position and size information of the layout document, including: Determine the image rectangle based on the seal position and size information in the layout document.

[0054] Some embodiments of this application generate image rectangles in the layout document based on the seal position information of the layout document and the preset physical size of the electronic seal, for storing electronic seal images.

[0055] For example, taking a PDF document as an example, the image dictionary defines the width, height and other related attributes of the image calculated by the number of samples. The image content stream depends on the information contained in the image dictionary. The two are combined to form an independent image entity Img0.

[0056] The signature appearance is a composite XObject that contains the content stream of the image object Img0. The transformation from the composite space (image space) to user space is specified by the composite matrix contained in the composite XObject. The signature object contains the signature appearance and specifies the rectangle CRect for drawing the image.

[0057] The image can be placed anywhere on the output page according to its size. The method is to first convert the image of the sample width and height to a unit square in user space, and then map the unit square in user space to the rectangular box specified by the signature object. That is, use the cm operator to modify multiple transformation matrices in the composite XObject, operate the specified image through the Do operator, and adjust the image size to the user space display unit in the q and Q operators, and finally display it in the rectangular box set by the signature appearance.

[0058] Therefore, if image processing techniques, such as lossless magnification algorithms, are used to increase the number of samples in Img0, the image display quality will be better. At the same time, by controlling and adjusting the transformation matrix to maintain the mapping between the user space size and the physical size of the image, large samples of Img0 can be compressed and displayed in CRect. This allows Img0 to still be displayed with a smaller number of samples than the original under a certain degree of magnification preview, thereby improving the image display quality and reducing jagged edges and blurring.

[0059] like Figure 3 As shown in the figure, this application provides a method for processing electronic seals, including: The terminal device acquires the electronic seal image (i.e., the first electronic seal image), sets the physical size according to the specifications of the physical seal, and sets the pixel size to be enlarged based on the set target threshold (e.g., the user's expected magnification for document preview) and the support boundary of the lossless magnification algorithm. 1. Determine if the actual pixel size of the electronic seal image is smaller than the pixel size to be enlarged (target pixel information). If it is smaller, use a lossless enlargement algorithm to enlarge the image to the specified pixel size; if it is larger, leave it unchanged to obtain the second electronic seal image. 2. Convert the second electronic seal image into an image object Img0 in the layout document, which is the third electronic seal image; 3. Based on the set physical dimensions and signature coordinates, convert them to the document layout unit and set the image to draw a rectangle CRect; 4. Use operators such as q, Q, cm, etc. to set the transformation matrix (this transformation matrix is ​​used to rotate, offset, and scale the electronic seal image), and specify it in the image drawing rectangle with the Do operator. The enlarged sample image, i.e., the third electronic seal image, is mapped to the image drawing rectangle area through the transformation matrix. The transformation matrix is ​​a 3×3 matrix containing 6 variable elements, which is determined according to the effect requirements of the third seal image in the image drawing rectangle area.

[0060] 5. Create a complete signature appearance and render it in the electronic document.

[0061] For example, in scenarios involving electronic signatures, signature service providers typically offer electronic seal generation and electronic document signing services. In this scenario: 1. First, the image is cut out from the scanned copy of the seal provided by the user to generate the corresponding electronic seal image.

[0062] According to regulations governing official seals, the default physical size of an official seal should be 42mm. Therefore, when creating a seal image by cutting out the image, generating a 159*159px seal image in a 96DPI environment generally achieves both proper storage and normal size application. However, in actual production, the following situation may occur: 1) The quality of scanned documents provided by users varies greatly; 2) Inconsistent drawing specifications by operators, such as generating multiple image formats including GIF and PNG; generating images with incorrect pixel sizes; or mistakenly setting the production environment to 300 DPI, resulting in images with different pixel sizes than those processed normally.

[0063] 2. Then, according to the relevant application specifications, an electronic seal is created and stored in the corresponding service carrier.

[0064] 3. In the application of electronic seals, manufacturers use electronic signature technology to insert the images in the electronic seals into electronic documents according to the specifications.

[0065] The process of creating the impression image only revealed various problems at this stage, such as missing or incorrect DPI information in some formats, leading to inconsistencies in size with the actual stamp and severe jagged edges in the preview. Conventional methods typically require re-capturing or cutting out the image, which is not only inefficient but may also require multiple adjustments.

[0066] The modules described in this solution are deployed on business platform S: 1) The module sets the physical size of the electronic seal to 42mm according to the regulations for seal management. It is assumed that in business, it is generally required that the document remain clear and free of jagged edges after being enlarged by 3 times. The selected lossless enlargement algorithm can support 6 times lossless quality. 2) For example, the signature module enlarges the seal image to 954*954px without loss of quality (6 times the normal 159px; images with abnormal pixels or DPI information are also processed as specified 954px), and inserts the image into the document as an image dictionary / Img0 with a width of 954 and a height of 954 and a content stream. 3) Based on the physical dimensions and signature position in step 1), set a rectangle for drawing the image in the signature appearance of the signature object, and convert it to the absolute size of the layout user space (42mm / 25.4*72=119.05pt). 4) The signature appearance of the signature object is determined by pointing to the image object using operators, and simultaneously using a composite matrix to adjust the image width and height to 119.05 user space units, and mapping it to the rectangular area specified by the signature object for display in user space, as follows: q 119.05 0 0 119.05 0 0 cm / Img0 Do Q 5) Due to the device independence of the user space, the image size of 119.05 units in the layout user space, after absolute size conversion (119.05 / 72*25.4=42mm), ensures that the size of the electronic seal printed from the electronic document remains consistent with the size of the physical seal.

[0067] 6) When the electronic document is displayed normally or zoomed in for preview, since the image itself has been enlarged to 954 pixels without loss, on a typical 96 DPI monitor, when zoomed in to 3 times, the image is still displayed at a much smaller pixel size than the image itself, so the image is realistic and remains clear.

[0068] See attached image for display effect. Figure 4 Effect comparison: In the same document, the left side shows the original image inserted at 160px, while the right side shows the image inserted after being enlarged 6 times without loss of quality, resulting in a 300% document enlargement. The enlarged image is stored in the document as an / Img0 object, which does not increase the burden on the electronic seal storage medium. Furthermore, except in cases of extremely poor scan quality, it generally avoids resetting the process of image cutout, seal generation, and electronic signature.

[0069] The method for illustrating electronic seal images in formatted documents according to this application can improve seal quality during the electronic signing stage, even when the generated electronic image quality is poor. This avoids resetting the seal image lifecycle and effectively improves overall application efficiency. During the signing process, the size of the signing object rectangle is set according to the physical dimensions of the seal, and the absolute size of the image in user space is controlled through a transformation matrix to correct size deviations. Based on the reading expectations in actual applications, lossless magnification technology is applied to reconstruct the seal image to a larger sample size. Even when the document is magnified for preview, the image is still displayed at a smaller size than the lossless magnification, thus maintaining the clarity of the electronic image and largely eliminating jagged edges and blurring caused by magnification. Furthermore, the storage burden after image magnification is at the electronic document level and does not affect the storage efficiency of the electronic seal service carrier. Therefore, efficiency can be improved at the application process level, balancing the authenticity, clarity, and storage requirements of the electronic seal image in terms of effect.

[0070] It should be noted that each of the implementable methods in this embodiment can be implemented individually or in any combination without conflict. This application does not limit this.

[0071] Another embodiment of this application provides an electronic seal processing apparatus for executing the electronic seal processing method provided in the above embodiments.

[0072] like Figure 5 The diagram shown is a structural schematic of an electronic seal processing device provided in an embodiment of this application. The electronic seal processing device includes an acquisition module 501, a comparison module 502, a conversion module 503, and a mapping module 504, wherein: The acquisition module 501 is used to acquire the image of the first electronic seal; The comparison module 502 is used to determine the second electronic seal image corresponding to the first electronic seal image based on the pixel information of the first electronic seal image and the target pixel information; The conversion module 503 is used to convert the second electronic seal image to obtain the third electronic seal image in the layout document; The mapping module 504 is used to convert the third electronic seal image in the layout document according to the seal position information and size information in the layout document, and place it in the position corresponding to the seal position information and size information to obtain the converted target electronic seal image.

[0073] Regarding the apparatus in this embodiment, the specific manner in which each module performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0074] Some embodiments of this application enlarge the electronic seal image and then scale the enlarged electronic seal image to the specified seal position. In this way, even when the document is enlarged for preview, the electronic seal is still displayed at a size smaller than the lossless enlarged size, thereby keeping the electronic seal image clear and eliminating jagged edges and blurring caused by enlargement to a large extent.

[0075] Another embodiment of this application further illustrates the electronic seal processing apparatus provided in the above embodiments.

[0076] Optionally, the comparison module is used for: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain the processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image. Some embodiments of this application determine whether the actual pixel size of the first electronic seal image is smaller than the target pixel information. If it is smaller, a lossless magnification algorithm is used to magnify the first electronic seal image to the target pixel. If it is larger, no processing is performed on the first electronic seal image.

[0077] Optionally, the comparison module is used for: A lossless magnification algorithm is used to magnify the image of the first electronic seal, resulting in a processed image.

[0078] In some embodiments of this application, if the pixel count of the first electronic seal image is low, the first electronic seal image is enlarged to obtain an electronic seal image with a target pixel count.

[0079] Optionally, the mapping module is used for: Based on the seal position and size information in the layout document, convert it into the layout document's position and size information, and determine the image drawing area based on the layout document's position and size information; Based on the seal position and size information of the layout document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image. In some embodiments of this application, the electronic seal image is first enlarged, and then the enlarged electronic seal image is compressed into a pre-set image drawing area according to the transformation matrix, thus obtaining the target electronic seal image. Optionally, the mapping module is used for: Determine the image rectangle based on the seal position and size information in the layout document.

[0080] Some embodiments of this application generate image rectangles in the layout document based on the seal position information of the layout document and the preset physical size of the electronic seal, for storing electronic seal images.

[0081] Optionally, the first electronic seal image is in image format.

[0082] Regarding the apparatus in this embodiment, the specific manner in which each module performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0083] It should be noted that each of the implementable methods in this embodiment can be implemented individually or in any combination without conflict. This application does not limit this.

[0084] This application also provides a computer-readable storage medium storing a computer program thereon. When the program is executed by a processor, it can implement the operation of any of the methods corresponding to the embodiments of the electronic seal processing method provided above.

[0085] This application also provides a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operation of any of the methods corresponding to the embodiments of the electronic seal processing method provided above.

[0086] like Figure 6As shown, some embodiments of this application provide an electronic device 600, which includes a memory 610, a processor 620, and a computer program stored in the memory 610 and executable on the processor 620. When the processor 620 reads the program from the memory 610 via a bus 630 and executes the program, it can implement any of the methods included in the above-described electronic seal processing method.

[0087] Processor 620 can process digital signals and can include various computing architectures. For example, it can be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 620 can be a microprocessor.

[0088] The memory 610 can be used to store instructions executed by the processor 620 or data related to the execution of instructions. These instructions and / or data may include code for implementing some or all of the functions of one or more modules described in the embodiments of this application. The processor 620 of this disclosure embodiment can be used to execute the instructions in the memory 610 to implement the methods shown above. The memory 610 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well known to those skilled in the art.

[0089] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0090] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0091] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for processing electronic seals, characterized in that, The method includes: Obtain the image of the first electronic seal; Based on the pixel information and target pixel information of the first electronic seal image, a second electronic seal image corresponding to the first electronic seal image is determined. The second electronic seal image is converted to obtain the third electronic seal image in the layout document; Based on the seal position and size information in the layout document, the third electronic seal image in the layout document is converted and placed in the position corresponding to the seal position and size information to obtain the converted target electronic seal image.

2. The method for processing electronic seals according to claim 1, characterized in that, The step of determining the second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image includes: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain a processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image.

3. The method for processing electronic seals according to claim 2, characterized in that, The process of magnifying the first electronic seal image to obtain the processed image includes: A lossless magnification algorithm is used to magnify the image of the first electronic seal to obtain the processed image.

4. The method for processing electronic seals according to claim 1, characterized in that, The step of converting the third electronic seal image in the layout document according to the seal position information and size information in the layout document, and placing it in a position corresponding to the seal position information and size information, to obtain the converted target electronic seal image, includes: Based on the seal position and size information in the layout document, the position and size information of the layout document are converted into the layout document's position and size information, and the image drawing area is determined based on the layout document's position and size information; Based on the seal position and size information of the document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image.

5. The method for processing electronic seals according to claim 4, characterized in that, The step of determining the image drawing area based on the seal position and size information of the layout document includes: The image rectangle is determined based on the seal position and size information of the document.

6. The method for processing electronic seals according to claim 1, characterized in that, The first electronic seal image is in image format.

7. A processing device for an electronic seal, characterized in that, The device includes: The acquisition module is used to acquire the image of the first electronic seal; The comparison module is used to determine a second electronic seal image corresponding to the first electronic seal image based on the pixel information and target pixel information of the first electronic seal image. The conversion module is used to convert the second electronic seal image to obtain the third electronic seal image in the layout document; The mapping module is used to convert the third electronic seal image in the layout document according to the seal position information and size information in the layout document, and place it in the position corresponding to the seal position information and size information to obtain the converted target electronic seal image.

8. The electronic seal processing apparatus according to claim 7, characterized in that, The comparison module is used for: If the pixel information of the first electronic seal image is smaller than the target pixel information, the first electronic seal image is magnified to obtain a processed image, and the processed image is determined as the second electronic seal image. If the pixel information of the first electronic seal image is greater than or equal to the target pixel information, then the first electronic seal image is determined as the second electronic seal image.

9. The electronic seal processing apparatus according to claim 7, characterized in that, The comparison module is used for: A lossless magnification algorithm is used to magnify the image of the first electronic seal to obtain the processed image.

10. The electronic seal processing apparatus according to claim 7, characterized in that, The mapping module is used for: Based on the seal position and size information in the layout document, the position and size information of the layout document are converted into the layout document's position and size information, and the image drawing area is determined based on the layout document's position and size information; Based on the seal position and size information of the document, a transformation matrix is ​​used to transform the third electronic seal image. The transformed electronic seal image is then placed in the image drawing area to obtain the transformed target electronic seal image. The transformation matrix is ​​determined based on pixel and size information and is used to scale, rotate, and offset the electronic seal image.

11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it can implement the electronic seal processing method according to any one of claims 1-6.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, characterized in that, when the program is executed by a processor, it can implement the electronic seal processing method according to any one of claims 1-6.