A method and device for estimating display level in OFD to HTML conversion

By accurately determining the display hierarchical information in the OFD document to HTML page conversion, the size and coordinate information of the target element are used to accurately determine the display hierarchical information, which solves the problems of low efficiency and poor accuracy in the existing technology, and realizes efficient and accurate HTML page generation.

CN119337830BActive Publication Date: 2025-04-29BEIJING CSSCA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411887831.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-29
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The prior art has low efficiency and poor accuracy in the conversion of OFD documents to HTML pages, resulting in the generated HTML page display hierarchical confusion or errors.

Method used

By accurately determining the display hierarchy information of the target element in the target HTML page based on the size information and coordinate information of the target element in the target OFD document, and efficiently generating the target HTML page based on this information.

Benefits of technology

It realizes that the display hierarchical information is efficiently and accurately determined and generated in the conversion of OFD documents to HTML pages, thereby improving the generation efficiency and accuracy of HTML pages and avoiding the problems of confusion or errors in the display hierarchy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337830B_ABST
    Figure CN119337830B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for estimating the display level in OFD to HTML, which relates to the technical field of OFD document processing, wherein the method comprises: when it is determined that the ID information of the target element in the target OFD document is missing, the target display level information corresponding to the target element in the target HTML page is determined according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information; and the target HTML page is generated according to the target display level information. In this way, it is conducive to accurately determining the target display level information of the target element in the corresponding target HTML page according to the size information and coordinate information of the target element in the target OFD document, so as to efficiently and accurately generate the corresponding target HTML page according to the above target display level information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of OFD document processing, and more particularly to a method and device for estimating display levels in OFD to HTML conversion. Background Art

[0002] Open Fixed-layout Document (OFD) is a standard format for electronic files. OFD document format is mainly applicable to various fixed-layout electronic documents, such as government documents, contracts, invoices, etc.

[0003] HyperText Markup Language (HTML) is a standard markup language used to create or display web pages. The HTML page format mainly determines the display level and display order of page elements based on the (Document Object Model, DOM) hierarchical structure information.

[0004] At present, in the related technology, since the corresponding Document Object Model (DOM) hierarchical structure information is determined only according to the OFD document, the generation of the corresponding HTML page based on the OFD document has the problems of low efficiency and poor accuracy.

[0005] Therefore, a new technical solution is urgently needed to solve the above technical problems. Summary of the invention

[0006] According to an embodiment of the present application, a method and device for estimating the display level in OFD to HTML are provided, which is conducive to accurately determining the target display level information of the target element in the corresponding target HTML page according to the size information and coordinate information of the target element in the target OFD document, thereby efficiently and accurately generating the corresponding target HTML page according to the above target display level information.

[0007] In a first aspect of the present application, a method for estimating a display level in OFD to HTML conversion is provided, comprising:

[0008] When it is determined that the ID information of the target element in the target OFD document is missing,

[0009] Determine the target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information;

[0010] Generate the target HTML page according to the target display level information.

[0011] In some feasible implementations, the above method further includes:

[0012] When it is determined that the ID information of the target element in the target OFD document is not missing, the target display level information is determined according to the ID information.

[0013] In some feasible implementations, determining the target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element includes:

[0014] Determine the relative distance between the first target element and the second target element according to the coordinate information of the first target element and the second target element;

[0015] Determine the areas of the first target element and the second target element according to the size information of the first target element and the second target element;

[0016] When the relative distance is less than or equal to the preset distance and the area of ​​the first target element is smaller than the area of ​​the second target element,

[0017] The first target element is controlled to be displayed in a first target display level, and the second target element is controlled to be displayed in a second target display level, wherein the first target display level is stacked on the second target display level.

[0018] In some feasible implementations, the above-mentioned related information also includes: drawing order information;

[0019] The above method further includes:

[0020] The target display level information is determined according to the size information, coordinate information and drawing order information.

[0021] In some feasible implementations, determining the target display level information according to the size information, the coordinate information, and the drawing order information includes:

[0022] Determine the target display level information according to the preset target display level determination function;

[0023] Determine the stacking order information of multiple target display levels according to the target display level information and the first target `z-index` value.

[0024] In some feasible implementations, the preset target display level determination function includes the following function:

[0025]

[0026] in, is the first display level, is the area of ​​the first target element, is the area of ​​the second target element, is the relative distance between the first target element and the second target element, is the difference between the drawing order of the first target element and the second target element, is the first weight coefficient, β is the second weight coefficient, and γ is the third weight coefficient.

[0027] In some feasible implementations, the above method further includes:

[0028] When it is determined that the sum of the target display levels corresponding to the target area in the target OFD document is greater than or equal to the preset display level sum value,

[0029] and / or,

[0030] When the sum of target elements contained in all target display levels corresponding to the target area is greater than or equal to the preset target element sum value,

[0031] Determine the second target `z-index` value corresponding to the target display level according to the weight corresponding to each target display level, the index corresponding to the target display level, and the drawing order;

[0032] Determine the stacking order information of multiple target display levels corresponding to the target area according to the target display level information and the second target `z-index` value;

[0033] Among them, the second target `z-index` value corresponding to the target display level is determined according to the following formula:

[0034]

[0035] in, is the second target `z-index` value, is the weight, is the index, The drawing order.

[0036] In some feasible implementations, the method as described in any of the above items further includes:

[0037] Determine the target transparency of the target element in the target HTML page according to the actual transparency and the maximum transparency of the target element in the target OFD document;

[0038] The target transparency is the ratio of the actual transparency to the maximum transparency.

[0039] In some feasible implementations, the above method further includes:

[0040] When the target element is a vector graphic, generating a preset type element corresponding to the target element according to the target element;

[0041] Generate a target HTML page according to preset type elements, wherein the preset type elements include: SVG type elements and / or Canvas type elements.

[0042] In a second aspect of the present application, a device for estimating a display level in OFD to HTML conversion is provided, comprising:

[0043] A determination unit, configured to determine, when it is determined that the ID information of the target element in the target OFD document is missing, target display level information corresponding to the target element in the target HTML page according to relevant information of the target element, wherein the relevant information includes: size information and coordinate information;

[0044] The generating unit is used to generate a target HTML page according to the target display level information.

[0045] The embodiment of the present application provides a method and device for estimating the display level in OFD to HTML, wherein the method includes: when it is determined that the ID information of the target element in the target OFD document is missing, the target display level information corresponding to the target element in the target HTML page is determined according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information; and the target HTML page is generated according to the target display level information. The present application is conducive to accurately determining the target display level information of the target element in the corresponding target HTML page according to the size information and coordinate information of the target element in the target OFD document, thereby efficiently and accurately generating the target HTML page according to the above target display level information.

[0046] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0048] Figure 1 A schematic diagram of a process for estimating a display level in OFD to HTML provided in an embodiment of the present application;

[0049] Figure 2 A structural schematic diagram of a device for estimating a display level in OFD to HTML provided in an embodiment of the present application;

[0050] Figure 3A structural diagram of a terminal device or server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0052] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0053] According to a first aspect of the embodiments of the present application, a method for estimating a display level in OFD to HTML conversion is provided. Figure 1 A schematic diagram of a method 100 for estimating a display level in OFD to HTML provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method 100 includes:

[0054] Step S110: When it is determined that the ID information of the target element in the target OFD document is missing, the target display level information corresponding to the target element in the target HTML page is determined according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information.

[0055] It should be noted that, in some feasible implementations, the target document tree generated by parsing the target OFD document can be traversed, and when it is determined that the ID attribute corresponding to the target element is empty or does not exist according to the target document tree, it is determined that the ID information of the target element in the target OFD document is missing, and the size information and coordinate information corresponding to the target element are determined according to the metadata corresponding to the target element in the target OFD document. The target element can include: text elements, image elements, table elements, and / or graphic elements, etc.

[0056] It should be noted that, when the target element is a graphic element, the size information may include: the length and width of the target element. When the target element is a text element, the size information may include: the length and width of the bounding box corresponding to the target element.

[0057] Exemplarily, the area of ​​the target element can be determined based on the size information. The relative distance between the target elements and / or the drawing order can be determined based on the coordinate information. The target display level information corresponding to the target element can be determined based on the area, the relative distance, and / or the drawing order. It should be noted that the relative distance and / or the drawing order can be used to determine the display order of the target elements and / or the display level of the target elements.

[0058] Step S120: Generate a target HTML page according to the target display level information.

