An annotation object drawing method, system and storage medium of an OFD document

By setting the ZOrder property and weight group for OFD document annotation objects, the annotation objects are drawn according to a preset order, which solves the problem of annotation objects obscuring the main text and achieves reasonable display of annotation objects and improves the readability.

CN115796133BActive Publication Date: 2026-07-21AEROSPACE FOXIT SOFTWARE (BEIJING) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AEROSPACE FOXIT SOFTWARE (BEIJING) CO LTD
Filing Date
2022-11-24
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In OFD documents, the hierarchy of annotation objects can cause them to obscure the main text, especially large or opaque annotation objects that cover small images or text, affecting readability.

Method used

By setting the ZOrder attribute value and weight group for each annotation object, the annotation objects with background attributes are drawn first, followed by the text objects, and then the annotation objects with foreground attributes are drawn according to the preset drawing order. The final OFD page is generated by combining the maximum drawing area of ​​the image and the node level.

Benefits of technology

It effectively solves the problem of annotation objects obscuring the main text, ensuring that annotation objects are displayed reasonably, avoiding large blocks of annotations from covering small images or main text, and improving the reading experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115796133B_ABST
    Figure CN115796133B_ABST
Patent Text Reader

Abstract

The application discloses an OFD document annotation object drawing method and system and a storage medium, and comprises the following steps: constructing a ZOrder attribute value of each annotation object in each OFD page of a target OFD document; acquiring a weight group of each annotation object in each OFD page of the target OFD document; based on a preset annotation object drawing sequence, the ZOrder attribute value and the weight group of each annotation object in any OFD page of the target OFD document, drawing all annotation objects of the any OFD page to generate a drawn OFD page corresponding to the any OFD page, until a drawn OFD page corresponding to each OFD page in the target OFD document is generated. The application can better solve the hierarchical problem of the annotation object display in the OFD document by setting the drawing sequence of the object in the OFD document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of IT digital technology, and in particular to a method, system, and storage medium for drawing annotation objects in OFD documents. Background Technology

[0002] The OFD specification standardizes the rendering order of text-related page layers, encompassing six layers including the foreground and main text layers. When elements in different layers overlap, the upper-layer object covers the overlapping portion of the lower-layer object. However, annotation objects do not belong to any of the aforementioned text-related layers, and the OFD specification does not specify the overlapping relationship between annotation pages and main text pages. Furthermore, there are no rules regarding the overlapping of annotation objects within the same annotation page. Therefore, most OFD readers render the main text first, then the annotations, and when annotation objects overlap, they are generally rendered according to their order of appearance in the OFD file.

[0003] However, this approach has its shortcomings in certain situations. For example, users add watermarks to OFD documents primarily to indicate ownership, not to obscure the main text. When the watermark is opaque or has low transparency, large or dense annotations can obscure the text, hindering readability. This is especially true when the annotation uses image objects; a large, opaque image can cover a large area underneath, which is usually not the user's intention. Furthermore, when there are multiple annotation objects containing images, if a large image covers a smaller image, the opaque large image can make the smaller image invisible.

[0004] Therefore, there is an urgent need to provide a technical solution to address the aforementioned technical problems. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a method, system, and storage medium for drawing annotation objects in OFD documents.

[0006] The technical solution of the OFD document annotation object drawing method of the present invention is as follows:

[0007] Construct the ZOrder property value for each annotation object in each OFD page of the target OFD document;

[0008] Obtain the weight group of each annotation object in each OFD page of the target OFD document; wherein, the weight group of any annotation object includes: the node level of the annotation object, the maximum drawn area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level;

[0009] Based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, all annotation objects of any OFD page are drawn to generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated.

[0010] The beneficial effects of the OFD document annotation object drawing method of the present invention are as follows:

[0011] The method of the present invention can better handle the hierarchical problem of displaying annotation objects in OFD documents by setting the drawing order of objects in OFD documents.

[0012] Based on the above solution, the OFD document annotation object drawing method of the present invention can be further improved as follows.

