CN112231607A - Document processing method, apparatus, electronic device and storage medium - Google Patents

Document processing method, apparatus, electronic device and storage medium Download PDF

Info

Publication number
CN112231607A
CN112231607A CN202011102406.2A CN202011102406A CN112231607A CN 112231607 A CN112231607 A CN 112231607A CN 202011102406 A CN202011102406 A CN 202011102406A CN 112231607 A CN112231607 A CN 112231607A
Authority
CN
China
Prior art keywords
display area
processed
characters
width
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011102406.2A
Other languages
Chinese (zh)
Other versions
CN112231607B (en
Inventor
校丽丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu China Co Ltd
Original Assignee
Baidu China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu China Co Ltd filed Critical Baidu China Co Ltd
Priority to CN202011102406.2A priority Critical patent/CN112231607B/en
Publication of CN112231607A publication Critical patent/CN112231607A/en
Application granted granted Critical
Publication of CN112231607B publication Critical patent/CN112231607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a document processing method and device, electronic equipment and a storage medium, and relates to the field of page display. The specific implementation scheme is as follows: determining the last row width of the display area based on the area width of the display area and the width of the hidden mark; under the condition that the display area is filled based on the target file, if unfilled characters exist in the target file, removing M characters filled in the last line of the display area; m is an integer greater than or equal to 1; based on the last line width of the display area, sequentially filling N characters in the M withdrawn characters to the last line of the display area; wherein N is an integer less than M.

Description

Document processing method, apparatus, electronic device and storage medium
Technical Field
The application relates to the technical field of computers, in particular to the field of page display.
Background
With the rapid development of internet technology, web pages become the main carrier for publishing information. The information on the web page includes documents, images, videos, and the like. Among them, the literature used to help users to understand information deeply often contains a lot of characters, occupying too much space on the page.
Based on this, in the related art, the document contents exceeding a certain display area in the web page are hidden. When the user selects to expand the file, the whole content of the file is expanded for the user to read.
Disclosure of Invention
The application provides a document processing method, a document processing device, electronic equipment and a storage medium.
According to an aspect of the present application, there is provided a document processing method including:
determining the last row width of the display area based on the area width of the display area and the width of the hidden mark;
under the condition that the display area is filled based on the target file, if unfilled characters exist in the target file, removing M characters filled in the last line of the display area; m is an integer greater than or equal to 1;
based on the last line width of the display area, sequentially filling N characters in the M withdrawn characters to the last line of the display area; wherein N is an integer less than M.
According to another aspect of the present application, there is provided a document processing apparatus comprising:
the first determining module is used for determining the last row width of the display area based on the area width of the display area and the width of the hidden mark;
the cancellation module is used for canceling M characters filled in the last line of the display area if unfilled characters exist in the target file under the condition that the display area is filled based on the target file; m is an integer greater than or equal to 1;
the first filling module is used for sequentially filling N characters in the M withdrawn characters to the last line of the display area based on the last line width of the display area; wherein N is an integer less than M.
According to another aspect of the present application, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods provided by the embodiments of the present application.
According to another aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method provided by embodiments of the present application.
According to the technical scheme of the application, the visual effect when partial contents of the file are hidden can be optimized.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic illustration of a document processing method according to one embodiment of the present application;
FIG. 2 is a schematic illustration of a document processing method according to another embodiment of the present application;
FIG. 3 is a schematic illustration of a paperwork display according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an example application according to the present application;
FIG. 5 is a schematic view of a document processing apparatus according to one embodiment of the present application;
FIG. 6 is a schematic view of a document processing apparatus according to another embodiment of the present application;
fig. 7 is a block diagram of an electronic device for implementing the document processing method according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 shows a schematic diagram of a document processing method according to one embodiment of the present application. As shown in fig. 1, the method may include:
step S11, determining the last line width of the display area based on the area width of the display area and the width of the hidden mark;
step S12, in the case where the display area is completely filled based on the target document, if there are unfilled characters in the target document, canceling the M characters filled in the last line of the display area; m is an integer greater than or equal to 1;
step S13, based on the last line width of the display area, filling N characters in the M characters which are withdrawn to the last line of the display area in sequence; wherein N is an integer less than M.
In the embodiment of the present application, the display area may include an area for displaying a document on a web page, for example, a H5(Hyper Text Markup Language 5, fifth generation hypertext Markup Language) page. The display area has one or more attributes of area width, area height, number of lines of displayable characters, height of each line, width of last line, and the like. The last row width may refer to a width that can be used for displaying the document in the last row or the last row in the display area when the partial document is hidden.
The hidden identifier is used for prompting the user of the hidden part of the file in the display area. For example, the hidden flag may refer to a character string or icon button containing "expand/hide", "expand full text", "hide full text", "collapse display", or the like.
Illustratively, the hidden flag may be set to the last line, i.e., the last line, in the display area. The width of the last line of the file is determined based on the area width of the display area and the width of the hidden mark, so that the display effect can be prevented from being influenced by the last line of the file and the hidden mark. For example, the width of the last line may be set to be smaller than or equal to the difference between the area width of the display area and the width of the hidden mark so that the hidden mark and the document do not overlap each other.
As an example, when the web page is open, the display area may display the paperwork therein based on the preconfigured area width and area height. In the case where all the documents can be displayed based on the area width and the area height, the hidden mark may not be provided, and the display area may always be displayed based on the area height and the area height which are previously configured. And in the case that the whole file cannot be displayed based on the area width and the area height, displaying a part of the file based on the area width and the area height, hiding the rest of the file, and displaying the hidden mark. And if the user clicks the hidden mark, expanding the display area and displaying all the files.
In the embodiment of the application, for a document to be displayed, that is, a target document, the document is first filled into the display area, for example, the target document is filled into the display area one by one, or the target document is filled into the display area by using a dichotomy. In practical application, the display area is filled up, and characters in the target document are not filled up in the display area. According to an embodiment of the application, M characters in the last line may be revoked. After the M characters are withdrawn, the characters are refilled into the display area, so that the total width of the characters in the last row is matched with the width of the last row.
Wherein the M characters may be all or part of the characters in the last line. For example, if M is a predetermined number, a predetermined number of characters are revoked. In particular implementations, M may be determined based on the difference between the last row width and the region width. For example, if the difference is 10mm, the widths of different characters are different, but each character is generally greater than 1mm, M may be determined to be 10, ensuring that the total width of the characters in the last row after the M characters are revoked is less than or equal to the width of the last row.
According to the embodiment of the application, the display area is filled, under the condition that the display area cannot display all characters of the target file, characters in the last line are withdrawn, and the characters are refilled to the last line based on the width of the last line, wherein the width of the last line is determined based on the area width and the hidden mark. Thus, a suitable display space may be left in the last row of the display area for displaying the hidden identifier. The dynamic filling mode can adapt to the widths of different characters and the resolutions of different terminal devices, and the visual effect is that the width of the character in the last line is matched with the width of the last line all the time. Meanwhile, the complete display of the characters can be ensured, and the display effects of the file and the hidden mark cannot be influenced mutually. Therefore, the embodiment of the application can optimize the visual effect when partial content of the file is hidden, and improve the experience and the retention time of a user.
In specific implementation, the characters in the document are filled in the display area, and a mode of filling one by one or a binary method can be adopted. For example, the dichotomy filling is adopted under the condition that the area width of the display area is larger and the number of characters capable of being accommodated in one line is larger; the filling-up is carried out one by one under the condition that the area width of the display area is smaller and the number of characters capable of being accommodated in one line is smaller.
Illustratively, the step S13, based on the width of the last line of the display area, sequentially filling N characters of the M characters being revoked into the last line of the display area includes:
under the condition that the total width of the characters in the last row is smaller than the width of the last row, filling the M characters into the last row one by one, and re-determining the total width of the characters in the last row based on the width of the characters filled each time;
and stopping filling the M characters into the last line one by one under the condition that the total width of the characters in the last line is determined to be larger than or equal to the width of the last line based on the width of the Nth character in the M characters.
Taking the width of the last line as 20mm as an example, when all characters in the last line are revoked, the total width of the characters in the last line is 0, the first character in the revoked characters is filled into the last line, and the total width of the characters in the last line is newly determined to be 3mm based on the width of the first character being 3 mm. Since the total width is still 20mm less than the last line width, the next character in the dismissed character is filled in to the last line, the width of the character is 4mm, and the total width of the character in the last line is redetermined to be 7mm based on the width from the first character to the currently filled character. And repeating the steps until the Nth character is filled into the last line, wherein the character width in the last line is more than or equal to 20mm, and stopping filling the withdrawn character.
Illustratively, if after M characters are revoked, the total width of the characters in the last line is greater than or equal to the width of the last line, then the M characters are not padded, i.e., N ═ 0.
Based on this embodiment, the character is dynamically filled in the last line, and when it is determined that the total character width has become equal to or greater than the width of the last line based on the width of the newly filled character, the continuation of the filling is stopped. Aiming at different documentaries containing different characters or equipment with different resolutions, the characters with corresponding quantity can be displayed in the last line based on the width of the last line, and the uniformity of visual effect is ensured.
In an exemplary embodiment, as shown in fig. 2, the document processing method may further include:
in step S20, the target document is filled in the display area based on the area width of the display area.
Illustratively, as shown in fig. 2, the above step S20 may be performed before step S12.
According to the embodiment, the filling of the target file is mainly performed based on the area width of the display area, so that the display area is completely filled, the utilization rate of the display area is improved, and the influence on the visual effect caused by the fact that a gap is reserved in the display area is avoided.
In an exemplary embodiment, the step S20, the filling the target document into the display area based on the area width of the display area, may include:
determining a first paragraph in the target pattern as a to-be-processed paragraph, and determining a first line in the display area as a to-be-processed line;
sequentially filling unfilled characters in the paragraphs to be processed in the target pattern into lines to be processed in the display area based on the area width of the display area;
and under the condition that the characters are not filled in the paragraphs to be processed, determining the next line of the lines to be processed as a new line to be processed, determining the next paragraph of the paragraphs to be processed as a new paragraph to be processed, and returning to the step of filling the characters which are not filled in the paragraphs to be processed in the target pattern into the lines to be processed in the display area in sequence until the paragraphs to be processed are the last paragraph of the target pattern or the lines to be processed are the last line of the display area.
For example, in the process of filling unfilled characters in the to-be-processed paragraph into the display area based on the area width of the display area, if the to-be-processed paragraph is filled up, the next paragraph in the target document is extracted as the to-be-processed paragraph, and the line is replaced in the display area, and the filling step is continued with the next line as the to-be-processed line.
When any paragraph in the document is filled up and the next line does not exist in the display area, the filling of the display area is completed, and the filling step is stopped. And determining whether to execute the steps of withdrawing M characters in the last line and filling part of the characters in the last line based on whether unfilled characters exist in the target pattern, namely whether a subsequent paragraph exists.
If the text has no unfilled characters, that is, the last paragraph is filled, all characters in the text can be displayed in the display area, so that the steps of undoing M characters in the last line and filling part of characters in the last line are not required.
If unfilled characters exist in the pattern, namely, subsequent paragraphs exist, the steps of withdrawing M characters in the last line and filling part of characters in the last line are executed, and the subsequent paragraphs are hidden and displayed.
According to the embodiment, for the target pattern comprising a plurality of paragraphs, line feed can be performed when each paragraph is filled completely based on iteration of the to-be-processed paragraph and the to-be-processed line, so that a user can read based on original paragraph division of the target pattern, and user experience is improved.
Illustratively, based on the above embodiment, step S20, based on the area width of the display area, filling the target file into the display area may further include:
and under the condition that unfilled characters exist in the paragraph to be processed, if the line to be processed is filled, determining the next line of the line to be processed as a new line to be processed, and returning to the step of filling the unfilled characters in the paragraph to be processed in the target pattern into the line to be processed in the display area until the line to be processed is the last line of the display area.
For example, if the total width of the characters filled in the first line of the display area has reached the area width of the display area, but the characters in the currently filled paragraph, i.e., the to-be-processed paragraph, are not completely filled in the display area, the line is changed in the display area, and the next line is used as the to-be-processed line, and the filling step is continued.
When any paragraph in the document is not filled, but the next line does not exist in the display area, the completion of filling the display area can be confirmed, and the filling step is stopped. And based on the existence of unfilled characters in the target file, executing the steps of withdrawing M characters in the last line and filling part of characters in the last line, and hiding and displaying the rest files.
According to this embodiment, for a target document including a plurality of paragraphs, line feed can be performed in each paragraph of the target document based on the region width of the display region, and the total width of characters in each line can be matched with the region width, thereby optimizing the display effect.
For example, in the case that there is only one paragraph in the target document, the step S20 filling the target document into the display area based on the area width of the display area may include:
determining a first line in the display area as a line to be processed;
sequentially filling unfilled characters in the target file to a row to be processed in the display area based on the area width of the display area;
and under the condition that the filling of the line to be processed is finished, determining the next line of the line to be processed as a new line to be processed, and returning to the step of sequentially filling unfilled characters in the target file into the line to be processed of the display area until unfilled characters do not exist in the target file or the line to be processed is the last line of the display area.
Exemplarily, the document processing method may further include:
and setting a hidden mark after N characters.
As an example, as shown in fig. 3, in the web page 20, for the display area 21 having the area width a, at the end of the last line, the hidden mark 22 having the width B may be displayed. Characters in the target file completely fill other spaces in the display area, wherein the file width is the area width A in other lines except the last line, the file width is B in the last line, and B is A-C, so that the display of the file and the hidden mark is not overlapped and is relatively compact, and the overall visual effect is optimized.
According to this embodiment, the hidden mark is set in the display space left after filling the character based on the width of the last line in the last line of the display area. Even if the network page is opened by using the terminal equipment with different resolutions, the hidden mark is always displayed behind the displayed file content, the visual effect is consistent, the overall utilization rate of the display area is high, and the visual effect is effectively optimized.
The following provides an application example of a document processing method.
As shown in fig. 4, in the present application example, the document processing method includes:
in step S401, the total number of paragraphs (plen) of the document, the area width (area w), last line width (lastLineW), and displayable line number (showLineNum) of the display area are acquired.
In step S402, let the current paragraph number (plndex) be 0 and the start line number (statLineNum) of the current paragraph be 0.
In step S403, it is determined whether the current paragraph number (pLndex) is less than the total paragraph number (plen). If yes, go to step S404; if not, all paragraphs in the case are traversed, and the case processing is finished.
In step S404, let the line number i currently processed be equal to the start line number (statLineNum) of the current paragraph.
In step S405, it is determined whether i is smaller than the displayable number of lines (showLineNum).
If yes, go to step S407; if not, all lines in the display area are filled, step S406 is executed to add 1 to the starting line number (statLineNum) of the current paragraph, step S403 is returned to, and after all paragraphs are traversed, the processing of the case is ended.
In step S407, let displayable width (domWidth) equal to area width (area), a label for filling the document is created.
Step S408, filling the file in the label. Wherein the width of the label after each fill increases with the width of the document.
Step S409, determine whether the tag width is less than the displayable width (domWidth).
If yes, the process returns to step S407 to continue to fill the document. If not, step S409 is executed.
In step S410, the remaining text (surflsword) is equal to the remaining text filled in the current paragraph.
In step S411, it is determined whether the remaining document (surflsword) is empty.
If the remaining text is empty, then all the contents of the current paragraph have been filled, step S412 is executed to determine whether the current paragraph number is equal to the total paragraph number (plen) minus 1. If yes, returning to the step S403; if not, then the document has no unfilled content, go to step S413, determine that concealment is not needed, and end the processing of the document.
If the remaining documents are not empty, step S414 is executed.
In step S414, it is determined whether i is equal to the displayable number of lines (showLineNum) minus 1.
If not, at least one line of the display area can be filled with the file. Step S419 is executed to increment i by 1, and the process returns to step S405.
If yes, the last row in the display area is reached, and the document needs to be hidden, and step S415 is executed.
In step S415, the displayable width (domWidth) is made equal to the last line width (lastLineW), and the current tag content is cleared.
Step S416, filling the label with the file. Wherein the width of the label after each fill increases with the width of the document.
In step S417, it is determined whether the tag width is smaller than the displayable width (domWidth).
If yes, go back to step S416 to continue to fill in the case. If not, step S418 is performed.
In step S418, a hidden button is displayed. The processing of the document is finished.
Based on the method of the embodiment of the application, the visual effect when partial content of the file is hidden can be optimized.
As an implementation of the above methods, fig. 5 shows a schematic diagram of a document processing apparatus according to an embodiment of the present application. As shown in fig. 5, the apparatus includes:
a first determining module 510, configured to determine a last line width of the display area based on an area width of the display area and a width of the hidden identifier;
a revocation module 520, configured to, when the display area is completely populated based on the target pattern, revoke M characters populated in a last line of the display area if there are unfilled characters in the target pattern; m is an integer greater than or equal to 1;
a first padding module 530, configured to pad N characters of the revoked M characters in sequence to a last line of the display area based on a last line width of the display area; wherein N is an integer less than M.
Illustratively, as shown in fig. 6, the first padding module 530 may include:
a filling unit 531, configured to fill the M characters to the last line one by one when the total width of the characters in the last line is smaller than the width of the last line, and re-determine the total width of the characters in the last line based on the width of the characters filled each time;
a stopping unit 532, configured to stop filling the M characters one by one to the last line if it is determined that the total width of the characters in the last line is greater than or equal to the width of the last line based on the width of the nth character of the M characters.
Illustratively, as shown in fig. 6, the apparatus may further include:
and a second filling module 610, configured to fill the target pattern into the display area based on the area width of the display area.
Illustratively, as shown in fig. 6, the second filling module 610 includes:
an initialization unit 611, configured to determine a first paragraph in the target pattern as a to-be-processed paragraph, and determine a first line in the display area as a to-be-processed line;
a paragraph filling unit 612, configured to sequentially fill unfilled characters in a to-be-processed paragraph in the target document into a to-be-processed line of the display area based on the area width of the display area;
a first updating unit 613, configured to determine, when there is no unfilled character in a paragraph to be processed, a next line of the line to be processed as a new line to be processed, determine a next paragraph of the paragraph to be processed as a new paragraph to be processed, and return to the step of sequentially filling unfilled characters in the paragraph to be processed in the target document into the line to be processed in the display area until the paragraph to be processed is the last paragraph of the target document or the line to be processed is the last line of the display area.
Illustratively, as shown in fig. 6, the second padding module 610 may further include:
a second updating unit 614, configured to, if the to-be-processed line is completely filled when there is an unfilled character in the to-be-processed paragraph, determine the next line of the to-be-processed line as a new to-be-processed line, and return to the step of filling the unfilled character in the to-be-processed paragraph in the target document into the to-be-processed line of the display area until the to-be-processed line is the last line of the display area.
Illustratively, as shown in fig. 6, the apparatus may further include:
a setting module 620, configured to set the hidden flag after the N characters.
The device provided by the embodiment of the application can realize the file processing method provided by the embodiment of the application, and has corresponding beneficial effects.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 7 is a block diagram of an electronic device according to the document processing method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic apparatus includes: one or more processors 701, a memory 702, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 7, one processor 701 is taken as an example.
The memory 702 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the document processing method provided by the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the document processing method provided by the present application.
The memory 702, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the document processing method in the embodiments of the present application (e.g., the first determining module 510, the undoing module 520, and the first filling module 530 shown in fig. 5). The processor 701 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 702, that is, implements the document processing method in the above-described method embodiment.
The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device of the document processing method, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 702 may optionally include memory located remotely from the processor 701, which may be connected to the electronic devices of the document processing method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the document processing method may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or other means, and fig. 7 illustrates an example of a connection by a bus.
The input device 703 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the document processing method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 704 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service. The server may also be a server of a distributed system, or a server incorporating a blockchain.
According to the technical scheme of the embodiment of the application, a proper display space which can be used for displaying the hidden mark can be reserved in the last row of the display area. The dynamic filling mode can adapt to the widths of different characters and the resolutions of different terminal devices, and the visual effect is that the width of the character in the last line is matched with the width of the last line all the time. And, set up the end line width based on the width of hiding the sign, can ensure that the character is complete to be shown, the display effect of the case and hiding the sign can not influence each other. Therefore, the embodiment of the application can optimize the visual effect when partial content of the file is hidden, and improve the experience and the retention time of a user.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. A document processing method comprises the following steps:
determining the last row width of the display area based on the area width of the display area and the width of the hidden mark;
under the condition that the display area is filled based on a target file, if unfilled characters exist in the target file, removing M characters filled in the last line of the display area; m is an integer greater than or equal to 1;
sequentially filling N characters in the M withdrawn characters to the last line of the display area based on the last line width of the display area; wherein N is an integer less than M.
2. The method of claim 1, wherein the sequentially populating the last row of the display area with N of the M characters that are dismissed based on a last row width of the display area comprises:
if the total width of the characters in the last line is smaller than the width of the last line, filling the M characters into the last line one by one, and re-determining the total width of the characters in the last line based on the width of each filled character;
stopping padding the M characters one by one to the last line if it is determined that the total width of the characters in the last line is greater than or equal to the last line width based on the width of the Nth character of the M characters.
3. The method of claim 1, further comprising:
and filling the target file into the display area based on the area width of the display area.
4. The method of claim 3, wherein the populating the target document to the display area based on an area width of the display area comprises:
determining a first paragraph in the target pattern as a to-be-processed paragraph, and determining a first line in the display area as a to-be-processed line;
sequentially filling unfilled characters in the paragraphs to be processed in the target pattern into lines to be processed in the display area based on the area width of the display area;
and under the condition that no unfilled characters exist in the paragraphs to be processed, determining the next line of the lines to be processed as a new line to be processed, determining the next paragraph of the paragraphs to be processed as a new paragraph to be processed, and returning to the step of filling unfilled characters in the paragraphs to be processed in the target pattern into the lines to be processed in the display area in sequence until the paragraphs to be processed are the last paragraph of the target pattern or the lines to be processed are the last line of the display area.
5. The method of claim 4, wherein the populating the target document to the display area based on an area width of the display area further comprises:
and under the condition that unfilled characters exist in the paragraph to be processed, if the line to be processed is filled, determining the next line of the line to be processed as a new line to be processed, and returning to the step of filling the unfilled characters in the paragraph to be processed in the target pattern into the line to be processed in the display area until the line to be processed is the last line of the display area.
6. The method of any of claims 1 to 5, further comprising:
and setting the hidden mark after the N characters.
7. A document processing apparatus comprising:
the first determining module is used for determining the last row width of the display area based on the area width of the display area and the width of the hidden mark;
the canceling module is used for canceling M characters filled in the last line of the display area if unfilled characters exist in the target file under the condition that the display area is filled based on the target file; m is an integer greater than or equal to 1;
a first padding module, configured to pad N characters of the M revoked characters in sequence to a last line of the display area based on a last line width of the display area; wherein N is an integer less than M.
8. The apparatus of claim 7, wherein the first population module comprises:
the filling unit is used for filling the M characters into the last line one by one under the condition that the total width of the characters in the last line is smaller than the width of the last line, and re-determining the total width of the characters in the last line based on the width of each filled character;
a stopping unit, configured to stop filling the M characters one by one to the last line if it is determined that the total width of the characters in the last line is greater than or equal to the last line width based on the width of the nth character of the M characters.
9. The apparatus of claim 7, further comprising:
and the second filling module is used for filling the target file into the display area based on the area width of the display area.
10. The apparatus of claim 9, wherein the second filling module comprises:
the initialization unit is used for determining a first paragraph in the target pattern as a to-be-processed paragraph and determining a first line in the display area as a to-be-processed line;
the paragraph filling unit is used for sequentially filling unfilled characters in the paragraphs to be processed in the target pattern to lines to be processed in the display area based on the area width of the display area;
a first updating unit, configured to determine, when there is no unfilled character in the paragraphs to be processed, a next line of the lines to be processed as a new line to be processed, determine, as a new paragraph to be processed, and return to the step of sequentially filling unfilled characters in the paragraphs to be processed in the target document into the lines to be processed in the display area until the paragraphs to be processed are the last paragraph of the target document or the lines to be processed are the last line of the display area.
11. The apparatus of claim 10, wherein the second fill module further comprises:
and a second updating unit, configured to, when there is an unfilled character in the to-be-processed paragraph, determine, if the filling of the to-be-processed line has been completed, a next line of the to-be-processed line as a new to-be-processed line, and return to the step of filling the unfilled character in the to-be-processed paragraph in the target document into the to-be-processed line of the display area until the to-be-processed line is a last line of the display area.
12. The apparatus of any of claims 7 to 11, further comprising:
and the setting module is used for setting the hidden identification after the N characters.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202011102406.2A 2020-10-15 2020-10-15 Document processing method, device, electronic equipment and storage medium Active CN112231607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011102406.2A CN112231607B (en) 2020-10-15 2020-10-15 Document processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011102406.2A CN112231607B (en) 2020-10-15 2020-10-15 Document processing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112231607A true CN112231607A (en) 2021-01-15
CN112231607B CN112231607B (en) 2023-11-21

Family

ID=74113170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011102406.2A Active CN112231607B (en) 2020-10-15 2020-10-15 Document processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112231607B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3648271A (en) * 1970-03-02 1972-03-07 Ibm Visual editing system incorporating selectable letter spacing display and associated scale display
CN102148048A (en) * 2011-05-12 2011-08-10 北京瑞信在线系统技术有限公司 Lyric display method and device
CN102436838A (en) * 2011-08-30 2012-05-02 北京瑞信在线系统技术有限公司 Lyric displaying method and device executed by computer
CN106469036A (en) * 2015-08-14 2017-03-01 腾讯科技(深圳)有限公司 Method for information display and client
CN108629033A (en) * 2010-01-11 2018-10-09 苹果公司 The manipulation and display of e-text
CN109743613A (en) * 2018-12-29 2019-05-10 腾讯音乐娱乐科技(深圳)有限公司 A kind of method for processing caption, device, terminal and storage medium
CN110633437A (en) * 2018-05-31 2019-12-31 阿里巴巴集团控股有限公司 Method and device for omitting display of multiple lines
CN111276110A (en) * 2018-12-04 2020-06-12 杭州海康威视数字技术股份有限公司 Character display method and device and electronic equipment
CN111459300A (en) * 2020-03-31 2020-07-28 维沃移动通信有限公司 Character display method and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3648271A (en) * 1970-03-02 1972-03-07 Ibm Visual editing system incorporating selectable letter spacing display and associated scale display
CN108629033A (en) * 2010-01-11 2018-10-09 苹果公司 The manipulation and display of e-text
CN102148048A (en) * 2011-05-12 2011-08-10 北京瑞信在线系统技术有限公司 Lyric display method and device
CN102436838A (en) * 2011-08-30 2012-05-02 北京瑞信在线系统技术有限公司 Lyric displaying method and device executed by computer
CN106469036A (en) * 2015-08-14 2017-03-01 腾讯科技(深圳)有限公司 Method for information display and client
CN110633437A (en) * 2018-05-31 2019-12-31 阿里巴巴集团控股有限公司 Method and device for omitting display of multiple lines
CN111276110A (en) * 2018-12-04 2020-06-12 杭州海康威视数字技术股份有限公司 Character display method and device and electronic equipment
CN109743613A (en) * 2018-12-29 2019-05-10 腾讯音乐娱乐科技(深圳)有限公司 A kind of method for processing caption, device, terminal and storage medium
CN111459300A (en) * 2020-03-31 2020-07-28 维沃移动通信有限公司 Character display method and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王玉德 等: "C++Builder下循环滚动文本的一种特殊实现", 《现代计算机(专业版)》, no. 11, pages 91 - 93 *
翟劲松: "手机端网页视觉设计研究", 《新媒体研究》, vol. 4, no. 07, pages 46 - 53 *

Also Published As

Publication number Publication date
CN112231607B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN110704136A (en) Rendering method of small program assembly, client, electronic device and storage medium
CN111258609A (en) Upgrading method and device of Kubernetes cluster, electronic equipment and medium
CN110865855A (en) Applet processing method and related device
CN104252452A (en) Data management method and device
CN109471626B (en) Page logic structure, page generation method, page data processing method and device
CN109145272B (en) Text rendering and layout method, device, equipment and storage medium
CN110597797A (en) Table space debris recovery method and device, electronic equipment and storage medium
CN110992112A (en) Method and device for processing advertisement information
CN112506479A (en) Page editing method, device, equipment and storage medium
CN112612467A (en) Method and device for processing micro front-end architecture based on qiankun
CN113536755A (en) Method, device, electronic equipment, storage medium and product for generating poster
CN112231607B (en) Document processing method, device, electronic equipment and storage medium
CN111176838B (en) Method and device for distributing embedded vector to node in bipartite graph
CN112559194A (en) Application data processing method, device and equipment
CN111796851A (en) Client base library updating method and device, electronic equipment and storage medium
CN110908675A (en) Operating environment acquisition method and device and electronic equipment
CN113741743A (en) Display method and device, equipment and storage medium
CN107341136B (en) Method and device for generating sequence index number and storage medium
CN113138760A (en) Page generation method and device, electronic equipment and medium
CN113110837A (en) Method and device for processing page information
CN111651229A (en) Font changing method, device and equipment
CN105353895A (en) Character input method and device
CN111708475A (en) Virtual keyboard generation method and device
CN111737404A (en) Data processing method, device, equipment and computer storage medium
CN111090824B (en) Content processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant