Document conversion method, device, electronic device and storage medium

By adopting target layout methods and format conversion rules in official documents, the problem of inconsistent layout effects of official documents on different terminals is solved, and the scope of document circulation is expanded and the consistency of layout effects is achieved.

CN113283217BActive Publication Date: 2024-11-22ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110592717.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-11-22
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

Due to the differences in the layout method during the circulation of official documents, the layout effect of the opened document is very different from the original document, which limits the circulation scope of official documents and cannot meet the circulation needs.

Method used

Use target layout method to type the content of the document that sets the layout method, and adjust the format according to the format conversion rules to generate target documents that are similar to the original document layout effect but have different layout methods. Copy and adjust the format through the API interface to ensure that the conversion is The documents present consistent visual effects in different typesetting environments.

Benefits of technology

The scope of official documents circulation has been expanded, the needs of official documents circulation have been met, and the documents have been successfully transferred in different terminals and application software have been eliminated, which has been freed from the limitations on the document operation environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283217B_ABST
    Figure CN113283217B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a document conversion method, device, electronic device and storage medium. The embodiment of the present invention typesets the content of a first document with a set typesetting mode by using a target typesetting mode to obtain a second document, wherein the target typesetting mode is different from the set typesetting mode, and the second document is formatted according to a format conversion rule to obtain a target document corresponding to the first document, wherein the format conversion rule is determined according to the format attribute difference and rendering mode difference between the set typesetting mode and the target typesetting mode, and the target document is output, and the first document can be automatically converted into a target document with a typesetting effect close to that of the first document but a typesetting mode different from that of the first document by using a different typesetting mode. The circulation range of the first document is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of office automation, and in particular to a document conversion method, device, electronic equipment and storage medium. Background Art

[0002] In government agencies, official documents are often needed to convey policies and handle official business. In order to ensure that work is carried out correctly and efficiently, there are certain requirements for the standardization of official document formats.

[0003] In order to meet the requirements of official document typesetting, WPS (Word Processing System) has launched an official document typesetting method. Documents generated based on the official document typesetting method are referred to as official documents in this article. During the circulation process of official documents, after opening them using the ordinary document mode of WPS or other application software (such as Microsoft Word), there may be a large degree of misalignment (that is, the typesetting effect of the opened document is very different from that of the official document). The existence of this situation limits the circulation scope of official documents and cannot meet the circulation needs of official documents. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present invention provides a document conversion method, device, electronic device and storage medium to increase the circulation scope of official documents and meet the circulation needs of official documents.

[0005] According to a first aspect of an embodiment of the present invention, there is provided a document conversion method, comprising:

[0006] Using a target typesetting method to typeset the content of a first document with a set typesetting method, to obtain a second document; the target typesetting method is different from the set typesetting method;

[0007] According to the format conversion rule, the second document is formatted to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method;

[0008] The target document is output.

[0009] According to a second aspect of an embodiment of the present invention, there is provided a document conversion device, comprising:

[0010] A typesetting module, used to typeset the content of the first document with a set typesetting mode by using a target typesetting mode to obtain a second document; the target typesetting mode is different from the set typesetting mode;

[0011] An adjustment module, configured to adjust the format of the second document according to a format conversion rule to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method;

[0012] An output module is used to output the target document.

[0013] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0014] In an embodiment of the present invention, a second document is obtained by typeseting the content of a first document of a set typesetting mode by adopting a target typesetting mode, wherein the target typesetting mode is different from the set typesetting mode, and the second document is formatted according to a format conversion rule to obtain a target document corresponding to the first document, wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting mode and the target typesetting mode, and the target document is outputted, and reformatted and formatted using different typesetting modes, so that the first document can be automatically converted into a target document having a typesetting effect close to that of the first document but a typesetting mode different from that of the first document, thereby expanding the circulation range of the first document.

[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0017] Figure 1 It is an example flowchart of the document conversion method provided by an embodiment of the present invention.

[0018] Figure 2 It is a functional block diagram of a document conversion device provided by an embodiment of the present invention.

[0019] Figure 3 It is a hardware structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the appended claims.

[0021] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments of the present invention, and are not intended to limit the embodiments of the present invention. The singular forms of "a", "said" and "the" used in the embodiments of the present invention 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.

[0022] It should be understood that although the terms first, second, third, etc. may be used to describe various information in embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0023] Official document is a document that complies with the official document format prescribed by national standards. The national standards stipulate the layout rules of each official document format element in the official document. Among them, the official document format elements may include: the title, the issuing agency logo, the main sending agency, the official document body and the issuing number. Official document documents can be generated by office software with official document typesetting function.

[0024] In one embodiment, the official document can be generated based on WPS. For example, WPS has a function module "official document". When the function module is run, the official document mode is entered, and the official document can be generated or opened here. The function module can be integrated into WPS, or it can be used as a plug-in of WPS, or it can exist as an independent application. Official document is different from ordinary document (ordinary document in this article refers to the document generated in the non-official document mode of WPS application, that is, ordinary WPS document, or documents of other applications such as word documents). It has different format attributes and rendering methods from ordinary documents. In the official document mode, it can be typeset according to the format attributes and rendering methods of the official document, so as to present the typesetting effect of the official document. This typesetting method is referred to as the official document typesetting method in this article. The official document typesetting method corresponds to the format attributes and rendering method of the official document. Among them, the format attributes may include the page attributes, font attributes, paragraph attributes, etc. of the document. The rendering method refers to the method of drawing the target object based on the format attributes of the target object in the document so that the target object presents the corresponding display effect.

