Word document format checking and optimizing method
By using automated format checking and optimization methods and the QBTool.AnBiao.dll component, the problem of low efficiency in traditional document format checking is solved, enabling efficient and accurate document format adjustment and optimization to meet personalized needs.
Patent Information
- Application Number
- CN202511426482.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-11-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional document format checking and optimization methods rely on manual operation, which is inefficient and prone to omissions and errors. Existing tools cannot meet personalized needs and lack visual interaction.
By obtaining the document's format requirements and storing them in a JSON file, the QBTool.AnBiao.dll custom component is used for automated format checking and optimization, including reflection calls and the use of component methods, and the results of the checking and optimization are output.
It improves document processing efficiency, reduces manual operation time, achieves accurate format checking and optimization, meets personalized needs, and provides an intuitive results display interface.
Smart Images

Figure CN120893403A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, in particular to a Word document format checking and optimization method. BACKGROUND
[0002] In many fields, such as bidding, academic paper writing, etc., the format requirements for documents are very strict. Traditional document format checking and optimization methods usually rely on manual operation, which is not only inefficient, but also prone to omissions and errors. Although some document processing software on the market has certain format checking functions, it cannot meet the specific and personalized format requirements.
[0003] In addition, traditional Word format adjustment relies on manual operation, which has problems such as low efficiency of repeated style setting and difficulty in multi-level title linkage. Existing batch processing tools (such as VBA macros) lack visual interaction, and the modification process is not intuitive. The existing API of Aspose.Word component only provides the underlying interface and cannot solve the technical contradiction between user-side real-time feedback and batch format linkage.
[0004] Therefore, it is of great practical significance to develop a system that can accurately check and optimize Word documents according to preset format requirements. SUMMARY
[0005] The purpose of the present application is to provide a Word document format checking and optimization method, device, equipment and readable storage medium, which greatly improves the efficiency of document processing and reduces the time and workload of manual operation through automatic format checking and optimization process. The document can be accurately checked according to the preset format requirements, avoiding omissions and errors that may occur in manual checking. Users can set different format requirements according to their own needs to meet the personalized document processing needs. Through the intuitive result display interface, users can clearly understand the checking and optimization of the document, which is convenient for timely processing.
[0006] To achieve the above purpose, the present application provides the following technical solutions: In the first aspect, the present application provides a Word document format checking and optimization method, which comprises: Obtain the format requirements of the document and the document to be checked and optimized, and store the format requirements in a JSON file and store the document to be checked and optimized in an ObservableCollection <fileinfoentity>middle; The QBTool.AnBiao.dll custom component is invoked to perform a format check on the document to be inspected and optimized. If the document to be checked and optimized does not meet the format requirements, the YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document according to the format requirements and output the inspection and optimization results.
[0007] In some embodiments, the QBTool.AnBiao.dll custom component is invoked to perform format checks on the document to be inspected and optimized, including: The relevant information of the document to be inspected and optimized is encapsulated in an AnBiaoJson object; the relevant information includes the region code, method name, file path, and format requirement file path; The ReflectionFunction class is used to invoke reflection, calling methods in QBTool.AnBiao.DQCommon.WebForm.anbiao_Eco.anbiaoWeb to perform format checks on the document to be inspected and optimized.
[0008] In some embodiments, the method further includes: Store the inspection results in an Anbiaoformat object; Retrieve detailed error information from the database and store it in a list of FormatResultModel objects.
[0009] In some embodiments, the YHWordFormat method of the QBTool.AnBiao.dll component is invoked to optimize the document to be checked and optimized according to the format requirements, and the inspection and optimization results are output, including: The YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document to be checked and optimized according to the format requirements; The file path of the optimized document to be checked is stored in the tempNewPath property of the FileInfoEntity object; Output the inspection and optimization results of the document to be inspected and optimized.
[0010] In some embodiments, the inspection and optimization results of the document to be inspected and optimized are output, including: Output the number of errors, error types, optimization results, and whether manual optimization suggestions are needed for the document to be checked and optimized.
[0011] In some embodiments, the method further includes: If the optimization document to be checked needs manual optimization, output a manual optimization prompt.
[0012] In a second aspect, the present application further provides a Word document format checking and optimizing device, which comprises: An information acquisition module is configured to acquire a format requirement of a document and an optimization document to be checked, store the format requirement in a JSON file, and store the optimization document to be checked in an ObservableCollection <fileinfoentity>In the present application, the format requirement of the document is obtained, and the format requirement is stored in a JSON file. The document checking module is configured to call a QBTool.AnBiao.dll custom component to perform format checking on the to-be-checked optimization document. The document optimization module is configured to call a YHWordFormat method of the QBTool.AnBiao.dll component to perform optimization on the to-be-checked optimization document according to the format requirement if the to-be-checked optimization document does not meet the format requirement, and output the checking optimization result.
[0013] In a third aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the Word document format checking and optimization method provided in the first aspect.
[0014] The Word document format checking and optimization method provided in the present application has the following beneficial effects: the format requirement of the document is obtained, and the format requirement is stored in a JSON file; the to-be-checked optimization document is stored in an ObservableCollection <fileinfoentity>The method comprises the following steps: calling a QBTool.AnBiao.dll custom component to perform format checking on the to-be-checked optimization document; calling the YHWordFormat method of the QBTool.AnBiao.dll component to optimize the to-be-checked optimization document according to the format requirement, and outputting the checking and optimization result. Through the automatic format checking and optimization process, the efficiency of document processing is greatly improved, and the time and workload of manual operation are reduced. The document can be accurately checked according to the preset format requirement, and the omissions and errors that may occur in manual checking are avoided. The user can set different format requirements according to his own needs to meet the personalized document processing needs. Through the intuitive result display interface, the user can clearly understand the checking and optimization situation of the document, and the processing can be performed in time.
[0015] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, and to implement the content of the specification, the following will be described in detail with the preferred embodiments of the present application and with the help of the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 A flowchart of a Word document format checking and optimization method according to an embodiment of the present application is shown. Figure 2 A flowchart of another Word document format checking and optimization method according to an embodiment of the present application is shown. Figure 3 A structural diagram of a Word document format checking and optimization device according to an embodiment of the present application is shown. Figure 4 A structural diagram of another Word document format checking and optimization device according to an embodiment of the present application is shown. Figure 5 A structural diagram of another Word document format checking and optimization device according to an embodiment of the present application is shown. Figure 6 A structural diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0017] The technical solutions of the present application will be described in detail below with the help of the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0018] It is noted that the recitations in this specification of "one embodiment," "an embodiment,” “some embodiments,” “other embodiments,” etc. indicate that the embodiment(s) so described can include a particular feature, structure, or characteristic, but not every embodiment necessarily includes the particular feature, structure, or characteristic. Further, repeated use of the phrases "for example,” “for instance,” “e.g.,” “among other,” etc. does not necessarily refer to the same group of items, but can refer to two or more different or unrelated groups of items. In addition, it is contemplated that the features, structures, or characteristics described in connection with one embodiment can be combined with features, structures, or characteristics of another embodiment without necessarily being limited to the embodiment.
[0019] Further, the technical features involved in the different embodiments of the application described below can be combined with each other as long as there is no conflict.
[0020] In some embodiments, as shown in Figure 1 A Word document format checking and optimization method is provided, and the specific method includes: S101, obtaining the format requirement of the document and the document to be checked and optimized, and storing the format requirement in a JSON file and storing the document to be checked and optimized in an ObservableCollection <fileinfoentity>In some embodiments, the format requirements of the document are uploaded by the user, and the document needs to be optimized, such as font requirements, font size requirements, and related content requirements.
[0021] In some embodiments, the format requirements of the document are uploaded by the user, and the document needs to be optimized, such as font requirements, font size requirements, and related content requirements.
[0022] In some embodiments, the user can set the format requirements through the system interface or the configuration file. After obtaining the format requirements, the format requirements are stored in the JSON file. The JSON file is used to store the format requirements of the document, including various directories (such as "content check" and "style check") and detection points (such as "not allowed to appear units or personnel names" and "cover font"). Each detection point contains detailed attribute information, such as "NodeValue, NodeName, NodeCode, Type", etc. The flexible configuration and management of the format requirements are achieved. In addition, after obtaining the uploaded document to be checked and optimized by the user, the document to be checked and optimized is stored in the ObservableCollection <fileinfoentity>In this way, it is more convenient for UI synchronization and management when optimizing the to-be-checked document subsequently.
[0023] S102, call the QBTool.AnBiao.dll custom component to perform format checking on the to-be-checked optimization document.
[0024] The QBTool.AnBiao.dll custom component is based on Aspose.Words to implement format checking and setting functions on the Word document. By reflecting the method in the component, the relevant information (such as region code, method name, file path, format requirement file path, etc.) is encapsulated in the AnBiaoJson object to realize automatic checking and optimization of the document.
[0025] Specifically, the method for performing format checking on the to-be-checked optimization document can include: encapsulating the relevant information of the to-be-checked optimization document in the AnBiaoJson object; the relevant information includes region code, method name, file path, and format requirement file path; performing format checking on the to-be-checked optimization document by reflecting the method in the QBTool.AnBiao.DQCommon.WebForm.anbiao_Eco.anbiaoWeb through the ReflectionFunction class, and storing the checking result in the Anbiaoformat object; obtaining detailed error information from the database and storing it in the FormatResultModel object list.
[0026] Specifically, when performing format checking on the to-be-checked optimization document, multiple detection types are supported, such as "determination", "selection", "numeric unit", etc. For example, the "determination" type is used to determine whether the document meets a specific condition (such as "no title font underline"), the "selection" type is used to select the appropriate setting from the predefined options (such as "main font" can be selected from "Songti", "Huibiti", etc.), and the "numeric unit" type is used to set the numeric value with unit (such as "paragraph spacing" can be set to "pound", "centimeter", "line", etc.).
[0027] S103, if the to-be-checked optimization document does not meet the format requirements, call the YHWordFormat method of the QBTool.AnBiao.dll component to optimize the to-be-checked optimization document according to the format requirements, and output the checking optimization result.
[0028] Specifically, the YHWordFormat method of the QBTool.AnBiao.dll component can be called to optimize the part of the to-be-checked optimization document that does not meet the format requirements to meet the format requirements, and then output the optimization checking result to the user.
[0029] Optionally, the method of optimizing the to-be-checked optimization document according to the format requirement and outputting the checking optimization result can also be: calling the YHWordFormat method of the QBTool.AnBiao.dll component to optimize the to-be-checked optimization document according to the format requirement; storing the file path of the to-be-checked optimization document after optimization in the tempNewPath attribute of the FileInfoEntity object; outputting the error number, error type, optimization result and whether manual optimization is needed for the to-be-checked optimization document. If the to-be-checked optimization document needs manual optimization, output the manual optimization prompt.
[0030] Specifically, according to the checking result, the system calls the YHWordFormat method of the QBTool.AnBiao.dll component to automatically optimize the document that does not meet the format requirement, and the file path after optimization is stored in the tempNewPath attribute of the FileInfoEntity object, which improves the efficiency and accuracy of document processing; in the CheckPointShowFormControlViewModel.cs file, according to the detection point type (such as "selection" type) defined in the JSON file, the corresponding control (such as ComboBox, CheckBox, etc.) is dynamically generated, and the properties and event handlers of the control are set, which realizes the dynamicization and interactivity of the user interface; the checking and optimization results are displayed to the user through interface elements (such as lists, icons, etc.), different colors and icons are set according to the error situation of the file to prompt the user about the state of the file, and the user experience is improved. In the JsonToCheckInfo.cs file, the assignment operation of the business logic is included, such as assigning a value to the NodeInfo property of the checkpoint through the GetBusinessValue method, to ensure that the information of the checkpoint accurately reflects the business requirements. For the check items that do not match, the system can insert them into the corresponding menuList node to ensure the integrity and consistency of the data.
[0031] For example, after optimization is completed, the error number, error type, error content, optimization result (i.e. the content after optimization of the error content) and whether manual optimization is needed can be displayed to the user through the display screen, i.e. when part of the content cannot be optimized, the user is prompted to perform manual optimization to complete the overall optimization. When the user has other requirements, such as some additional requirements beyond the format requirements, the user can also perform manual optimization at this time to finally obtain the optimized document.
[0032] Optionally, if the to-be-checked optimized document meets the format requirements, it is proved that the to-be-checked optimized document completely meets the user's format requirements, and optimization is not needed, and the error number, error type, optimization result and whether manual optimization suggestion is needed of the to-be-checked optimized document can be directly output, but this case can be ignored, because the format requirements of the document and the to-be-checked optimized document are both uploaded by the user, so only when the to-be-checked optimized document does not meet the format requirements, the user will upload the format requirements of the document and the to-be-checked optimized document to check and optimize the to-be-checked optimized document.
[0033] The Word document format checking and optimizing method in the above embodiment first acquires the format requirements of the document and the to-be-checked optimized document, stores the format requirements in a JSON file, stores the to-be-checked optimized document in an ObservableCollection <fileinfoentity>The QBTool.AnBiao.dll custom component is called again to perform format checking on the to-be-checked optimization document. Finally, if the to-be-checked optimization document does not meet the format requirements, the YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the to-be-checked optimization document according to the format requirements, and the checking and optimization results are output. Through the automatic format checking and optimization process, the efficiency of document processing is greatly improved, and the time and workload of manual operation are reduced. The document can be accurately checked according to the preset format requirements, avoiding omissions and errors that may occur during manual checking. Users can set different format requirements according to their own needs to meet individualized document processing needs. Through the intuitive result display interface, users can clearly understand the checking and optimization of the document, facilitating timely processing.
[0034] In order to more comprehensively display the present scheme, the present embodiment gives an optional way of a Word document format checking and optimization method, as shown in Figure 2 S201, obtaining the format requirements of the document and the to-be-checked optimization document, and storing the format requirements in a JSON file and storing the to-be-checked optimization document in an ObservableCollection <fileinfoentity>In.
[0035] S202, encapsulate the related information of the optimization document to be checked in an AnBiaoJson object.
[0036] The related information includes area code, method name, file path and format requirement file path.
[0037] S203, perform a reflection call through the ReflectionFunction class to call the method in QBTool.AnBiao.DQCommon.WebForm.anbiao_Eco.anbiaoWeb to perform format checking on the optimization document to be checked.
[0038] S204, store the checking result in an Anbiaoformat object.
[0039] S205, obtain detailed error information from the database and store it in a FormatResultModel object list.
[0040] S206, if the optimization document to be checked does not meet the format requirements, call the YHWordFormat method of the QBTool.AnBiao.dll component to optimize the optimization document to be checked according to the format requirements.
[0041] S207, store the file path of the optimized optimization document to be checked in the tempNewPath attribute of the FileInfoEntity object.
[0042] S208, output the error number, error type, optimization result and whether manual optimization is required for the optimization document to be checked.
[0043] S209, if manual optimization is required for the optimization document to be checked, output a manual optimization prompt.
[0044] The specific process of S201-S209 can be referred to the description of the method embodiments, which has similar implementation principles and technical effects, and will not be repeated here.
[0045] Based on the same inventive concept, the embodiments of the present application also provide a Word document format checking and optimization apparatus for implementing the Word document format checking and optimization method. The apparatus provides a similar solution to the problem as the method, so the specific limitations in one or more Word document format checking and optimization apparatus embodiments provided below can be referred to the limitations of the Word document format checking and optimization method above, and will not be repeated here.
[0046] In one embodiment, as Figure 3 As shown, a Word document format checking and optimizing device is provided, which comprises: An information acquisition module 30 is configured to acquire format requirements of a document and a document to be checked and optimized, and store the format requirements in a JSON file and store the document to be checked and optimized in an ObservableCollection <fileinfoentity>middle; Document inspection module 31 is used to call the QBTool.AnBiao.dll custom component to perform format inspection on the document to be inspected and optimized; The document optimization module 32 is used to call the YHWordFormat method of the QBTool.AnBiao.dll component if the document to be checked and optimized does not meet the format requirements, optimize the document to be checked and optimized according to the format requirements, and output the inspection and optimization results.
[0047] In another embodiment, such as Figure 4 As shown above, Figure 3 The document inspection module 31 in the document includes: The information encapsulation unit 310 is used to encapsulate the relevant information of the document to be inspected and optimized in an AnBiaoJson object; the relevant information includes the region code, method name, file path, and format requirement file path; The format checking unit 311 is used to perform format checks on the document to be checked and optimized by calling the methods in QBTool.AnBiao.DQCommon.WebForm.anbiao_Eco.anbiaoWeb through reflection calls using the ReflectionFunction class.
[0048] In another embodiment, the above Figure 3 The document inspection module 31 is also specifically used for: storing the inspection results in an Anbiaoformat object; and retrieving detailed error information from the database and storing it in a list of FormatResultModel objects.
[0049] In another embodiment, such as Figure 5 As shown above, Figure 3 The document optimization module 32 in the document includes: Method invocation unit 320 is used to invoke the YHWordFormat method of the QBTool.AnBiao.dll component to optimize the document to be checked and optimized according to the format requirements; Path storage unit 321 is used to store the file path of the optimized document to be checked in the tempNewPath property of the FileInfoEntity object; The result output unit 322 is used to output the inspection and optimization results of the document to be inspected and optimized.
[0050] In another embodiment, the above Figure 5 The result output unit 322 in the Word document format checking and optimization apparatus is specifically configured to output the error number, error type, optimization result and whether manual optimization suggestion is needed of the to-be-checked optimization document.
[0051] In another embodiment, the Word document format checking and optimization apparatus Figure 3 The Word document format checking and optimization apparatus in the Word document format checking and optimization method is also specifically configured to output a manual optimization prompt if the to-be-checked optimization document needs manual optimization.
[0052] Embodiments of the present application also provide an electronic device. In some embodiments, the electronic device can be configured to perform the Word document format checking and optimization method and / or the technical solutions described above. Figure 6 As shown in FIG. 7, the electronic device 700 includes an input unit 710, a memory 720, a processor 730 and an output unit 740. The memory 720 stores program instructions executable on the processor 730, and the processor 730 invokes the program instructions to perform the Word document format checking and optimization method and / or the technical solutions described above. The electronic device 700 can be a computer or other mobile terminal device.
[0053] The technical features of the above embodiments can be integrated in any manner. To make the description simple, not all possible integrations of the technical features in the above embodiments are described, however, as long as the integration of the technical features does not exist contradictions, it should be considered as the scope of the present disclosure.
[0054] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of variations and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.< / fileinfoentity> < / fileinfoentity> < / fileinfoentity> < / fileinfoentity> < / fileinfoentity> < / fileinfoentity> < / fileinfoentity> < / fileinfoentity>
Claims
1. A method for checking and optimizing the format of a Word document, characterized in that, The method includes: Obtain the document's formatting requirements and the document to be inspected and optimized, and store the formatting requirements in a JSON file, and store the document to be inspected and optimized in an ObservableCollection. <fileinfoentity> middle;< / fileinfoentity> The QBTool.AnBiao.dll custom component is invoked to perform a format check on the document to be inspected and optimized. If the document to be checked and optimized does not meet the format requirements, the YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document according to the format requirements and output the inspection and optimization results. The YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document to be checked and optimized according to the format requirements, and the inspection and optimization results are output, including: The YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document to be checked and optimized according to the format requirements; The file path of the optimized document to be checked is stored in the tempNewPath property of the FileInfoEntity object; Output the inspection and optimization results of the document to be inspected and optimized.
2. The Word document format checking and optimization method as described in claim 1, characterized in that, The QBTool.AnBiao.dll custom component is invoked to perform format checks on the document to be inspected and optimized, including: The relevant information of the document to be inspected and optimized is encapsulated in an AnBiaoJson object; the relevant information includes the region code, method name, file path, and format requirement file path; The ReflectionFunction class is used to invoke reflection, calling methods in QBTool.AnBiao.DQCommon.WebForm.anbiao_Eco.anbiaoWeb to perform format checks on the document to be inspected and optimized.
3. The Word document format checking and optimization method as described in claim 2, characterized in that, The method further includes: Store the inspection results in an Anbiaoformat object; Retrieve detailed error information from the database and store it in a list of FormatResultModel objects.
4. The Word document format checking and optimization method as described in claim 1, characterized in that, Output the inspection and optimization results of the document to be inspected and optimized, including: Output the number of errors, error types, optimization results, and whether manual optimization suggestions are needed for the document to be checked and optimized.
5. The Word document format checking and optimization method as described in any one of claims 1-4, characterized in that, The method further includes: If the document to be inspected and optimized requires manual optimization, a manual optimization prompt will be output.
6. A Word document format checking and optimization device, characterized in that, The device includes: The information acquisition module is used to acquire the document's format requirements and the document to be inspected and optimized, and stores the format requirements in a JSON file and the document to be inspected and optimized in an ObservableCollection. <fileinfoentity> middle;< / fileinfoentity> The document inspection module is used to call the QBTool.AnBiao.dll custom component to perform format checks on the document to be inspected and optimized. The document optimization module is used to call the YHWordFormat method of the QBTool.AnBiao.dll component if the document to be checked and optimized does not meet the format requirements, optimize the document to be checked and optimized according to the format requirements, and output the inspection and optimization results. The YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document to be checked and optimized according to the format requirements, and the inspection and optimization results are output, including: The YHWordFormat method of the QBTool.AnBiao.dll component is called to optimize the document to be checked and optimized according to the format requirements; The file path of the optimized document to be checked is stored in the tempNewPath property of the FileInfoEntity object; Output the inspection and optimization results of the document to be inspected and optimized.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the Word document format checking and optimization method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the Word document format checking and optimization method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the Word document format checking and optimization method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Template-based intelligent format checking method aiming at Word document
CN101706771A
Method and device for automatically outputting documents in specified format, equipment and medium
CN113011148A
Document format automatic checking method
CN118798126A
Document review method, apparatus and system, device, and storage medium
WO2021088400A1