[0059] Exemplarily, according to the above relative distance and / or the above drawing order, all target elements included in each display level can be generated in sequence, and / or corresponding stacking operations can be performed on the target elements included in multiple display levels in sequence, so as to generate a target HTML page accordingly.

[0060] Based on this, the present application provides a method for estimating the display level in OFD to HTML, including: when it is determined that the ID information of the target element in the target OFD document is missing, the target display level information corresponding to the target element in the target HTML page is determined according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information; and the target HTML page is generated according to the target display level information. The present application can accurately determine the target display level information of the target element in the corresponding target HTML page according to the size information and coordinate information of the target element in the target OFD document when the ID information corresponding to the target element is missing, thereby efficiently and accurately generating the corresponding target HTML page according to the above target display level information, avoiding the inability to determine the corresponding DOM structure according to the target OFD document, resulting in the generated target HTML page having problems such as mutual occlusion of target elements, confusion or error in the display level of the target elements, thereby improving the accuracy of the target HTML page in restoring the target OFD document in the format of the target HTML page.

[0061] In some feasible implementations, the method further includes: determining target display level information according to the ID information when it is determined that the ID information of the target element in the target OFD document is not missing.

[0062] Exemplarily, when traversing the target document tree generated by parsing the target OFD document, if it is determined that the ID attribute corresponding to the target element exists or is not empty according to the target document tree, the target display level information is directly determined according to the ID information.

[0063] Based on this, the above method can determine the target display level information directly based on the ID information when it is determined that the ID information of the target element in the target OFD document is not missing, which is beneficial to improve the generation efficiency of the target HTML page while ensuring the generation accuracy of the target HTML page.

[0064] In some feasible implementations, the above-mentioned determining the target display level information corresponding to the target element in the target HTML page based on the relevant information of the target element includes: determining the relative distance between the first target element and the second target element based on the coordinate information of the first target element and the second target element; determining the areas of the first target element and the second target element based on the size information of the first target element and the second target element; when the relative distance is less than or equal to the preset distance and the area of ​​the first target element is smaller than the area of ​​the second target element, controlling the first target element to be displayed in the first target display level and the second target element to be displayed in the second target display level, wherein the first target display level is stacked on the second target display level.

[0065] Exemplarily, the relative distance may be calculated and determined based on the Euclidean distance or the Manhattan distance according to the coordinate information of the first target element and the second target element. The preset distance may be the minimum preset distance between two adjacent target elements at which there is overlap or intersection. Specifically, the preset distance may be manually set or iteratively determined based on historical generation records.

[0066] Exemplarily, the areas of the first target element and the second target element may be determined according to the following formula:

[0067] (1)

[0068] in, is the area of ​​the target element, is the width of the target element, The height of the target element.

[0069] It should be noted that the above method controls the first target element to be displayed on the first target display level and the second target element to be displayed on the second target display level when it is determined that the above relative distance is less than or equal to the preset distance, that is, the above first target element and the above second target element are overlapped or intersected, and the area of ​​the above first target element is smaller than the area of ​​the above second target element. The first target display level is stacked on the second target display level, which is beneficial to avoid the first target element with a smaller area being obscured by the above second target element with a larger area, resulting in incomplete display content of the target HTML page, thereby helping to improve the display completeness of the target HTML page for the target elements in the target OFD document, and realize the target HTML page to fully reproduce the information contained in the target OFD document.

[0070] In some feasible implementations, the above-mentioned related information further includes: drawing order information; the above-mentioned method further includes: determining target display level information according to the size information, coordinate information and drawing order information.

[0071] Exemplarily, the above-mentioned drawing order information may include: drawing order information of the target element, and / or drawing order information of the target display level, etc.

[0072] Specifically, when it is determined that the drawing order of the first target element is relatively later than the drawing order of the second target element according to the drawing order information of the target elements, the first target display level corresponding to the first target element is controlled to be superimposed on the second target display level corresponding to the second target element.

[0073] Specifically, when it is determined according to the drawing order information of the target display layers that the drawing order of the first target display layer is relatively later than the drawing order of the second target display layer, the first target display layer is controlled to be superimposed on the second target display layer.

[0074] Based on this, the above method can accurately determine the target display hierarchy information according to the above size information, the above coordinate information and the above drawing order information, thereby accurately generating the target HTML page according to the above target display hierarchy information, improving the consistency of the hierarchy overlay order of the above target HTML page, the display order of the target elements and the above target OFD document, and thereby improving the generation accuracy of the target HTML page.

[0075] In some feasible implementations, the above-mentioned determination of the target display level information based on the size information, coordinate information and drawing order information includes: determining the target display level information according to a preset target display level determination function; determining the overlay order information of multiple target display levels according to the target display level information and the first target `z-index` value.

[0076] It should be noted that the above-mentioned first target `z-index` value is the `z-index` value corresponding to the target element.

[0077] Exemplarily, the first target `z-index` value allocation principle can be determined according to the preset variables in the preset hash dictionary, and the first target `z-index` value can be determined according to the first target `z-index` value allocation principle. Specifically, the `z-index` values ​​of the surrounding elements, background elements, and / or intersection elements within the preset distance threshold around the target element can be obtained to determine the first target `z-index` value corresponding to the target element. Among them, the above-mentioned preset distance threshold can be set according to the specific scene requirements.

[0078] Specifically, in determining the first target element , the second target element The third adjacent target element When the corresponding `z-index` value is 93, the first target element is determined , the second target element The corresponding first target `z-index` value should be greater than or equal to 93. The first target element can be determined by superimposing it with 93 as the base. , the second target element The corresponding first target `z-index` value.

[0079] It should be noted that the target Cascading Style Sheets (CSS) can be determined according to the target display level information and the first target `z-index` value to determine the stacking order information of multiple target display levels.

[0080] Based on this, the above method can accurately determine the target display level information according to the preset target display level determination function; accurately determine the overlay order information of multiple target display levels according to the target display level information and the first target `z-index` value, thereby improving the consistency of the display level overlay order of the target HTML page with the target OFD document, and then improving the generation accuracy of the target HTML page.

[0081] In some feasible implementations, the preset target display level determination function includes the following function:

[0082] (2)

[0083] in, is the first display level, is the area of ​​the first target element, is the area of ​​the second target element, is the relative distance between the first target element and the second target element, is the difference between the drawing order of the first target element and the second target element, is the first weight coefficient, β is the second weight coefficient, and γ is the third weight coefficient.

[0084] It should be noted that the first weight coefficient , the second weight coefficient β and the third weight coefficient γ can be automatically set according to specific scenario requirements.

[0085] For example, in If it is greater than 0, the first target element The corresponding first target display level is superimposed on the second target element The corresponding second target displays the level.

[0086] For example, in If it is less than 0, the second target element The corresponding second target display level is superimposed on the first target element The corresponding first target display level.

[0087] For example, in If it is equal to 0, then the first target element With the second target element At the same target level.

[0088] Based on this, the above method can accurately determine the stacking order of the target display levels corresponding to multiple target elements based on the above formula (2), thereby further improving the consistency of the display level stacking order of the target HTML page and the target OFD document, and improving the generation accuracy of the target HTML page.

[0089] In some feasible implementations, the method further includes: determining a second target `z-index` value corresponding to the target display level according to a weight corresponding to each target display level, an index corresponding to the target display level, and a drawing order, when it is determined that the sum of the target display levels corresponding to the target area in the target OFD document is greater than or equal to the sum of the preset display levels, and / or when the sum of the target elements contained in all the target display levels corresponding to the target area is greater than or equal to the sum of the preset target elements; determining, according to the target display level information and the second target `z-index` value, the stacking order information of multiple target display levels corresponding to the target area;

[0090] Among them, the second target `z-index` value corresponding to the target display level is determined according to the following formula:

[0091] (3)

[0092] in, is the second target `z-index` value, is the weight, is the index, The drawing order.

[0093] Exemplarily, the target area may be specified by the target user. Specifically, the target area may be determined by the target user by checking in the target OFD document, and / or by coordinate information manually input by the target user.

[0094] Exemplarily, the above-mentioned preset display level sum value and the above-mentioned preset target element sum value can be determined according to the target user's accuracy requirement for generating a target HTML page based on the target OFD document. Specifically, the above-mentioned preset display level sum value and / or the above-mentioned preset target element sum value are negatively correlated with the target user's accuracy requirement for generating a target HTML page based on the target OFD document, that is, the higher the target user's accuracy requirement for generating a target HTML page based on the target OFD document, the smaller the preset display level sum value and / or the above-mentioned preset target element sum value.

[0095] Exemplarily, the target document tree generated by parsing the target OFD document may be traversed to determine the total number of target elements included in all target display levels corresponding to the target area.

[0096] Exemplarily, based on the target ID information corresponding to the target document tree and / or the above formula (2), different display levels of the sum of all target elements corresponding to the target area can be counted to determine the sum of target display levels corresponding to the target area in the target OFD document.

[0097] Specifically, when it is determined that the sum of the target display levels corresponding to the target area in the target OFD document is greater than or equal to the preset display level sum value, and / or when the sum of the target elements contained in all the target display levels corresponding to the target area is greater than or equal to the preset target element sum value, the superposition order information of multiple target display levels in the target area can be determined based on the above formula (3).

[0098] It should be noted that the above weights Can be used to balance indexes and drawing order The influence of the second target `z-index` value. It is positively correlated with the sum of the target display levels and / or the sum of the target elements contained in all target display levels. That is, the higher the complexity of the target OFD document, the higher the weight. Specifically, the above weight You can set it based on the actual scenario experimental results. For example, you can set the above weights based on the actual scenario requirements. Set to 10 or 100 etc.

[0099] For example, the above index and the above drawing order It can be determined according to the parsing result of the target OFD document. It should be noted that, in some feasible implementations, the above index and the above drawing order It can also be determined by combining the above formula (2).

[0100] Based on this, the above method can be implemented to achieve, when it is determined that the sum of the target display levels corresponding to the target area in the target OFD document is greater than or equal to the sum of the preset display levels, and / or the sum of the target elements contained in all the target display levels corresponding to the target area is greater than or equal to the sum of the preset target elements, based on the above formula (3), according to the weight corresponding to each target display level, the index corresponding to the target display level and the drawing order, accurately determine the second target `z-index` value corresponding to the target display level; according to the target display level information and the second target `z-index` value, accurately determine the superposition order information of multiple target display levels corresponding to the target area, thereby further improving the consistency between the superposition order of each display level of the target HTML page and the superposition order of each display level of the target area of ​​the target OFD document, and improving the layout restoration degree of the target HTML page to the target OFD document.

[0101] In some feasible implementations, the method as described in any of the above items also includes: determining the target transparency of the target element in the target HTML page based on the actual transparency and maximum transparency of the target element in the target OFD document; wherein the target transparency is the ratio of the actual transparency to the maximum transparency.

[0102] Exemplarily, the target transparency can be determined according to the following formula:

[0103] (4)

[0104] in, For the goal transparency, For actual transparency, For maximum transparency.

[0105] It should be noted that the actual transparency of the above target elements in the target OFD document and maximum transparency It can be determined by parsing the above target OFD document.

[0106] Based on this, the above method can accurately determine the target transparency of the target element in the target HTML page according to the actual transparency and maximum transparency of the target element in the target OFD document, thereby improving the determination accuracy of the target transparency corresponding to the target element in the target HTML page, and then improving the transparency reproduction accuracy of the target HTML page for each target element in the target OFD document, and improving the consistency of the transparency information between the target HTML page and the target OFD document.

[0107] In some feasible implementations, the above method also includes: when the target element is a vector graphic, generating a preset type element corresponding to the target element according to the target element; generating a target HTML page according to the preset type element, wherein the preset type element includes: SVG type element, and / or Canvas type element.

[0108] Exemplarily, when the target element is determined to be a vector graphic by parsing the target OFD document, a corresponding SVG element and / or Canvas element is generated based on the target element; and a target HTML page is generated according to the SVG element and / or Canvas element corresponding to the target element.

[0109] Based on this, the above method improves the cross-platform compatibility of the target HTML page and the display quality and clarity of the target elements of the target HTML page while ensuring that the target HTML can fully reproduce the content of the target OFD document, which is conducive to providing convenience for the target user to modify or edit the target HTML page, and is conducive to reducing the loading time of the target HTML page and improving the display efficiency of the target HTML page.

[0110] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0111] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.

[0112] According to a second aspect of the embodiments of the present application, a device for estimating display levels in OFD to HTML conversion is provided. Figure 2 The structural diagram of a device 200 for estimating the display level in OFD to HTML provided in an embodiment of the present application. Figure 2 The device 200 shown includes: a determining unit 210 and a generating unit 220 .

[0113] The determination unit 210 is used to determine the target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element when it is determined that the ID information of the target element in the target OFD document is missing, wherein the relevant information includes: size information and coordinate information.

[0114] The generating unit 220 is used to generate a target HTML page according to the target display level information.

[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described method can refer to the corresponding process in the aforementioned system embodiment, and will not be repeated here.

[0116] Figure 3 Schematic diagram of the structure of a terminal device or server suitable for implementing the embodiment of the present application. Figure 3 As shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the terminal device or the server are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0117] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.

[0118] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the system of the present application are executed.

[0119] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0122] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.

Claims

1. A method for estimating display levels in OFD to HTML, characterized in that: include: When it is determined that the ID information of the target element in the target OFD document is missing, Determine the target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information; Generate a target HTML page according to the target display level information; Determining target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element includes: Determine the relative distance between the first target element and the second target element according to the coordinate information of the first target element and the second target element; Determine the areas of the first target element and the second target element according to the size information of the first target element and the second target element; In the case where the relative distance is less than or equal to the preset distance, and the area of ​​the first target element is smaller than the area of ​​the second target element, The first target element is controlled to be displayed in a first target display level, and the second target element is controlled to be displayed in a second target display level, wherein the first target display level is stacked on the second target display level.

2. The method according to claim 1, characterized in that The method further comprises: When it is determined that the ID information of the target element in the target OFD document is not missing, the target display level information is determined according to the ID information.

3. The method according to claim 1, characterized in that: The related information also includes: drawing order information; The method further comprises: The target display level information is determined according to the size information, the coordinate information, and the drawing order information.

4. The method according to claim 3, characterized in that Determining the target display level information according to the size information, the coordinate information, and the drawing order information includes: Determining the target display level information according to a preset target display level determination function; Determine the stacking order information of multiple target display levels according to the target display level information and the first target `z-index` value.

5. The method according to claim 4, characterized in that The preset target display level determination function includes the following functions: in, is the first display level, is the area of ​​the first target element, is the area of ​​the second target element, is the relative distance between the first target element and the second target element, is the difference between the drawing order of the first target element and the second target element, is the first weight coefficient, β is the second weight coefficient, and γ is the third weight coefficient.

6. The method according to claim 5, characterized in that Also includes: When it is determined that the sum of the target display levels corresponding to the target area in the target OFD document is greater than or equal to the preset display level sum value, and / or, When the sum of the target elements contained in all target display levels corresponding to the target area is greater than or equal to the preset target element sum value, Determine a second target `z-index` value corresponding to the target display level according to the weight corresponding to each target display level, the index corresponding to the target display level, and the drawing order; Determine, according to the target display level information and the second target `z-index` value, the stacking order information of multiple target display levels corresponding to the target area; The second target `z-index` value corresponding to the target display level is determined according to the following formula: in, For the second target `z-index` value, is the weight, For the index, is the drawing order.

7. The method according to any one of claims 1 to 6, characterized in that Also includes: Determining a target transparency of the target element in the target HTML page according to an actual transparency and a maximum transparency of the target element in the target OFD document; The target transparency is the ratio of the actual transparency to the maximum transparency.

8. The method according to claim 7, characterized in that Also includes: In the case where the target element is a vector graphic, generating a preset type element corresponding to the target element according to the target element; The target HTML page is generated according to the preset type element, wherein the preset type element includes: an SVG type element and / or a Canvas type element.

9. A device for estimating display levels in OFD to HTML, characterized in that: include: A determination unit, configured to determine, when it is determined that the ID information of the target element in the target OFD document is missing, target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element, wherein the relevant information includes: size information and coordinate information; A generating unit, configured to generate a target HTML page according to the target display level information; Determining target display level information corresponding to the target element in the target HTML page according to the relevant information of the target element includes: Determine the relative distance between the first target element and the second target element according to the coordinate information of the first target element and the second target element; Determine the areas of the first target element and the second target element according to the size information of the first target element and the second target element; In the case where the relative distance is less than or equal to the preset distance, and the area of ​​the first target element is smaller than the area of ​​the second target element, The first target element is controlled to be displayed in a first target display level, and the second target element is controlled to be displayed in a second target display level, wherein the first target display level is stacked on the second target display level.

Citation Information

Patent Citations

  • OFD document online browsing method

    CN112800366A

  • Method and system for converting HTML file into OFD file

    CN115757272A