[0025] The layout of ordinary documents is different from that of official documents. When an official document is opened in ordinary document mode, the layout code corresponding to ordinary documents cannot interpret the format attributes and rendering methods of the official document. Instead, the official document is typeset according to the format attributes and rendering methods corresponding to ordinary documents. Therefore, the layout effect is different from that in the official document mode, causing serious layout deviation.

[0026] To open official documents normally on the terminal, it is necessary not only to install office applications that match official documents on the terminal, such as WPS applications, but also to further install the "official document" function module in the WPS application. If you directly open an official document in a WPS application that does not have the "official document" function module installed or in other office applications that are compatible with the WPS application (such as Microsoft Word), the page will be out of view.

[0027] In actual applications, official documents usually need to be sent to multiple recipients, and the office applications installed on the terminals of each recipient are not the same. Some terminals may have the WPS application installed but not the "official document" function module installed, while other terminals may not have the WPS application installed but other office applications such as Microsoft Word installed. In this way, due to the limitations of the document operating environment, the recipients corresponding to the terminals cannot open the official documents normally, which limits the circulation of official documents.

[0028] In order to solve the above problems, an embodiment of the present invention provides a document conversion method. In practical applications, the document conversion method provided by the embodiment of the present invention can be used as a plug-in function, and the corresponding plug-in can be installed in the aforementioned official document mode, that is, as a plug-in in the aforementioned "official document" function module. The plug-in name corresponding to the document conversion method provided by the embodiment of the present invention can be set to "official document to ordinary" for example, so that the official document can be converted into an ordinary document, so that in office applications that do not have an official document typesetting method installed, the typesetting effect of the official document can also be presented through an ordinary document.

[0029] The document conversion method of the present invention is described in detail below through embodiments.

[0030] Figure 1 FIG. 1 is a flowchart of a document conversion method provided by an embodiment of the present invention. Figure 1 As shown, in this embodiment, the document conversion method may include:

[0031] S101, typeset the content of a first document with a set typesetting method using a target typesetting method to obtain a second document; the target typesetting method is different from the set typesetting method.

[0032] S102, adjusting the format of the second document according to a format conversion rule to obtain a target document corresponding to the first document; wherein the format conversion rule is determined based on the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method.

[0033] S103: output the target document.

[0034] The first document may be the aforementioned official document, i.e., an official document generated based on office software with an official document typesetting function, such as WPS with an "official document" function module installed. The set typesetting method may be the aforementioned official document typesetting method. The second document and the target document may be ordinary documents generated based on WPS, or the second document and the target document may be word documents.

[0035] In this embodiment, the target typesetting mode is different from the set typesetting mode. The target typesetting mode may be, for example, the typesetting mode corresponding to the aforementioned common document.

[0036] In this embodiment, the second document may be the first document itself or a copy thereof. In other words, the second document is the first document typeset using the target typesetting method.

[0037] Exemplarily, step S101 can be completed by an API (Application Programming Interface), that is, the API typesets the content of the copied first document, that is, the second document, according to the target typesetting method. The purpose of copying is to adjust the format based on the second document to generate the target document without causing data loss in the original first document.

[0038] For example, assuming that document 1 is an official document, the API can typeset the content of document 1 according to the typesetting method corresponding to an ordinary document to obtain the document. In one example, document 1 and document 2 can be word documents.

[0039] It should be noted that typesetting a document using the target typesetting method can be considered as opening the document using office software with the target typesetting method; typesetting a document using the set typesetting method can be considered as opening the document using office software with the set typesetting method.

[0040] Since the second document and the first document use different typeset methods, although the content of the second document is the same as that of the first document, the typesetter effect of the second document is different from that of the first document. Thus, the visual impression of the user when reading the second document is very different from that when reading the first document.

[0041] Therefore, in this embodiment, the second document is formatted to obtain a layout effect close to that of the first document. In this embodiment, the target document is a common document after formatting is adjusted, and the target document has a layout effect close to that of the first document.

[0042] In this embodiment, the format adjustment of the second document is automatically completed according to the format conversion rule.

[0043] Among them, the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting mode and the target typesetting mode. The format conversion rule corresponds to "set typesetting mode and target typesetting mode". In the case of format attribute differences, the format attribute difference refers to the different format attributes between the set typesetting mode and the target typesetting mode. The different format attributes in the set typesetting mode and the target typesetting mode will cause different typesetting effects for the same object. In order to make the typesetting effects of the same object in these two typesetting modes the same or tend to be the same, the corresponding format conversion rule can be set. This type of format conversion rule is related to the format attribute and is mainly used to convert the format attribute to eliminate the format attribute difference. In the case of rendering method differences, the set typesetting mode and the target typesetting mode may also have different rendering methods for the same format attribute, resulting in different typesetting effects for the same object with the same format attribute. In order to make the typesetting effects of the same object with the same format attribute in these two typesetting modes the same or tend to be the same, the corresponding format conversion rule can also be set. This type of format conversion rule is related to the rendering method and is mainly used to convert the value of the format attribute to eliminate the rendering method difference. It is understandable that after eliminating the differences in format attributes and / or rendering methods, it can be considered that the rendering effect of the target document is consistent with the rendering effect of the first document.

[0044] It should be noted that, in this embodiment, the rendering effect being consistent refers to the rendering effects being the same or tending to be the same. The rendering effects tending to be the same refers to the situation where the difference between the rendering effects of the two seen by the viewer is very small and can be ignored.

[0045] In one example, adjusting the format of the second document according to the format conversion rule may include:

[0046] A first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode is converted into a second format attribute that exists in the target typesetting mode.

[0047] Since the first format attribute does not exist in the target typesetting mode, the object cannot be drawn according to the first format attribute when typeset in the target typesetting mode, and thus the same typesetting effect as the first document cannot be achieved. In this embodiment, by converting the first format attribute into the second format attribute, the object with the first format attribute in the set typesetting mode can be drawn in the target document according to the second format attribute in the target typesetting mode, thereby achieving the same typesetting effect as the first document. The second format attribute is a format attribute that exists in the target typesetting mode and has a typesetting effect similar to that of the first format attribute.

[0048] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0049] Acquire a first distance between a target object in the first document and an upper page margin or a lower page margin;

[0050] A vertical position of the target object in the second document is determined according to the first distance.

[0051] The format conversion rule in this embodiment is a conversion rule for object position layout.

[0052] The target object may be text, pictures, tables, etc.

[0053] Wherein, determining the vertical position of the target object in the second document according to the first distance may be:

[0054] If the first distance is the distance between the target object and the upper page margin, determining in the second document a position at which the distance from the upper page margin is equal to the first distance as the vertical position of the target object in the second document;

[0055] If the first distance is the distance between the target object and the bottom page margin, a position in the second document whose distance from the bottom page margin is equal to the first distance is determined as the vertical position of the target object in the second document.

[0056] In the first document, the first distance = the distance between the target object and the first paragraph of the page where the target object is located + the line height × the number of lines of the first paragraph of the page where the target object is located.

[0057] The vertical layout of objects in official documents is relative to paragraphs. This embodiment converts the vertical layout of objects relative to paragraphs into the vertical layout of objects relative to page margins. There are differences in the attributes of paragraphs in official documents and ordinary documents, such as paragraph spacing and line spacing (such as single line spacing, multiple line spacing, etc.). If the target object in the second document (ordinary document) is still in the vertical layout mode relative to the paragraph in the first document (official document), it is easy to cause the layout to run out of place.

[0058] After an official document is converted into an ordinary document such as a WPS document or a Word document, the paragraph position changes, but the page margin position does not change. Therefore, the vertical layout of objects relative to the page margins can make the target objects have the same position in the document before and after the conversion.

[0059] For example, suppose that the vertical position of paragraph A in document 1 (official document) is a, and the vertical position of paragraph B is b. In document 2 obtained after the content of document 1 is typeset according to the typesetting method corresponding to the word document, the vertical position of paragraph A is no longer a. At this time, if the vertical position of paragraph B is still determined relative to paragraph A, the vertical position of paragraph B is no longer b, and the phenomenon of running out of layout occurs. According to this embodiment, when determining the vertical position of paragraph B, the vertical position of paragraph B is not referred to the vertical position of paragraph A, but the distance between paragraph B and the upper page margin or the lower page margin in document 1 is referred to to set the vertical position of paragraph B in document 2. In this way, the vertical position of paragraph B in document 2 is the same as the vertical position of paragraph B in document 1, which ensures the consistency of the vertical position of the paragraphs in the document before and after the conversion in terms of typesetting effect.

[0060] For each paragraph, picture or table in document 1, the vertical position in document 2 can be determined in the same way as paragraph B. In this way, the vertical positions of all paragraphs, pictures and tables in the documents before and after the conversion are kept consistent.

[0061] In an example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode may include:

[0062] Obtaining a ratio of a character height to a character width in a horizontal font size in the first document;

[0063] According to the ratio, a font scaling ratio corresponding to the horizontal font size in the second document is determined.

[0064] The format conversion rule in this embodiment is a conversion rule for horizontal font size.

[0065] The horizontal font size is a format attribute unique to official documents. Ordinary documents do not have a format attribute for horizontal font size. The font size in ordinary documents actually corresponds to the vertical font size, and it can be considered that the horizontal font size and the vertical font size in ordinary documents are in a 1:1 scaling ratio, that is, the horizontal font size is equal to the vertical font size. This embodiment presents the same typesetting effect as the horizontal font size in the first document in the second document by adjusting the font scaling ratio in the second document. Among them, the method of using the font scaling ratio to adjust the font in an ordinary document is to keep the font height unchanged, and scale the font width according to the font scaling ratio.

[0066] Take the conversion of an official document to a word document as an example. Assuming that the ratio of the height to the width of the horizontal font size in the official document is 2:1, in the converted word document, while keeping the vertical font size unchanged, by setting the font scaling ratio to 50%, that is, the vertical font remains unchanged and the horizontal font is reduced by 50%, the ratio of the height to the width of the font in the converted word document can also be 2:1, which can achieve the same display effect as the horizontal font size of the official document.