[0013] Furthermore, the ZOrder attribute value of any annotation object is either a background attribute or a foreground attribute; the preset drawing order of the annotation objects is as follows: each annotation object with a ZOrder attribute value of background, the text object, and each annotation object with a ZOrder attribute value of foreground are drawn sequentially on any OFD page.

[0014] Furthermore, the process of drawing each annotation object with a ZOrder attribute value of the background attribute includes:

[0015] Each annotation object whose ZOrder property value is the background property is identified as the first annotation object;

[0016] Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence;

[0017] When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained.

[0018] The first sequence is updated based on the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn sequentially.

[0019] Furthermore, the process of drawing each annotation object with a ZOrder attribute value that is a foreground attribute includes:

[0020] Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object;

[0021] Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence;

[0022] When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second sub-sequences. Based on the ascending order of the node level, each second sub-sequence is used to replace the corresponding second annotation object at the previous node level until the target sub-sequence corresponding to the composite annotation object is obtained.

[0023] The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

[0024] Furthermore, it also includes: when the maximum drawing area and node level of the images in any two annotation objects are the same, the two annotation objects are arranged according to the order in which they appear at that node level.

[0025] The technical solution of the OFD document annotation object drawing system of the present invention is as follows:

[0026] Includes: a build module, a processing module, and a runtime module;

[0027] The building module is used to: build the ZOrder attribute value of each annotation object in each OFD page of the target OFD document;

[0028] The processing module is used to: obtain the weight group of each annotation object in each OFD page of the target OFD document; wherein, the weight group of any annotation object includes: the node level of the annotation object, the maximum drawing area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level;

[0029] The running module is used to: draw all the annotation objects of any OFD page based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, and generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated.

[0030] The beneficial effects of the OFD document annotation object drawing system of the present invention are as follows:

[0031] The system of the present invention can better handle the hierarchical problem of displaying annotation objects in OFD documents by setting the drawing order of objects in OFD documents.

[0032] Based on the above solution, the OFD document annotation object drawing system of the present invention can be further improved as follows.

[0033] Furthermore, the ZOrder attribute value of any annotation object is either a background attribute or a foreground attribute; the preset drawing order of the annotation objects is as follows: each annotation object with a ZOrder attribute value of background, the text object, and each annotation object with a ZOrder attribute value of foreground are drawn sequentially on any OFD page.

[0034] Furthermore, the process of drawing each annotation object with a ZOrder attribute value of the background attribute includes:

[0035] Each annotation object whose ZOrder property value is the background property is identified as the first annotation object;

[0036] Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence;

[0037] When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained.

[0038] The first sequence is updated based on the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn sequentially.

[0039] Furthermore, the process of drawing each annotation object with a ZOrder attribute value that is a foreground attribute includes:

[0040] Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object;

[0041] Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence;

[0042] When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second sub-sequences. Based on the ascending order of the node level, each second sub-sequence is used to replace the corresponding second annotation object at the previous node level until the target sub-sequence corresponding to the composite annotation object is obtained.

[0043] The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

[0044] The technical solution of a storage medium according to the present invention is as follows:

[0045] The storage medium stores instructions that, when read by a computer, cause the computer to execute steps of a method for drawing annotation objects in an OFD document as described in this invention. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating a method for drawing annotation objects in an OFD document according to an embodiment of the present invention.

[0047] Figure 2 This is a schematic diagram of the XML file of the OFD page in a method for drawing annotation objects of an OFD document according to an embodiment of the present invention;

[0048] Figure 3 This is a tree diagram of the XML file corresponding to the OFD page in a method for drawing annotation objects of an OFD document according to an embodiment of the present invention.

[0049] Figure 4 This is an original drawing effect diagram of the OFD page in an OFD document annotation object drawing method according to an embodiment of the present invention;

[0050] Figure 5This is a tree diagram containing the weight group corresponding to each annotation object in an OFD document drawing method according to an embodiment of the present invention;

[0051] Figure 6 This is a diagram illustrating the target rendering effect of an OFD page in an OFD document annotation object rendering method according to an embodiment of the present invention.

[0052] Figure 7 This is a schematic diagram of the structure of an OFD document annotation object drawing system according to an embodiment of the present invention. Detailed Implementation

[0053] like Figure 1 As shown, an OFD document annotation object drawing method according to an embodiment of the present invention includes the following steps:

[0054] S1. Construct the ZOrder property value for each annotation object in each OFD page of the target OFD document.

[0055] Specifically, ① the target OFD document is an OFD document containing at least one OFD page. ② an OFD page is an OFD page containing at least one annotation object. ③ Annotation object types include: Link, Path, Highlight, Stamp, and Watermark. An annotation object can contain one or more primitive objects (text, images, graphics, etc., are collectively referred to as primitive objects). The display of an annotation object is achieved by drawing its contained primitive objects. Annotation objects are described using XML on the annotation page, and the annotation objects and their contained primitive objects in the XML form a tree structure. ④ The ZOrder attribute value is a custom attribute value, specifically a value in the Parameter attribute of the annotation object. This attribute value represents the order of the annotation objects in the Z-axis direction. The types of this attribute value include: Background and Foreground.

[0056] It should be noted that ① the specific definition of the ZOrder property value is:

[0057] <xs:element name="ZOrder" type="enumType" / >

[0058] <xs:simpletype name="enumType">

[0059] <xs:restriction base="xs:string">

[0060] <xs:enumeration value="Background" / >

[0061] <xs:enumeration value="Foreground" / >

[0062] < / xs:restriction>

[0063] < / xs:simpletype>

[0064] In this example, the background attribute indicates that the annotation is drawn below the main text, while the foreground attribute indicates that the annotation is drawn above the main text. Annotation objects without a ZOrder attribute value are treated as foreground objects by default; the ZOrder attribute can be specified by the user through the interface. ② All annotation objects in this embodiment are opaque. ③ The ZOrder attribute value of each annotation object can be set according to user needs. An annotation object consists of (multiple) primitive objects directly or indirectly contained below it, forming a tree structure. The top-level node is the annotation object, and each node below it is a primitive object. For simplicity, and without causing confusion, each node in the tree will be referred to as an annotation object thereafter.

[0065] S2. Obtain the weight group of each annotation object in each OFD page of the target OFD document.

[0066] Specifically, ① the weight group of any annotation object includes: the node level of the annotation object, the maximum drawable area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level. ② The node level is: OFD uses XML to describe objects on the page. XML is a tree structure, and the node level is the hierarchy of the annotation object in the tree. ③ The maximum drawable area of ​​the image is: the drawable area value of the image primitive in the annotation object. ④ The order in which the node levels appear is: the annotation objects and their contained primitive objects on the page are described by XML, forming a tree structure. The annotations and their contained primitive objects constitute a tree. If the primitive is a composite object, it can also have its own child primitives. In the tree structure, a parent node may have multiple direct child nodes, and the order in which these child nodes appear in the XML is the order in which they appear at the node level.

[0067] It should be noted that: ① Regarding the maximum drawing area of ​​an image, for example, if an image is drawn on an area of ​​30mm × 30mm, then the drawing area of ​​the image primitive object is 900. If the annotation contains only this one image primitive, then the maximum drawing area of ​​the annotation object's image is the drawing area of ​​that image primitive. If the annotation object contains multiple image primitives (directly contained primitives, or sub-primitives contained in a composite primitive object), then the drawing area of ​​the annotation's image is the maximum value among these image drawing areas. For non-image type primitives, their drawing area is 0. If the primitives contained in an annotation are all non-image primitives, then the drawing area of ​​the annotation object is 0.

[0068] S3. Based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, draw all annotation objects of any OFD page to generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated.

[0069] Specifically, ① the preset drawing order of annotation objects is as follows: annotation objects with a ZOrder attribute value of background, text objects, and annotation objects with a ZOrder attribute value of foreground are drawn sequentially on any OFD page. ② The resulting OFD page is the OFD page obtained by drawing according to the preset annotation object drawing order.

[0070] Preferably, the process of drawing each annotation object with a ZOrder attribute value of the background attribute includes:

[0071] Each annotation object whose ZOrder property value is the background property is designated as the first annotation object.

[0072] The first annotation object is an annotation object whose ZOrder property value is the background property.

[0073] Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence.

[0074] Among them, ① node levels include: first node level, second node level, third node level, etc. The specific number of node level layers is determined according to the actual situation and is not limited here. ② The first sequence is: based on the size of the maximum drawing area of ​​the image of the first annotation object at the first node level, the sequence is obtained by sorting the first annotation objects at the first node level in descending order.

[0075] Specifically, for example, there are three first annotation objects at the first node level, and the weight group of the first first annotation object is [1, 500, 1], the area of ​​the second first annotation object is [1, 600, 2], and the area of ​​the third first annotation object is [1, 100, 3]. The order of the first sequence is as follows: [1, 600, 2] → [1, 500, 1] → [1, 100, 3].

[0076] When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained.

[0077] Specifically, ① a composite annotation object is defined as a first annotation object at the first node level that contains at least one first annotation object at the child node level. ② a first subsequence is defined as a sequence of first annotation objects at any child node level, whose drawing order is the same as that of the first annotation objects at the first node level. ③ a target subsequence is defined as a sequence that contains at least the first annotation object at the lowest level of the composite annotation object.

[0078] It should be noted that in the above example, assuming the first annotation object includes two second-node-level first annotation objects: [2, 300, 1] and [2, 500, 2], then the first subsequence is [2, 500, 2] → [2, 300, 1]. If [2, 500, 2] also includes two third-node-level first annotation objects: [3, 500, 1] and [3, 400, 2], then the target subsequence is: [3, 500, 1] → [[3, 400, 2] → [[2, 300, 1].

[0079] The first sequence is updated based on the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn sequentially.

[0080] The first target sequence is: a sequence including the target subsequence of each composite annotation object and the sequence of other first annotation objects. For example, in the example above, the first target sequence is: [1, 600, 2] → [3, 500, 1] → [[3, 400, 2] → [[2, 300, 1] → [1, 100, 3].

[0081] Preferably, the process of drawing each annotation object whose ZOrder attribute value is a foreground attribute includes:

[0082] Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object.

[0083] The second annotation object is an annotation object whose ZOrder attribute value is the foreground attribute.

[0084] Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence.

[0085] Among them, ① the second sequence is: based on the size of the maximum drawing area of ​​the image of the second annotation object at the first node level, the second annotation object at the first node level is sorted in descending order.

[0086] When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second subsequences. Based on the ascending order of the node level, each second subsequence is used to replace the corresponding second annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained.

[0087] Wherein, ① the second subsequence is: a sequence of second annotation objects at any child node level. ② the target subsequence is: a sequence that contains at least the second annotation objects at the lowest level of the composite annotation object.

[0088] The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

[0089] The second target sequence is a sequence that includes the target subsequence of each composite annotation object and other second annotation objects.

[0090] It should be noted that the process of drawing each annotation object with a ZOrder property value of the foreground property is basically the same as the process of drawing each annotation object with a ZOrder property value of the background property, and will not be elaborated here.

[0091] Preferably, it further includes: when the maximum drawing area and node level of the images in any two annotation objects are the same, arranging them according to the order in which the two annotation objects appear at that node level.

[0092] Specifically, when the maximum drawing area and node level of the images in any two annotation objects are the same, and the ZOrder attribute values ​​of these two annotation objects are both foreground or background attributes, they are arranged according to the order in which the two annotation objects appear at that node level.

[0093] For example, when any two annotation objects are the first annotation objects corresponding to the background attribute, the weight groups of these two annotation objects are: [1, 500, 1] and [1, 500, 2]. At this time, the maximum drawing area and node level of these two first annotation objects are the same, so they are arranged according to the order in which they appear at the node level, i.e., [1, 500, 1] → [1, 500, 2].

[0094] The technical solution of this embodiment can better handle the hierarchical problem of displaying annotation objects in OFD documents by setting the drawing order of objects in OFD documents.

[0095] To better illustrate the technical solutions in the above embodiments, an example of an OFD page is used for explanation. Specifically:

[0096] Figure 2 The document shows an XML file for a specific OFD page, and demonstrates how to construct an application based on that XML file. Figure 3 The tree structure shown. According to... Figure 3 A tree-like structure, and an OFD interface drawn using existing technology, such as... Figure 4 As shown, the drawing order is: text object, 51, 52 (9466, 9459), 53 (9515, 9520), 54, 55. It can be seen that because the last annotation object (ID 55) contains a large image primitive object, the text below it and most of the other annotations are obscured by it.

[0097] At this point, following the steps of the above embodiments, the ZOrder attribute value is set for the Parameter attribute of each annotation object (51, 52, 53, 54, 55, 9466, 9459, 9515, 9520). Assume that the ZOrder attribute values ​​of 52 and 55 are set to the Background attribute. Other objects are not set, and the default is the Foreground attribute. The weight group for each annotation object is obtained by following the steps of the above embodiments, and the specific results are as follows... Figure 5 As shown. Since 52 and 55 are background attributes, the final drawing order is: 55→9459→9466→Text Object→51→9515→9520→54. Drawing in the above order yields the following result. Figure 6 The image shown is a screenshot of the OFD page.

[0098] like Figure 7 As shown, an OFD document annotation object drawing system 200 according to an embodiment of the present invention includes: a construction module 210, a processing module 220 and a running module 230;

[0099] The construction module 210 is used to: construct the ZOrder attribute value of each annotation object in each OFD page of the target OFD document;

[0100] The processing module 220 is used to: obtain the weight group of each annotation object in each OFD page of the target OFD document; wherein, the weight group of any annotation object includes: the node level of the annotation object, the maximum drawing area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level;

[0101] The running module 230 is used to: draw all the annotation objects of any OFD page based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, and generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated.

[0102] Preferably, the ZOrder attribute value of any annotation object is either a background attribute or a foreground attribute; the preset drawing order of the annotation objects is as follows: each annotation object with a ZOrder attribute value of background, the text object, and each annotation object with a ZOrder attribute value of foreground are drawn sequentially on any OFD page.

[0103] Preferably, the process of drawing each annotation object with a ZOrder attribute value of the background attribute includes:

[0104] Each annotation object whose ZOrder property value is the background property is identified as the first annotation object;

[0105] Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence;

[0106] When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained.

[0107] The first sequence is updated based on the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn sequentially.

[0108] Preferably, the process of drawing each annotation object whose ZOrder attribute value is a foreground attribute includes:

[0109] Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object;

[0110] Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence;

[0111] When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second sub-sequences. Based on the ascending order of the node level, each second sub-sequence is used to replace the corresponding second annotation object at the previous node level until the target sub-sequence corresponding to the composite annotation object is obtained.

[0112] The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

[0113] The technical solution of this embodiment can better handle the hierarchical problem of displaying annotation objects in OFD documents by setting the drawing order of objects in OFD documents.

[0114] The parameters and steps for implementing the corresponding functions of each module in the OFD document annotation object drawing system 200 of this embodiment can be referred to the parameters and steps in the embodiment of the OFD document annotation object drawing method above, and will not be repeated here.

[0115] An embodiment of the present invention provides a storage medium, comprising: the storage medium storing instructions, which, when a computer reads the instructions, cause the computer to execute steps such as a method for drawing annotation objects of an OFD document. For details, please refer to the parameters and steps in the embodiment of the method for drawing annotation objects of an OFD document described above, which will not be repeated here.

[0116] Computer storage media include, for example, USB flash drives and external hard drives.

[0117] Those skilled in the art will know that the present invention can be implemented as a method, system, and storage medium.

[0118] Therefore, the present invention can be implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present invention can also be implemented as a computer program product in one or more computer-readable media, the computer-readable media containing computer-readable program code. Any combination of one or more computer-readable media can be used. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Although embodiments of the invention have been shown and described above, it is to be understood that these embodiments are exemplary and should not be construed as limiting the invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the invention.

Claims

1. A method for drawing annotation objects in an OFD document, characterized in that, include: Construct the ZOrder property value for each annotation object in each OFD page of the target OFD document; Obtain the weight group of each annotation object in each OFD page of the target OFD document; wherein, the weight group of any annotation object includes: the node level of the annotation object, the maximum drawn area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level; Based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, all annotation objects of any OFD page are drawn to generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated. The ZOrder property value of any annotation object is either background or foreground; the preset drawing order of the annotation objects is as follows: each annotation object with a ZOrder property value of background, the text object, and each annotation object with a ZOrder property value of foreground are drawn sequentially in any OFD page; The process of drawing each annotation object whose ZOrder property value is the background property includes: Each annotation object whose ZOrder property value is the background property is identified as the first annotation object; Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence; When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained. The first sequence is updated according to the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn in turn. The process of drawing annotation objects where each ZOrder attribute value is a foreground attribute includes: Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object; Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence; When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second sub-sequences. Based on the ascending order of the node level, each second sub-sequence is used to replace the corresponding second annotation object at the previous node level until the target sub-sequence corresponding to the composite annotation object is obtained. The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

2. The method for drawing annotation objects in OFD documents according to claim 1, characterized in that, Also includes: When the maximum drawing area and node level of the images in any two annotation objects are the same, they are arranged according to the order in which the two annotation objects appear at that node level.

3. A system for drawing annotation objects in OFD documents, characterized in that, include: Modules for building, processing, and running; The building module is used to: build the ZOrder attribute value of each annotation object in each OFD page of the target OFD document; The processing module is used to: obtain the weight group of each annotation object in each OFD page of the target OFD document; wherein, the weight group of any annotation object includes: the node level of the annotation object, the maximum drawing area of ​​the image in the annotation object, and the order in which the annotation object appears at the corresponding node level; The running module is used to: draw all the annotation objects of any OFD page based on the preset drawing order of annotation objects, the ZOrder attribute value and weight group of each annotation object in any OFD page of the target OFD document, and generate the drawn OFD page corresponding to any OFD page, until the drawn OFD page corresponding to each OFD page in the target OFD document is generated. The ZOrder property value of any annotation object is either background or foreground; the preset drawing order of the annotation objects is as follows: each annotation object with a ZOrder property value of background, the text object, and each annotation object with a ZOrder property value of foreground are drawn sequentially in any OFD page; The process of drawing each annotation object whose ZOrder property value is the background property includes: Each annotation object whose ZOrder property value is the background property is identified as the first annotation object; Obtain the first annotation object at the first node level for each node, and sort the first annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the first sequence; When any first annotation object at the first node level is a composite annotation object, each first annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple first subsequences. Based on the ascending order of the node level, each first subsequence is used to replace the corresponding first annotation object at the previous node level until the target subsequence corresponding to the composite annotation object is obtained. The first sequence is updated according to the target subsequence corresponding to each composite annotation object in the first sequence to obtain the first target sequence, and each first annotation object in the first target sequence is drawn in turn. The process of drawing annotation objects where each ZOrder attribute value is a foreground attribute includes: Each annotation object whose ZOrder property value is a foreground property is identified as a second annotation object; Obtain the second annotation object at the first node level for each node, and sort the second annotation objects at the first node level in descending order based on the size of the maximum drawing area of ​​the image to obtain the second sequence; When any second annotation object at the first node level is a composite annotation object, each second annotation object at each node level corresponding to the composite annotation object is arranged according to the size of the maximum drawing area of ​​the image to obtain multiple second sub-sequences. Based on the ascending order of the node level, each second sub-sequence is used to replace the corresponding second annotation object at the previous node level until the target sub-sequence corresponding to the composite annotation object is obtained. The second sequence is updated based on the target subsequence corresponding to each composite annotation object in the second sequence to obtain the second target sequence, and each second annotation object in the second target sequence is drawn sequentially.

4. A storage medium, characterized in that, The storage medium stores instructions that, when read by a computer, cause the computer to execute the OFD document annotation object drawing method as described in claim 1 or 2.