Method for identifying page header and page footer of OFD document and performing structured processing

By identifying multiple features of an OFD document and creating template pages, the problem of indistinguishable headers and footers in OFD files is solved, and the accuracy of text extraction and editing efficiency is improved.

CN119025615AInactive Publication Date: 2024-11-26百望股份有限公司

Patent Information

Application Number
CN202411157146.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

OFD files lack a special structure to specify the header footer, which makes it impossible to directly distinguish between the body and the header footer in the page content, affecting the reading and editing process.

Method used

By identifying the page area of ​​the OFD document, including the bleeding area, the physical area, the display area and the central area, multiple features are used to comprehensively judge the header and footer content, and create a template page for structured processing.

Benefits of technology

Effectively distinguish and process header footer content, reduce text extraction error rate, improve editing efficiency, and reduce the cost of modifying header footer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025615A_ABST
    Figure CN119025615A_ABST
Patent Text Reader

Abstract

The invention provides a method for identifying page headers and footers of an OFD document and carrying out structured processing. The method comprises the steps that page areas of the OFD document comprise a bleeding area, a physical area, a display area and a version center area; the method comprises the following steps: S1, starting; s2, indicating a version core area; s2, if the object located outside the edition core area conforms to the header and footer characteristics, executing S3; s3, detecting alignment mode features; s4, detecting repetition characteristics and page number characteristics; s5, comprehensively judging the contents of the header and the footer according to a plurality of characteristics; s6, creating a template page, and structuring a header and a footer; and S7, stopping. According to the method, firstly, the accuracy of extracting the text is reduced, the obtained text not only comprises a title and a main body, but also is mixed with characters of page headers and page footers, secondly, the cost of secondary editing is improved, and the OFD file needs to be modified page by page when the page headers and the page footers are modified, so that the invention provides a method for identifying the page headers and the page footers and structuring by using template pages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of OFD document header and footer and structural processing, and specifically relates to a method for identifying OFD document header and footer and performing structural processing. Background Art

[0002] OFD file, the full name of which is OpenFixed-layoutDocument, is an electronic file format similar to the PDF format proposed by Adobe in the United States. OFD file format is a layout file format standard independently developed and formulated by my country, and has advantages that PDF format does not have. OFD file format is very similar to PDF, but it can support more document features, such as animation, audio and video, and has high scalability, which can help developers develop and maintain documents more easily. In addition, OFD file format is also widely used in electronic archives, electronic documents and other fields. In the long-term preservation of electronic documents, it has the characteristics of supporting double-layer presentation of images and text, multiple documents, high compression, etc., which provides technical support for the reuse and storage of electronic documents. Therefore, OFD file is mainly a layout file format that can be used to store and exchange financial data and documents, as well as electronic archives, electronic documents and other fields.

[0003] However, the current OFD file does not have a dedicated structure to specify headers and footers, which makes it impossible to directly distinguish the main text and headers and footers in the page content, which in turn brings a series of problems during reading and editing.

[0004] To this end, we propose a method to identify the header and footer of OFD documents and perform structural processing to solve the above problems. Summary of the invention

[0005] Currently, OFD files do not have a dedicated structure to specify headers and footers, which results in the inability to directly distinguish between the main text and headers and footers in the page content, which in turn causes a series of problems during reading and editing.

[0006] The present application provides a method for identifying headers and footers of an OFD document and performing structural processing, comprising the following steps: including: page areas of an OFD file: a bleed area, a physical area, a display area, and a page area;

[0007] The method comprises the following steps:

[0008] S1: Start;

[0009] S2: indicates the center area;

[0010] S2: If the object outside the page area meets the header and footer characteristics, then execute S3;

[0011] If not: it is determined that the dividing line is detected. If so, the object above the dividing line meets the header feature, and the part below the footer dividing line meets the footer feature. If not, the objects in the page are divided into lines, and the lines with line_y < threshold or page_height-line_y < threshold meet the header and footer features;

[0012] S3: Detect alignment features;

[0013] S4: Detect repeated features and page number characteristics;

[0014] S5: Comprehensively judge the content of header and footer based on multiple features;

[0015] S6: Create a template page and structure the header and footer;

[0016] S7: Stop.

[0017] In some specific embodiments, the bleeding area, physical area, display area and page area are arranged in sequence from outside to inside.

[0018] In some specific implementations, the content of the header and footer is divided into left, center and right positions.

[0019] In some specific implementations, the header and footer content includes fixed content and page numbers.

[0020] In some specific implementations, the alignment includes left alignment, center alignment, right alignment, two groups of objects are located at both ends, or three groups of objects are located at the left, center, and right, respectively.