[0067] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0068] Determine a first value according to the height and number of lines of the target paragraph in the first document;

[0069] Setting the paragraph spacing of the target paragraph in the second document to a fixed value line spacing;

[0070] The fixed value line spacing corresponding to the target paragraph is set to the first value.

[0071] The format conversion rule in this embodiment is a conversion rule for segment spacing.

[0072] The first value = the height of the target paragraph ÷ the number of lines in the target paragraph.

[0073] For example, assuming that the height of a paragraph in an official document is 45 pounds and the number of lines is 9, in the converted Word document, the paragraph spacing can be set to a fixed line spacing, and the fixed line spacing value can be set to 5 pounds.

[0074] This embodiment sets the paragraph spacing of the target paragraph in the second document to a fixed line spacing, and sets the fixed line spacing value equal to the first value, so that the height occupied by the target paragraph in the second document is equal to the height occupied by the target paragraph in the first document, so that the target document and the first document have the same typesetting effect in terms of the height occupied by the paragraph.

[0075] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0076] Searching for a backup font corresponding to the official text font in the first document from a preset correspondence table between official text fonts and backup fonts; the official text font is a font that exists in the set typesetting mode and does not exist in the target typesetting mode; the backup font is a font that exists in the target typesetting mode;

[0077] In the second document, the font of the text in the official font is set to a corresponding backup font.

[0078] The format conversion rule in this embodiment is a rule for font replacement.

[0079] Some special fonts are used in official documents, which are called official fonts in this article. These special fonts are loaded by the above-mentioned "official document" function module, that is, these fonts are available in the WPS application that has the above-mentioned "official document" function module installed. WPS applications or Word that do not have the above-mentioned "official document" plug-in installed may not have such special fonts, so the font cannot be set to be exactly the same as the official document font when drawing.

[0080] In order to make the fonts in the common documents after the official document is converted closer to the visual effect of the official document fonts of the official document, in this embodiment, the common font closest to the visual effect of each official document font is found in the application of the common document, and is stored in the correspondence table between the official fonts and the backup fonts as the backup font corresponding to the official font. When typesetting the text of the official font in the converted common document, the backup font corresponding to the official font is used to draw the text of the official font. In this way, the typesetting effect of the common document after the official document is converted is closer to the typesetting effect of the official document, reducing the visual difference between the two documents before and after the conversion for the user.

[0081] Among them, the correspondence table between official text fonts and backup fonts can be shown in Table 1.

[0082] Table 1

[0083]

[0084]

[0085] In another example, adjusting the format of the second document according to the format conversion rule may include:

[0086] Change the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is the same as that of the target object in the first document.

[0087] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is the same as that of the target object in the first document may include:

[0088] In the second document, set the number corresponding to the automatic numbering in the first document as a manual number;

[0089] Set the font of the sentence where the number is located to the actual drawing font.

[0090] During the rendering process of an official document, the drawing font attribute effect of the automatic numbering follows the first character after the number. During the rendering process of a general document, the drawing font attribute effect of the automatic numbering follows the paragraph return character attribute.

[0091] In an official document, the following scenario often appears: "1. This is bold. This is Song typeface." (indicating that the font of "1." is bold and the return character attribute after "1." is Song typeface). At this time, "1." is drawn as bold in the official document, but its own attribute may not be bold. It is only forced to be rendered as the same font as the number during rendering, that is, consistent with the number "1" in bold.

[0092] When converting an official document to a general document, if the number is directly converted to the number in the general document and remains an automatic number, then "1." will follow the paragraph end return character attribute and become Song typeface in the general document, and the display effect is inconsistent with that of the official document. Therefore, the number needs to be converted from an automatic number to a manual number.

[0093] After converting to a manual number, the number will be displayed according to its own attribute in the general document, which may lead to an inconsistent display effect with the official document (because the actual drawing font of the number in the official document may be different from the set font of the number). Therefore, in the general document, the font of the sentence where the number is located needs to be set to the actual drawing font.

[0094] For item numbers, this embodiment does not perform conversion. In the general document converted from the official document, the item label still remains an automatic number.

[0095] This embodiment makes the typesetting effect of the numbers in the document before and after conversion closer, and can give the user a very similar visual impression.

[0096] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is the same as that of the target object in the first document includes:

[0097] For a designated character, determining a drawing font corresponding to the designated character in the set typesetting mode as a first font; the designated character is a character that is forcibly drawn as a fixed font in the set typesetting mode;

[0098] In the font attribute setting of the second document, the font attribute of the designated character is set to the first font.

[0099] The format conversion rule in this embodiment is a rule for font replacement.

[0100] The specified characters can be Chinese, numbers, English, symbols, percent signs, etc.

[0101] In official documents, the fonts of numbers, English, symbols, percent signs, etc. are fixed. When drawing these characters in official documents, they are forced to be drawn in the corresponding fixed fonts, ignoring the font attributes.

[0102] For example, in official document writing, if the font attributes of numbers are set to Microsoft YaHei, the actual font attributes of the numbers drawn are still Founder ShuSong. After conversion to a normal document, if the font replacement is not done, the numbers will be drawn as Microsoft YaHei according to the set font attributes, which is inconsistent with the effect of being drawn as Founder ShuSong in the official document.

[0103] When converting official documents to ordinary documents, the font replacement method for each specified character can be as follows:

[0104] Chinese: Chinese fonts do not need to be replaced;

[0105] Numbers: replace the number font with a drawing font (e.g. Founder Song_GBK);

[0106] English: English fonts are replaced with drawing fonts (e.g. Founder Song_GBK);

[0107] Symbols (except percent sign): Symbol font is replaced with Fangzheng Fangsong_GBK;

[0108] Percent sign: The percent sign font is replaced with Times new roman.

[0109] This embodiment ensures the consistency of fonts in the target document and the first document, so that the two documents have the same typesetting effect in terms of fonts.

[0110] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0111] Obtaining a target actual drawing value corresponding to a target text in the first document;

[0112] Determining a target font size corresponding to the target actual drawing value according to a preset mapping relationship between the actual drawing value and the font size;

[0113] In the second document, the font size of the target text is set to the target font size.

[0114] The format conversion rule in this embodiment is a conversion rule for font size.

[0115] One way of rendering official documents is that the actual font size in the official document is different from the set font size. For example, in an official document, the set font size of the text in paragraph C is 5, but the font size of the text in paragraph C that is actually drawn is 4.5, that is, the actual font size of the text in paragraph C in the official document is 4.5; the set font size of the text in paragraph D is 8, but the font size of the text in paragraph D that is actually drawn is 7.7, that is, the actual font size of the text in paragraph D in the official document is 7.7.

[0116] However, the actual drawing font size in a normal document is the same as the set font size.

[0117] In this way, if the font size of the corresponding text in the ordinary document is set directly according to the font size set in the official document, the drawn font size in the ordinary document will be larger than the drawn font size in the official document, resulting in differences in typesetting effects.

[0118] In this embodiment, a preset mapping relationship between actual drawing value and font size is utilized to determine the font size of the target text in the second document according to the actual drawing value of the target text in the first document, so that the size of the target text before and after the document conversion can be as close as possible, thereby ensuring that the typesetting effects of the two documents before and after the conversion are closer in terms of font size.

[0119] The mapping relationship between the actual drawing value and the font size may be: n.0-n.2 is mapped to n.0, n.3-n.7 is mapped to n.5, and n.8-n.9 is mapped to n+1.0, where n may be any natural number.

[0120] For example, if the actual drawing value of a certain text in the first document is 14.1 pounds, the font size of the text is set to 14 points in the second document; if the actual drawing value of a certain text in the first document is 14.7 points, the font size of the text is set to 14.5 points in the second document; if the actual drawing value of a certain text in the first document is 14.8 points, the font size of the text is set to 15 points in the second document.

[0121] In the above embodiment, due to the difference between the font size in the second document and the actual drawing value of the characters in the first document, the number of characters in the same line will be unequal when the character spacing is the same, resulting in different typesetting effects. In order to make the number of characters in the same line in the documents before and after the conversion equal, the following embodiment can be used to adjust the character spacing of the second document.

[0122] In one example, after setting the font size of the target text to the target font size in the second document, the method may further include:

[0123] Determine a character spacing difference according to the character spacing in the first document and the character spacing in the second document;

[0124] The word spacing value in the second document is adjusted according to the original word spacing value in the second document and the word spacing difference value.

[0125] The format conversion rule in this embodiment is a conversion rule for character spacing.

[0126] This embodiment makes the number of characters in each line of the target document equal to the number of characters in each line of the first document.

[0127] Taking the conversion of an official document into an ordinary word document as an example, the character spacing in the ordinary word document = the original character spacing value in the ordinary word document + (official document character width - ordinary word document character width).

[0128] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0129] For a first set symbol in half-width format in the first document, set it in full-width format in the second document;

[0130] The second set symbol that is in full-width format in the first document is set in half-width format in the second document.

[0131] The format conversion rule in this embodiment is a conversion rule for full-width and half-width symbols.

[0132] The format attributes of the full-width and half-width of symbols in official documents and ordinary documents are somewhat different. Some symbols that are usually set to full-width in ordinary documents are set to half-width in official documents. Similarly, some symbols that are usually set to half-width in ordinary documents are set to full-width in official documents. Therefore, in order to make the layout effect of the ordinary document after the official document is converted closer to the layout effect of the official document, this embodiment forces the full-width and half-width of the symbols in the ordinary document after the conversion to be consistent with the full-width and half-width of the official document through format adjustment.

[0133] In this embodiment, the first setting symbol and the second setting symbol can be preset and saved.

[0134] Among them, when the first document is an official document and the second document is an ordinary document, the first set symbols may include: comma, semicolon, colon, question mark, exclamation mark, connector, brackets, double quotes, bitwise operators, curly brackets, fishtail, single quotes, pound sign, and symbol, plus sign, equal sign, less than, greater than, dollar currency symbol, percent sign; the second set symbols may include: separator, decimal point, underscore, backslash.

[0135] In this embodiment, the output target document may be in a ".doc" format or a ".docx" format.

[0136] The document conversion method provided by the embodiment of the present invention typesets the content of a first document with a set typesetting method by adopting a target typesetting method to obtain a second document, wherein the target typesetting method is different from the set typesetting method, and the second document is formatted according to a format conversion rule to obtain a target document corresponding to the first document, wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method, and the target document is output. After being reformatted and formatted using different typesetting methods, the first document can be automatically converted into a target document having a typesetting effect close to that of the first document but a typesetting method different from that of the first document, thereby expanding the circulation range of the first document.

[0137] By converting official documents using the embodiments of the present invention, it is possible to automatically obtain ordinary documents that are very close to the typeset effect of official documents, so that official documents can be circulated in the form of ordinary documents, freeing themselves from the restrictions on the document operating environment, increasing the circulation scope of official documents, and meeting the circulation needs of official documents.

[0138] Based on the above method embodiments, the embodiments of the present invention also provide corresponding device, equipment and storage medium embodiments.

[0139] Figure 2 is a functional block diagram of a document conversion device provided by an embodiment of the present invention. Figure 2 As shown, in this embodiment, the document conversion device may include:

[0140] A typesetting module 210, configured to typeset the content of the first document in a set typesetting mode using a target typesetting mode to obtain a second document; the target typesetting mode is different from the set typesetting mode;

[0141] An adjustment module 220 is used to adjust the format of the second document according to a format conversion rule to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method;

[0142] The output module 230 is used to output the target document.

[0143] In one example, the adjustment module 220 may be specifically configured to:

[0144] A first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode is converted into a second format attribute that exists in the target typesetting mode.

[0145] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0146] Acquire a first distance between a target object in the first document and an upper page margin or a lower page margin;

[0147] A vertical position of the target object in the second document is determined according to the first distance.

[0148] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0149] Obtaining a ratio of a character height to a character width in a horizontal font size in the first document;

[0150] According to the ratio, a font scaling ratio corresponding to the horizontal font size in the second document is determined.

[0151] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0152] Determine a first value according to the height and number of lines of the target paragraph in the first document;

[0153] Setting the paragraph spacing of the target paragraph in the second document to a fixed value line spacing;

[0154] The fixed value line spacing corresponding to the target paragraph is set to the first value.

[0155] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0156] Searching for a backup font corresponding to the official text font in the first document from a preset correspondence table between official text fonts and backup fonts; the official text font is a font that exists in the set typesetting mode and does not exist in the target typesetting mode; the backup font is a font that exists in the target typesetting mode;

[0157] In the second document, the font of the text in the official font is set to a corresponding backup font.

[0158] In one example, the adjustment module 220 may be specifically configured to:

[0159] The attribute value of the target object in the second document is changed so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document.

[0160] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0161] In the second document, setting the numbers corresponding to the automatic numbers in the first document as manual numbers;

[0162] The font of the sentence where the number is located is set to the actual drawing font.

[0163] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0164] For a designated character, determining a drawing font corresponding to the designated character in the set typesetting mode as a first font; the designated character is a character that is forcibly drawn as a fixed font in the set typesetting mode;

[0165] In the font attribute setting of the second document, the font attribute of the designated character is set to the first font.

[0166] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0167] Obtaining a target actual drawing value corresponding to a target text in the first document;

[0168] Determining a target font size corresponding to the target actual drawing value according to a preset mapping relationship between the actual drawing value and the font size;

[0169] In the second document, the font size of the target text is set to the target font size.

[0170] In one example, after setting the font size of the target text to the target font size in the second document, the method further includes:

[0171] Determine a character spacing difference according to the character spacing in the first document and the character spacing in the second document;

[0172] The word spacing value in the second document is adjusted according to the original word spacing value in the second document and the word spacing difference value.

[0173] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0174] For a first set symbol in half-width format in the first document, set it in full-width format in the second document;

[0175] The second set symbol that is in full-width format in the first document is set in half-width format in the second document.

[0176] An embodiment of the present invention further provides an electronic device. Figure 3 FIG. 1 is a hardware structure diagram of an electronic device provided by an embodiment of the present invention. Figure 3 As shown, the electronic device includes: an internal bus 301, and a memory 302, a processor 303 and an external interface 304 connected through the internal bus, wherein;

[0177] The memory 302 is used to store machine-readable instructions corresponding to the document conversion logic;

[0178] The processor 303 is configured to read the machine-readable instructions on the memory 302 and execute the instructions to implement the following operations:

[0179] Using a target typesetting method to typeset the content of a first document with a set typesetting method, to obtain a second document; the target typesetting method is different from the set typesetting method;

[0180] According to the format conversion rule, the second document is formatted to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method;

[0181] The target document is output.

[0182] In one example, adjusting the format of the second document according to the format conversion rule includes:

[0183] A first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode is converted into a second format attribute that exists in the target typesetting mode.

[0184] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0185] Acquire a first distance between a target object in the first document and an upper page margin or a lower page margin;

[0186] A vertical position of the target object in the second document is determined according to the first distance.

[0187] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0188] Obtaining a ratio of a character height to a character width in a horizontal font size in the first document;

[0189] According to the ratio, a font scaling ratio corresponding to the horizontal font size in the second document is determined.