[0021] Beneficial effects: The processed file is an OFD document, and the header and footer content is determined by using the center area of ​​the page, and the content of the header and footer is determined by integrating multiple features, including: horizontal lines, object positions, alignment, repeatability and continuous numbers, etc. The structured header and footer reduces the accuracy of text extraction by using the method of establishing a template page. The obtained text includes not only the title and the text, but also the text of the header and footer; secondly, the cost of secondary editing is increased, and the OFD file must be modified page by page when modifying the header and footer. In view of these shortcomings, the present invention proposes a method for identifying headers and footers and structuring them using template pages. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a flow chart of a method for identifying OFD document headers and footers and performing structural processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the specific embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0025] OFD file, the full name of which is OpenFixed-layoutDocument, is an electronic file format similar to the PDF format proposed by Adobe in the United States. OFD file format is a layout file format standard independently developed and formulated by my country, and has advantages that PDF format does not have. OFD file format is very similar to PDF, but it can support more document features, such as animation, audio and video, and has high scalability, which can help developers develop and maintain documents more easily. In addition, OFD file format is also widely used in electronic archives, electronic documents and other fields. In the long-term preservation of electronic documents, it has the characteristics of supporting double-layer presentation of images and text, multiple documents, high compression, etc., which provides technical support for the reuse and storage of electronic documents. Therefore, OFD file is mainly a layout file format that can be used to store and exchange financial data and documents, as well as electronic archives, electronic documents and other fields.

[0026] OFD file is a file format that complies with the national standard of Chinese layout documents. Its design takes into account the security, electronic processing and multi-field application of documents7. The structure of OFD file contains multiple different area concepts, including bleed area, physical area, display area and page area. These areas have different meanings and functions.

[0027] Bleeding area:

[0028] The bleed area refers to the area reserved outside the edge of the page, which is mainly used to retain the effective content of the picture during printing to avoid white edges or cutting into the content of the finished product after cutting. In OFD files, the bleed area is used to ensure the quality of the final printed or output document, and usually a certain margin is added compared to the actual page size.

[0029] Physical Area:

[0030] The physical area in the OFD file may refer to the physical area of ​​the page, which includes the coordinates of the upper left corner of the page, which is the origin of the page space coordinate system 1. This area defines the basic size and layout structure of the page and is the basis of the page content.

[0031] Display area:

[0032] The display area refers to the area where the page content is actually displayed or printed out. It is located in the physical area and includes the header, footer, and text center. The display area is the part of the document content that the user actually sees. Its position and size will affect the user's reading experience.

[0033] Page area:

[0034] The text area refers to the main text area of ​​the document, which is located in the display area, and its upper left corner coordinates determine its position in the display area 13. The text area is usually where the main content of the page is located. For OFD files, it may be the key information part of the document.

[0035] In OFD files, the bleed area, physical area, display area, and page area each have different responsibilities. The bleed area ensures the integrity of the document during printing, the physical area defines the basic structure of the page, the display area is what users actually see and interact with, and the page area is where the core content of the document is located. The concepts of these areas together constitute the layout and design specifications of the OFD file.

[0036] like Figure 1 As shown, the present application provides a method for identifying headers and footers of OFD documents and performing structural processing, comprising the following steps: including: page areas of the OFD file: bleed area, physical area, display area and page area;

[0037] The method comprises the following steps:

[0038] S1: Start;

[0039] S2: indicates the page center area;

[0040] S2: If the object outside the page area meets the header and footer characteristics, then execute S3;

[0041] If not: it is determined that the dividing line is detected. If so, the object above the dividing line meets the header feature, and the part below the footer dividing line meets the footer feature. If not, the objects in the page are divided into lines, and the lines with line_y < threshold or page_height-line_y < threshold meet the header and footer features;

[0042] S3: Detect alignment features;

[0043] S4: Detect repeated features and page number characteristics;

[0044] S5: Comprehensively judge the content of header and footer based on multiple features;

[0045] S6: Create a template page and structure the header and footer;

[0046] S7: Stop. This application firstly reduces the accuracy of text extraction, because the obtained text includes not only the title and the body, but also the text of the header and footer. Secondly, it increases the cost of secondary editing, because when modifying the header and footer, the OFD file must be modified page by page. This invention proposes a method for identifying the header and footer and structuring them with a template page.

[0047] In some specific embodiments, the bleeding area, physical area, display area and page area are arranged in sequence from outside to inside.

[0048] In some specific implementations, the content of the header and footer is divided into left, center and right positions.

[0049] In some specific implementations, the header and footer content includes fixed content and page numbers.

[0050] In some specific implementations, the alignment includes left alignment, center alignment, right alignment, two groups of objects are located at both ends, or three groups of objects are located at the left, center, and right, respectively.