[0190] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0191] Determine a first value according to the height and number of lines of the target paragraph in the first document;

[0192] Setting the paragraph spacing of the target paragraph in the second document to a fixed value line spacing;

[0193] The fixed value line spacing corresponding to the target paragraph is set to the first value.

[0194] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0195] Searching for a backup font corresponding to the official text font in the first document from a preset correspondence table between official text fonts and backup fonts; the official text font is a font that exists in the set typesetting mode and does not exist in the target typesetting mode; the backup font is a font that exists in the target typesetting mode;

[0196] In the second document, the font of the text in the official font is set to a corresponding backup font.

[0197] In one example, adjusting the format of the second document according to the format conversion rule includes:

[0198] The attribute value of the target object in the second document is changed so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document.

[0199] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0200] In the second document, setting the numbers corresponding to the automatic numbers in the first document as manual numbers;

[0201] Set the font of the sentence where the number is located to the actual drawing font.

[0202] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0203] For a designated character, determining a drawing font corresponding to the designated character in the set typesetting mode as a first font; the designated character is a character that is forcibly drawn as a fixed font in the set typesetting mode;

[0204] In the font attribute setting of the second document, the font attribute of the designated character is set to the first font.

[0205] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0206] Obtaining a target actual drawing value corresponding to a target text in the first document;

[0207] Determining a target font size corresponding to the target actual drawing value according to a preset mapping relationship between the actual drawing value and the font size;

[0208] In the second document, the font size of the target text is set to the target font size.

[0209] In one example, after setting the font size of the target text to the target font size in the second document, the method further includes:

[0210] Determine a character spacing difference according to the character spacing in the first document and the character spacing in the second document;

[0211] The word spacing value in the second document is adjusted according to the original word spacing value in the second document and the word spacing difference value.

[0212] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0213] For a first set symbol in half-width format in the first document, set it in full-width format in the second document;

[0214] The second set symbol that is in full-width format in the first document is set in half-width format in the second document.

[0215] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein when the program is executed by a processor, the following operations are implemented:

[0216] Using a target typesetting method to typeset the content of a first document with a set typesetting method, to obtain a second document; the target typesetting method is different from the set typesetting method;

[0217] According to the format conversion rule, the second document is formatted to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method;

[0218] The target document is output.

[0219] In one example, adjusting the format of the second document according to the format conversion rule includes:

[0220] A first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode is converted into a second format attribute that exists in the target typesetting mode.

[0221] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0222] Acquire a first distance between a target object in the first document and an upper page margin or a lower page margin;

[0223] A vertical position of the target object in the second document is determined according to the first distance.

[0224] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0225] Obtaining a ratio of a character height to a character width in a horizontal font size in the first document;

[0226] According to the ratio, a font scaling ratio corresponding to the horizontal font size in the second document is determined.

[0227] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0228] Determine a first value according to the height and number of lines of the target paragraph in the first document;

[0229] Setting the paragraph spacing of the target paragraph in the second document to a fixed value line spacing;

[0230] The fixed value line spacing corresponding to the target paragraph is set to the first value.

[0231] In one example, converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes:

[0232] Searching for a backup font corresponding to the official text font in the first document from a preset correspondence table between official text fonts and backup fonts; the official text font is a font that exists in the set typesetting mode and does not exist in the target typesetting mode; the backup font is a font that exists in the target typesetting mode;

[0233] In the second document, the font of the text in the official font is set to a corresponding backup font.

[0234] In one example, adjusting the format of the second document according to the format conversion rule includes:

[0235] The attribute value of the target object in the second document is changed so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document.

[0236] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0237] In the second document, setting the numbers corresponding to the automatic numbers in the first document as manual numbers;

[0238] Set the font of the sentence where the number is located to the actual drawing font.

[0239] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0240] For a designated character, determining a drawing font corresponding to the designated character in the set typesetting mode as a first font; the designated character is a character that is forcibly drawn as a fixed font in the set typesetting mode;

[0241] In the font attribute setting of the second document, the font attribute of the designated character is set to the first font.

[0242] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0243] Obtaining a target actual drawing value corresponding to a target text in the first document;

[0244] Determining a target font size corresponding to the target actual drawing value according to a preset mapping relationship between the actual drawing value and the font size;

[0245] In the second document, the font size of the target text is set to the target font size.

[0246] In one example, after setting the font size of the target text to the target font size in the second document, the method further includes:

[0247] Determine a character spacing difference according to the character spacing in the first document and the character spacing in the second document;

[0248] The word spacing value in the second document is adjusted according to the original word spacing value in the second document and the word spacing difference value.

[0249] In one example, changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document includes:

[0250] For a first set symbol in half-width format in the first document, set it in full-width format in the second document;

[0251] The second set symbol that is in full-width format in the first document is set in half-width format in the second document.

[0252] For the device and equipment embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0253] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0254] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.

[0255] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0256] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A document conversion method, characterized in that: include: Using the target typesetting method to typeset the content of the first document with the set typesetting method, to obtain a second document; The target typesetting mode is different from the set typesetting mode; The method of using the target typesetting method to typeset the content of the first document with the set typesetting method comprises: using office software with the target typesetting method to open the content of the first document with the set typesetting method; the first document is generated based on the office software with the set typesetting method; and the typesetting effect of the first document is different from the typesetting effect of the second document; According to the format conversion rule, the format of the second document is adjusted to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method; the typesetting effect of the target document is the same as or tends to be the same as the typesetting effect of the first document; the format attribute difference refers to that the set typesetting method and the target typesetting method have different format attributes, and there are format attributes in the set typesetting method that do not exist in the target typesetting method. In the case of the existence of the format attribute difference, the format conversion rule is used to convert the format attribute; the rendering method difference refers to that the set typesetting method and the target typesetting method have different rendering methods for the same format attribute. In the case of the existence of the rendering method difference, the format conversion rule is used to convert the value of the format attribute; The target document is output.

2. The method according to claim 1, characterized in that According to the format conversion rule, the format of the second document is adjusted, including: A first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode is converted into a second format attribute that exists in the target typesetting mode.

3. The method according to claim 2, characterized in that The document of the set typesetting mode is an official document, and the document of the target typesetting mode is an ordinary document, and converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes: In a case where the first format attribute includes different attributes for paragraphs in the official document and the ordinary document, obtaining a first distance between a target object in the first document and an upper page margin or a lower page margin; A vertical position of the target object in the second document is determined according to the first distance.

4. The method according to claim 2, characterized in that: Converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes: Obtaining a ratio of a character height to a character width in a horizontal font size in the first document; According to the ratio, a font scaling ratio corresponding to the horizontal font size in the second document is determined.

5. The method according to claim 2, characterized in that: Converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes: Determine a first value according to the height and number of lines of the target paragraph in the first document; Setting the paragraph spacing of the target paragraph in the second document to a fixed value line spacing; The fixed value line spacing corresponding to the target paragraph is set to the first value.

6. The method according to claim 2, characterized in that Converting a first format attribute that exists in the set typesetting mode and does not exist in the target typesetting mode into a second format attribute that exists in the target typesetting mode includes: Searching for a backup font corresponding to the official text font in the first document from a preset correspondence table between official text fonts and backup fonts; the official text font is a font that exists in the set typesetting mode and does not exist in the target typesetting mode; the backup font is a font that exists in the target typesetting mode; In the second document, the font of the text in the official font is set to a corresponding backup font.

7. The method according to claim 1, characterized in that According to the format conversion rule, the format of the second document is adjusted, including: The attribute value of the target object in the second document is changed so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document.

8. The method according to claim 7, characterized in that Changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document, including: In the second document, setting the numbers corresponding to the automatic numbers in the first document as manual numbers; The font of the sentence where the number is located is set to the actual drawing font.

9. The method according to claim 7, characterized in that: Changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document, including: For a designated character, determining a drawing font corresponding to the designated character in the set typesetting mode as a first font; the designated character is a character drawn as a fixed font in the set typesetting mode; In the font attribute setting of the second document, the font attribute of the designated character is set to the first font.

10. The method according to claim 7, characterized in that Changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document, including: Obtaining a target actual drawing value corresponding to a target text in the first document; Determining a target font size corresponding to the target actual drawing value according to a preset mapping relationship between the actual drawing value and the font size; In the second document, the font size of the target text is set to the target font size.

11. The method according to claim 10, characterized in that After setting the font size of the target text to the target font size in the second document, the method further includes: Determine a character spacing difference according to the character spacing in the first document and the character spacing in the second document; The word spacing value in the second document is adjusted according to the original word spacing value in the second document and the word spacing difference value.

12. The method according to claim 7, characterized in that Changing the attribute value of the target object in the second document so that the rendering effect of the target object in the converted target document is consistent with the rendering effect of the target object in the first document, including: For a first set symbol in half-width format in the first document, set it in full-width format in the second document; The second set symbol that is in full-width format in the first document is set in half-width format in the second document.

13. A document conversion device, characterized in that: include: A typesetting module, used for typeset the content of the first document with a set typesetting mode by using a target typesetting mode to obtain a second document; The target typesetting mode is different from the set typesetting mode; The method of using the target typesetting method to typeset the content of the first document with the set typesetting method comprises: using office software with the target typesetting method to open the content of the first document with the set typesetting method; the first document is generated based on the office software with the set typesetting method; and the typesetting effect of the first document is different from the typesetting effect of the second document; An adjustment module, used for adjusting the format of the second document according to a format conversion rule to obtain a target document corresponding to the first document; wherein the format conversion rule is determined according to the difference in format attributes and rendering methods between the set typesetting method and the target typesetting method; the typesetting effect of the target document is the same as or tends to be the same as the typesetting effect of the first document; the format attribute difference refers to that the set typesetting method and the target typesetting method have different format attributes, and there are format attributes in the set typesetting method that do not exist in the target typesetting method. In the case of the existence of the format attribute difference, the format conversion rule is used to convert the format attribute; the rendering method difference refers to that the set typesetting method and the target typesetting method have different rendering methods for the same format attribute. In the case of the existence of the rendering method difference, the format conversion rule is used to convert the value of the format attribute; An output module is used to output the target document.

14. An electronic device, characterized in that: The invention comprises a processor and a memory for storing executable instructions of the processor, wherein the instructions are executed to implement the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: A computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.