[0051] The page areas of an OFD file are, from outside to inside, the bleed area, the physical area, the display area, and the page center area.

[0052] For pages with a designated page area, objects that are within the physical area but outside the page area can be considered as headers and footers. For pages without a designated page area, id, x, y, width, and height are recorded in the order in which the page objects appear in the page. Priority is given to detecting whether there are horizontal lines running through the page at the top and bottom of the page. The horizontal line with a ratio of width to page width (r = line_width / page_width) greater than the threshold and a distance from the top of the page (line_y) less than the threshold is the header separator. Objects above the horizontal line (y>line_y) are considered as header separators. The feature belongs to the header; the ratio of the width of the horizontal line to the page width (r = line_width / page_width) is greater than the threshold, and the horizontal line whose distance from the bottom of the page (page_height-line_y) is less than the threshold is the separator of the footer. The objects below the horizontal line (y>line_y) meet the feature and belong to the footer; for pages where the page area is not specified and the separator line is not detected, it is necessary to determine the header and footer according to multiple features such as text position and repeatability; first, all objects are processed in rows, and the row branching rules are as follows: for object 1 and object 2, if Min(y1+heig ht1,y2+height2)-Max(y1,y2)>threshold, then the two objects are considered to be in the same line; in the upper part of the page, if line_y is less than the threshold, it is considered to meet the header feature, and more features are combined to distinguish; in the lower part of the page, if (page_height-y) is less than the threshold, it is considered to meet the footer feature, and more features are combined to distinguish; alignment feature: the alignment methods commonly used for headers or footers include left alignment, center alignment, and right alignment, with two groups of objects at both ends, or three groups of objects at the left, center, and right respectively; repeated features: for symbols extracted from multiple pages, Combine objects with header and footer features to identify whether the content of objects in the same position is repetitive; page number features: objects with the same position but different content, separate the numbers in the content and identify whether they meet the continuous number features; after comprehensively identifying the header and footer based on multiple features, start to create a template page for the header and footer; the content of the header and footer can be divided into three parts: left, middle and right based on the position, and can be divided into fixed content and page numbers based on the format of the content, where the page number includes structures such as the current page number, total page number and separator; then insert the template page into the corresponding page, and remove the objects determined to be headers and footers from the page to complete the structuring.

[0053] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0054] The above description is only a preferred embodiment of the present application and does not constitute any form of limitation to the present application. Any technician familiar with the profession can make some changes or modify the technical contents disclosed above into equivalent embodiments with equivalent changes without departing from the scope of the technical solution of the present application. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still falls within the scope of the technical solution of the present application.

Claims

1. A method for identifying headers and footers of OFD documents and performing structural processing, characterized in that: Includes: Page areas of OFD files: bleed area, physical area, display area and page area; The method comprises the following steps: S1: Start; S2: indicates the center area; S2: If the object outside the page area meets the header and footer characteristics, then execute S3; If not: it is determined that the dividing line is detected. If so, the object above the dividing line meets the header feature, and the part below the footer dividing line meets the footer feature. If not, the objects in the page are divided into lines, and the lines with line_y < threshold or page_height-line_y < threshold meet the header and footer features; S3: Detect alignment features; S4: Detect repeated features and page number characteristics; S5: Comprehensively judge the content of header and footer based on multiple features; S6: Create a template page and structure the header and footer; S7: Stop.

2. The method for identifying and structurally processing OFD document headers and footers according to claim 1, characterized in that: The bleeding area, physical area, display area and page area are arranged in sequence from outside to inside.

3. The method for identifying and structuring OFD document headers and footers according to claim 1, characterized in that: The content of the header and footer is divided into left, center and right positions.

4. The method for identifying and structuring OFD document headers and footers according to claim 1, characterized in that: The header and footer content includes fixed content and page numbers.

5. The method for identifying and structurally processing OFD document headers and footers according to claim 1, characterized in that: The alignment modes include left alignment, center alignment, and right alignment, two groups of objects are located at both ends, or three groups of objects are located at the left, center, and right, respectively.

Citation Information

Patent Citations

  • Recognition method and device for page headers and page footers of format electronic document

    CN104951429A

  • Technology for completely identifying header and footer of PDF file

    CN110543810A

  • Method and system for converting streaming document into OFD format file, electronic equipment and storage medium

    CN115687243A

  • Method, system and device for generating OFD layout file

    CN116483787A

  • Method and apparatus for detecting pagination constructs including a header and a footer in legacy documents

    US20060156226A1

Cited By

  • Method and system for cleaning and constructing large model text training data and related device

    CN120561208A