Handwriting editing implementation method and device and storage medium
By saving handwritten notes in annotation format in PDF files and editing them within the generated writing layer, the problem of handwritten notes being unable to be edited a second time is solved, achieving both clarity preservation and editing capabilities.
Patent Information
- Application Number
- CN202411101708.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, handwritten handwriting is saved as an image in a PDF file and cannot be edited again; furthermore, the clarity decreases when enlarged.
Save the handwriting in a PDF file with a set annotation format, generate a writing layer to cover the display area, and draw and edit the handwriting in that area to generate a second handwriting data with a set annotation format.
It enables secondary editing of handwriting and clear display when zoomed in, meeting users' editing needs while maintaining handwriting clarity.
Smart Images

Figure CN121525643A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of handwriting data processing, and in particular, to a handwriting editing implementation method, device and storage medium. BACKGROUND
[0002] For a display device with a touch function, a writing function is one of the functions frequently used by a user. The user can write in a whiteboard interface or make annotations on a read file through the writing function. In the related art, when an application providing the writing function saves handwriting of a user in a PDF (Portable Document Format) file, the handwriting is usually saved in the PDF file in the form of a picture. When the PDF file is opened again, the handwriting is displayed in the form of a picture. However, the handwriting in the form of a picture cannot be edited, and therefore, the secondary editing requirement of the user for the handwriting in the PDF file cannot be met. SUMMARY
[0003] Embodiments of the present application provide a handwriting editing implementation method, device and storage medium to solve the technical problem that handwriting is saved in a PDF file in the form of a picture and cannot be secondarily edited in the related art.
[0004] In a first aspect, one embodiment of the present application provides a handwriting editing implementation method, comprising:
[0005] receiving a writing instruction, the writing instruction being used to start a function of editing handwriting on first file content of a first PDF file, the first file content being displayed in a first window;
[0006] generating a writing layer and displaying a writing display area on the first window in a superimposed manner according to the writing instruction, the writing display area being a first area of the writing layer;
[0007] replacing the first file content in the first window with second file content, and when the first PDF file includes first handwriting data in a set annotation format, drawing corresponding handwriting in the writing layer according to the first handwriting data, the second file content being file content obtained by copying the first PDF file and not including the first handwriting data in the set annotation format;
[0008] receiving a handwriting editing operation, the handwriting editing operation acting on the writing display area;
[0009] displaying corresponding handwriting in the writing display area according to the handwriting editing operation;
[0010] receiving a file saving operation;
[0011] generating second handwriting data in the set annotation format according to the handwriting in the writing layer;
[0012] obtaining a second PDF file based on the second handwriting data and the second file content.
[0013] The above, after receiving the writing instruction, generating a writing layer, covering a writing display area on the first window, the writing display area being a first area of the writing layer, and replacing the first file content of the first PDF file displayed in the first window with the second file content, and when the first PDF file includes first handwriting data in the set annotation format, drawing handwriting in the writing layer according to the first handwriting data, wherein the second file content is the file content copied from the first file content and does not contain the first handwriting data, then receiving handwriting editing operations, and displaying corresponding handwriting in the writing display area in response to the handwriting editing operations, receiving file saving operations, generating second handwriting data in the set annotation format from the handwriting in the writing layer, and obtaining a second PDF file based on the second handwriting data and the second file content. The technical means solves the technical problem that handwriting in the related art is saved in the form of a picture in a PDF file and cannot be edited again. Currently, handwriting is saved in a PDF file in the set annotation format provided by the PDF, when the handwriting opens the PDF file, data in the set annotation format can be read, and the data can be interpreted to draw corresponding handwriting, which can realize secondary editing of the handwriting. And when the handwriting is enlarged in the writing application, the handwriting will not be distorted, that is, the display clarity of the handwriting is ensured.
[0014] In an embodiment of the present application, before receiving the writing instruction, the method further comprises:
[0015] In the whiteboard application interface, receiving a PDF file selection instruction, the PDF file selection instruction being used to select a first PDF file;
[0016] According to the PDF file selection instruction, generating a first window, and displaying first file content of the first PDF file in the first window.
[0017] The above can realize opening of the first PDF file selected by the user in the whiteboard application interface, and the first PDF file is displayed in the form of the first window, which is convenient for subsequent viewing of the first PDF file, and secondary editing of handwriting in the first PDF file and writing of new editable handwriting.
[0018] In an embodiment of the present application, the second file content includes multiple page file sub-contents, and the multiple page file sub-contents can be continuously read in the first window.
[0019] The method further comprises, after displaying the corresponding writing trace in the writing display area according to the handwriting editing operation:
[0020] receiving a region scrolling operation, the region scrolling operation acting on the writing display area;
[0021] scrolling the writing layer in the writing display area according to the region scrolling operation, so as to replace the writing display area from a first region of the writing layer to a second region in the writing layer, and scroll the second file content displayed in the first window, so as to realize that the second file content moves following the movement of the writing trace.
[0022] When the second file content includes multiple pages of file sub-contents, the multiple pages of file sub-contents can be continuously read, and when the region scrolling operation is received, the writing layer in the writing display area and the second file content in the first window are scrolled synchronously, so that the second file content moves following the movement of the writing trace, and cross-page annotation of the second file content can be realized, that is, single-page annotation and cross-page annotation of the second file content can be realized.
[0023] In an embodiment of the present application, after receiving the PDF file selection instruction in the whiteboard application interface, the method further comprises:
[0024] copying the first PDF file according to the PDF file selection instruction to obtain a copy PDF file;
[0025] searching for first trace data in the set annotation format in the copy PDF file, and when the first trace data is found, removing the first trace data in the set annotation format in the copy PDF file, taking the file content obtained after removing the first trace data as the second file content, and when the first trace data is not found, taking the file content of the copy PDF file as the second file content.
[0026] In the above, after the user selects the first PDF file, in addition to displaying the first file content of the first PDF file in the first window, the first PDF file is copied to obtain a copy PDF file, and the second file content is obtained based on the copy PDF file, so that the first file content in the first window can be quickly replaced by the second file content after the user starts the writing function, and the starting response time of the writing function is reduced.
[0027] In an embodiment of the present application, the second file content includes at least one page of file sub-contents;
[0028] The first handwriting data in the set annotation format is searched in the copy PDF file, and when the first handwriting data is found, the first handwriting data in the set annotation format in the copy PDF file is removed, the file content obtained after the first handwriting data is removed is taken as the second file content, and when the first handwriting data is not found, the file content of the copy PDF file is taken as the second file content, and the method further comprises:
[0029] generating a content picture according to the file sub-content, and one content picture corresponds to one page of the file sub-content;
[0030] The first file content in the first window is replaced with the second file content, comprising:
[0031] The content picture corresponding to the second file content is displayed in the first window, so as to replace the first file content with the second file content.
[0032] The above, each page of file sub-content in the second file content generates a corresponding content picture, and after the writing function is started, the content picture is displayed in the first window, which can reduce the data processing amount of the writing application, that is, it is not necessary to parse and display the data of other types of elements in the PDF file except the first handwriting data.
[0033] In an embodiment of the present application, the first file content comprises multiple pages of file sub-content, the multiple pages of file sub-content are displayed in the first window and can be continuously read, each page of file sub-content has a corresponding first coordinate system, the first handwriting data at least comprises a first coordinate of each handwriting point in the writing handwriting in the corresponding first coordinate system, and when the first window displays the file sub-content of adjacent pages, there is a split line between the file sub-content of adjacent pages.
[0034] The first handwriting data is drawn in the writing layer, comprising:
[0035] The first display height and the first display width of the page where the file sub-content is displayed in the first window, the actual height and the actual width of the page where the file sub-content is located, and the second display height of the split line are obtained;
[0036] The height scaling ratio is determined according to the first display height and the actual height, and the width scaling ratio is determined according to the first display width and the actual width;
[0037] The display scaling ratio when the file sub-content is displayed in the first window is determined according to the height scaling ratio and the width scaling ratio;
[0038] determine a second coordinate of the handwriting point in a second coordinate system according to the display zooming scale, the first coordinate of the handwriting point corresponding to the file subcontent, the first display height of the page where the file subcontent is located, and the second display height, the second coordinate system being a coordinate system used by the writing layer, and a size of the writing layer being equal to a total size required when all pages of the second file content are displayed;
[0039] draw the corresponding handwriting point in the writing layer according to the second coordinate, and realize drawing of the writing handwriting corresponding to the first handwriting data after all the handwriting points are drawn in the writing layer.
[0040] According to the above, in combination with the size of the writing layer being equal to the total size when all pages of the second file content are displayed, the first coordinate of each handwriting point in the writing handwriting in the first coordinate system used by the corresponding file subcontent, the first display height and the first display width of the page where the file subcontent is located, and the actual height and the actual width of the page where the file subcontent is located, and the second display height when the first window displays the split line, the second coordinate of the handwriting point in the writing layer can be obtained, and then the writing handwriting in the writing layer can be drawn.
[0041] In an embodiment of the present application, the origin of the first coordinate system is located at the lower left corner of the corresponding page, and the origin of the second coordinate system is located at the upper left corner of the writing layer,
[0042] The determining of the second coordinate of the handwriting point in the second coordinate system according to the display zooming scale, the first coordinate of the handwriting point corresponding to the file subcontent, the first display height of the page where the file subcontent is located, and the second display height comprises:
[0043] multiplying the X-axis coordinate value in the first coordinate of the handwriting point corresponding to the file subcontent by the display zooming scale to obtain an X-axis coordinate value of the handwriting point in the second coordinate system;
[0044] determining a first value obtained by multiplying the Y-axis coordinate value in the first coordinate of the handwriting point corresponding to the file subcontent by the display zooming scale, determining a second value obtained by subtracting the first display height of the file subcontent from the first value, and adding a third value to the second value to obtain a Y-axis coordinate value of the handwriting point in the second coordinate system, the third value being a product of a fourth value and a fifth value, the fourth value being a sum of the first display height of the file subcontent and the second display height, and the fifth value being a value obtained by subtracting 1 from the page number of the file subcontent in the first PDF file.
[0045] The first coordinate and the second coordinate can be mapped by reasonable calculation according to the position relationship between the origins of the first coordinate system and the second coordinate system, i.e., the handwriting points in the first PDF file can be mapped to the writing layer, and the calculation process is simple and easy to implement.
[0046] In an embodiment of the present application, the second file content includes multi-page file sub-contents, the multi-page file sub-contents are displayed in the first window in a single page and can be read continuously, and there is a split line between adjacent file sub-contents when the first window displays the adjacent file sub-contents.
[0047] The second handwriting data in the set annotation format is generated according to the handwriting in the writing layer, and includes:
[0048] The handwriting belonging to the same page file sub-content is determined.
[0049] A first handwriting point on the split line in the handwriting is identified and removed.
[0050] The fourth coordinates of the handwriting points in the corresponding file sub-content pages are determined according to the third coordinates of the handwriting points in the writing layer, each file sub-content page has a corresponding first coordinate system, the writing layer uses a second coordinate system, and the size of the writing layer is equal to the total size required when all pages of the second file content are displayed.
[0051] The second handwriting data in the set annotation format is generated according to the fourth coordinates.
[0052] When the user draws handwriting across pages, the second handwriting data in the set annotation format is obtained based on the handwriting, the handwriting belonging to the same page file sub-content can be identified first, i.e., the handwriting across pages is segmented, and after segmentation, the handwriting points on the split line can be removed, then the second handwriting data is obtained based on the remaining handwriting points, the accurate correspondence between the handwriting across pages and each page file sub-content can be realized, and the accuracy of the second handwriting data is ensured.
[0053] In an embodiment of the present application, the handwriting belonging to the same page file sub-content is determined, and includes:
[0054] The first display height of the page where the file sub-content is displayed in the first window and the second display height of the split line are obtained.
[0055] The page index to which the handwriting point belongs is determined according to the fifth coordinates of the handwriting points in the writing layer, the first display height and the second display height.
[0056] Determine the writing handwriting belonging to the same page file subcontent according to the page index to which each handwriting point belongs and the writing order of each handwriting point.
[0057] By determining the page index to which each handwriting point belongs, the writing handwriting belonging to the same page file subcontent can be determined, which ensures the accuracy of determining the writing handwriting belonging to the same page file subcontent and facilitates the subsequent accurate correspondence between the cross-page writing handwriting and each page file subcontent.
[0058] In an embodiment of the present application, the identification of the first handwriting point located on the division line in the writing handwriting and the elimination of the first handwriting point include:
[0059] Determine the remainder of the Y-axis coordinate value in the fifth coordinate of the handwriting point in the writing handwriting and the first display height;
[0060] Multiply the page index to which the handwriting point belongs by 1 and the second display height to obtain a sixth value;
[0061] Determine a seventh value after the difference between the remainder and the sixth value, and determine whether the seventh value is located in a preset value range, the preset value range being a value range between 0 and the second display height;
[0062] If the seventh value is in the preset value range, the handwriting point is determined to be the first handwriting point located on the division line and the first handwriting point is eliminated, and if the seventh value is not in the preset value range, the handwriting point is determined not to be located on the division line and the handwriting point is retained.
[0063] By combining the fifth coordinate of the handwriting point in the writing layer, the first display height of the page to which the file subcontent belongs, and the second display height of the division line, the first handwriting point located on the division line can be accurately identified and the first handwriting point can be eliminated, which facilitates the subsequent accurate correspondence between the cross-page writing handwriting and each page file subcontent.
[0064] In an embodiment of the present application, after the identification of the first handwriting point located on the division line in the writing handwriting and the elimination of the first handwriting point, the method further includes:
[0065] Determine at least one group of writing handwriting that needs to be supplemented, and traverse each handwriting point in a group of writing handwriting according to the writing order of each handwriting point;
[0066] If the page index of the second handwriting point currently traversed is inconsistent with the page index of the third handwriting point previously traversed, determine a first line formula between the second handwriting point and the third handwriting point according to the sixth coordinate of the second handwriting point in the writing layer and the seventh coordinate of the third handwriting point in the writing layer.
[0067] determining an eighth coordinate of a first edge stroke point and a ninth coordinate of a second edge stroke point according to the first line formula, the first edge stroke point corresponding to the same page as the second stroke point, and the second edge stroke point corresponding to the same page as the third stroke point;
[0068] drawing the corresponding first edge stroke point and second edge stroke point in the writing layer according to the eighth coordinate and the ninth coordinate, and connecting the first edge stroke point and the second stroke point and connecting the second edge stroke point and the third stroke point.
[0069] After the above-mentioned segmentation and elimination of the first stroke point of the cross-page writing stroke, in order to prevent the stroke points of the writing stroke at the edge of the page from being too sparse, the writing stroke is also supplemented, so that the writing stroke is as close as possible to the edge of the page.
[0070] In a second aspect, an embodiment of the present application further provides a stroke editing implementation device, comprising: a display screen, one or more processors, and a memory;
[0071] The memory is configured to store one or more programs.
[0072] The display screen is configured to realize display.
[0073] When the one or more programs are executed by the one or more processors, the one or more processors realize the stroke editing implementation method according to the first aspect.
[0074] In a third aspect, an embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the stroke editing implementation method according to the first aspect.
[0075] The stroke editing implementation device and the storage medium provided in the above have the beneficial effects of the stroke editing implementation method. BRIEF DESCRIPTION OF DRAWINGS
[0076] Figure 1 A structural schematic diagram of a stroke editing implementation device provided by an embodiment of the present application;
[0077] Figure 2 A flowchart of a stroke editing implementation method provided by an embodiment of the present application;
[0078] Figure 3 A first schematic diagram of a first window provided by an embodiment of the present application;
[0079] Figure 4 A page layout schematic diagram provided by an embodiment of the present application;
[0080] Figure 5 A flow chart of a handwriting editing implementation method provided for another embodiment of the present application;
[0081] Figure 6 A schematic diagram of a file selection window provided for an embodiment of the present application;
[0082] Figure 7 A second schematic diagram of a first window provided for an embodiment of the present application;
[0083] Figure 8 A third schematic diagram of a first window provided for an embodiment of the present application;
[0084] Figure 9 A first schematic diagram of handwriting provided for an embodiment of the present application;
[0085] Figure 10 A second schematic diagram of handwriting provided for an embodiment of the present application;
[0086] Figure 11 A third schematic diagram of handwriting provided for an embodiment of the present application;
[0087] Figure 12 A fourth schematic diagram of handwriting provided for an embodiment of the present application;
[0088] Figure 13 A fifth schematic diagram of handwriting provided for an embodiment of the present application;
[0089] Figure 14 A sixth schematic diagram of handwriting provided for an embodiment of the present application;
[0090] Figure 15 A seventh schematic diagram of handwriting provided for an embodiment of the present application. DETAILED DESCRIPTION
[0091] The present application will be further described by examples with reference to the drawings accompanying. It is to be understood that the specific examples described herein are intended to be illustrative only and are not to be in any way limiting. Furthermore, it is to be understood that not all of the features described herein are necessarily required for the practice of the present application.
[0092] The writing function refers to a function of writing in a display device by a finger or a writing pen, etc. Through the writing function, a user can write notes or make annotations in the display device. In the related art, an application program implementing the writing function can provide multiple saving modes, such as saving in a custom file format or saving in a general file format. Among them, PDF as a general file format is often used by the application program implementing the writing function.
[0093] In the related art, due to the difference between the application program implementing the writing function and the elements of the PDF file, when the user selects to save in the format of the PDF in the application program implementing the writing function, the application program generates a picture containing all the elements edited by the current user (including the handwriting written by the user), and obtains the PDF file based on the generated picture, that is, the handwriting written by the user is saved in the format of the picture in the PDF file. At this time, when the PDF file is opened again by the application program or the PDF editor, the handwriting written in the format of the picture in the PDF file cannot be edited by the user again, that is, the secondary editing demand of the user cannot be met. Moreover, since the resolution of the picture is fixed, when the picture is displayed in a magnified manner, the display clarity of the handwriting in the picture will be low, which affects the user experience.
[0094] Based on this, in the embodiments of the present application, a handwriting editing implementation method is provided. In the handwriting editing implementation method, when the application program implementing the writing function saves the PDF file, the handwriting is saved in a set annotation format, so that when the PDF file is opened again by the application program, the application program can obtain the handwriting in the set annotation format and draw it, and then the user can edit the drawn handwriting again. Moreover, after the handwriting is drawn, even if the handwriting is magnified (equivalent to redrawing the corresponding handwriting according to the magnification ratio), the display clarity of the handwriting will not be affected. Moreover, after the handwriting is saved in the set annotation format, when the PDF file is opened by other PDF editors, the handwriting can be displayed in the format of the annotation, and the secondary editing of the handwriting by the user can also be implemented (by editing the annotation).
[0095] The handwriting editing implementation method provided by the embodiments of the present application can be executed by a handwriting editing implementation device. The handwriting editing implementation device can be implemented by software and / or hardware, and can be composed of two or more physical entities or one physical entity. At present, the handwriting editing implementation device can be a display device such as a mobile phone, a tablet computer, an interactive tablet, etc. that can realize touch and display.
[0096] In one embodiment, the pen editing device is an interactive tablet. The interactive tablet is an integrated terminal for human-computer interaction by touch technology to control the content displayed on the display tablet. The interactive tablet integrates one or more functions of a projector, an electronic whiteboard, a curtain, a sound, a television and a video conference terminal. The interactive tablet is widely used in office and teaching scenarios.
[0097] Figure 1 FIG. 1 is a structural diagram of a pen editing device according to an embodiment of the present application. Figure 1 The pen editing device includes a processor 11, a memory 12 and a display screen 13. The processor 11, the memory 12 and the display screen 13 can be connected by a bus or other means.
[0098] The number of processors 11 is one or more. Figure 1 The processor 11 can include an application processor (AP), a graphics processing unit (GPU) and a central processing unit (CPU).
[0099] The memory 12 is a computer readable storage medium, which can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the pen editing method of the present application. The memory 12 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application program required by a function. The data storage area can store data created according to the use of the pen editing device. In addition, the memory 12 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device or other non-volatile solid-state storage device. In some examples, the memory 12 can further include a memory 12 remotely arranged relative to the processor 11, which can be connected to the pen editing device through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0100] The display screen 13 can be a liquid crystal display (LCD), an LED display, an organic light-emitting diode (OLED) display, a flexible light-emitting diode (FLED) display, or the like. Currently, the display screen 13 includes a display assembly and a touch assembly, the display panel is used to complete visual output. The touch assembly is used to collect the touch operation of the user, and in an embodiment, the touch assembly is mainly used to collect handwriting editing operation. The touch assembly can be a touch assembly supporting infrared touch, electromagnetic touch, capacitive touch, and / or resistive touch, etc.
[0101] The handwriting editing implementation device can also include one or more communication interfaces to realize communication with other devices through the communication interfaces. In addition, the handwriting editing implementation device can also include a power supply, a speaker, a camera, and the like, and embodiments are not limited thereto.
[0102] On the basis of the foregoing hardware structure, the handwriting editing implementation device is installed with at least one operating system. The operating system can be an Android system, a Windows system, or a Linux system, etc. On the basis of the installed operating system, the handwriting editing implementation device can install at least one application program, which can be an application program provided by the operating system, or an application program downloaded from a background server or a third-party device. In an embodiment, the handwriting editing implementation device is installed with at least an application program for implementing writing function, and currently, the application program for implementing writing function is referred to as writing application.
[0103] When the writing application starts the writing function, writing and / or annotation can be implemented, wherein the annotation refers to annotating the content of the document opened in the writing application, and the writing refers to the conventional writing in a non-annotation scenario. The triggering manner of the annotation and the writing is not limited at present, for example, the application interface of the writing application displays a control for triggering the annotation and a control for triggering the writing respectively, so that the user triggers the annotation and the writing through the two controls. For another example, the application interface of the writing application displays a control for triggering the writing function, and after the user triggers the writing function through the control, if it is detected that the writing position of the user is in the display position of the document content, it is determined that the current is for annotation, and if it is detected that the writing position of the user is in other positions of the document content, it is determined that the current user writes.
[0104] In an embodiment, the writing application has at least the function of inserting files in addition to the writing function, through which a file stored in the local or network can be opened, and the content of the file is displayed in the application interface of the writing application. Currently, the writing application can open at least a PDF file.
[0105] A PDF file refers to a file in PDF format. PDF is a cross-platform file format that encapsulates text, font, graphics, image, color, layout, etc. in a file to keep page elements unchanged in network transmission, printing and plate making output. A PDF file mainly consists of a file header, a file body, a cross-reference table and a file trailer. The file header is used to identify the file as a PDF and give the version number. The file body is the main content of the PDF file, which consists of objects, and the file body specifies page information and page elements, etc. The cross-reference table is used to give the address offset of each object from the beginning of the file. The file trailer gives the location of the cross-reference table and ends with a set content.
[0106] When a writing application opens a PDF file, it can read the specific content in the PDF file based on the page information and page elements recorded in the file body and the address offset recorded in the cross-reference table, and display it according to certain rules.
[0107] Generally speaking, PDF defines Annotation, which can also be understood as annotation, comment. Through Annotation, commenting in a PDF file can be realized, at this time, the content of the comment is saved in the PDF file in the form of Annotation type, so that when the PDF file is opened again, the content of the Annotation type is displayed, that is, the comment is displayed. Annotation has multiple subtypes, that is, PDF defines multiple Annotations. For example, the subtypes of the Annotation defined by PDF include: square, table, highlight, underline, strikeout, text, ink, arrow, etc. At present, the writing application uses the Annotation defined by PDF to save the writing traces written through the writing function in the PDF file in the form of Annotation. When the PDF file is opened again, the writing application reads the writing traces in the form of Annotation and draws them in order to facilitate the secondary editing of the writing traces.
[0108] In one embodiment, the writing application mainly uses annotations of sub-type Ink. The annotations of sub-type Ink can also be understood as ink-type annotations or ink-type comments. During user writing, the annotations of sub-type Ink can detect each writing point and connect the writing points by a straight line or a curve, so that the user writing can be displayed in a real manner. After the user writes the ink-type annotations, the related data of the ink-type annotations can be saved in the PDF file (generally, in the file body). The related data of the ink-type annotations can include the coordinates of the writing points of the user writing, the transparency of the writing, the line width, the dash pattern, the color, the appearance, and the like.
[0109] Currently, when the writing application needs to save a PDF file, the writing writing written by the user in the writing application through the writing function is saved in the PDF file in the format of ink-type annotations, that is, the element type of the writing writing is the ink-type annotations. When the writing application opens the PDF file again and performs secondary editing on the writing writing in the PDF file, the related data of the ink-type annotations recorded in the PDF file can be read, and the user writing process can be simulated based on the related data, so as to draw the writing writing in the writing application again for the user to perform secondary editing.
[0110] On this basis, Figure 2 A flowchart of a writing editing implementation method is provided for one embodiment of the present application. The writing editing implementation method is executed by a writing editing implementation device, and can also be understood as being executed by a writing application of the writing editing implementation device. Referring to Figure 2 The writing editing implementation method includes steps 210-280.
[0111] Step 210: Receive a writing instruction, the writing instruction being used to start a function of editing writing writing on a first file content of a first PDF file, the first file content being displayed in a first window.
[0112] In one embodiment, the electronic whiteboard application is used as the writing application, that is, the functions of writing, opening a PDF file, and the like can be implemented in the application interface of the electronic whiteboard. At this time, the user can first open the writing application, so that the writing editing implementation device displays the application interface of the electronic whiteboard. Currently, the application interface is referred to as a whiteboard application interface. Then, the user can implement the functions of writing, opening a PDF file, and performing secondary editing on the writing writing in the PDF in the whiteboard application interface.
[0113] For example, before the user edits the handwriting in the PDF file by the writing application, the user needs to open the PDF file in the writing application. In an embodiment, the currently opened PDF file is recorded as a first PDF file, and the file content in the first PDF file is recorded as first file content. The file content can also be understood as the object recorded in the first PDF file. When the writing application opens the first PDF file, the first file content is displayed. Optionally, the first file content includes at least one page of file sub-content, that is, the first PDF file can include at least one page, and the content recorded in each page is recorded as file sub-content. In an embodiment, the first file content is displayed in a windowed manner. At this time, the writing application can display a window in the current application interface (i.e., the whiteboard application interface), and display the first file content in the window. At present, the window displaying the first file content is recorded as a first window. Optionally, the first file content is displayed in the first window in the form of a picture, that is, after the writing application reads the first file content of the first PDF file, a picture is generated based on the first file content, the picture includes the first file content, and then the picture is displayed in the first window. When the first file content includes multiple pages of file sub-content, one page of file sub-content corresponds to one picture, and at present, one page of file sub-content corresponding to one picture can be recorded as a content picture, and then the content picture is displayed in the first window. Since the size of the first window is limited, when the content picture is multiple, the first window only displays part of the content picture. In an embodiment, when the first window displays the first file content, the first page of file sub-content is displayed by default (i.e., single-page display), that is, the first window displays the first content picture, and the content picture fills the first window, and then the first window can change the currently displayed file sub-content based on the received scrolling operation (at present, up and down scrolling), and each page of file sub-content can be continuously read, that is, the file sub-content displayed in the first window can be scrolled up or down based on the scrolling operation, and the scrolling operation can make the first window display two adjacent pages of file sub-content, at this time, each page of file sub-content has part of the content displayed in the first window. Optionally, when the first window displays two adjacent pages of file sub-content, a split line is also displayed in the two adjacent pages of file sub-content to distinguish the two pages of file sub-content.
[0114] After displaying the first file content in the first window, the user can start the writing function to write in the writing application. At present, the writing function started by the user is mainly used to edit the writing traces in the first file content of the first PDF file. The editing of the writing traces includes writing the writing traces, modifying the writing traces, deleting the writing traces, etc. In an embodiment, the user starts the writing function by issuing a writing instruction, i.e., the writing instruction is used to start the writing function of editing the writing traces in the first file content. Alternatively, a control for triggering the writing instruction is displayed in the application interface (i.e., the whiteboard application interface) of the writing application, and it is determined that the writing instruction is received when it is detected that the control receives a set operation (such as a click operation). The writing instruction can also be triggered in other ways, which are not limited by the embodiments.
[0115] In step 220, a writing layer is generated according to the writing instruction, and a writing display area is displayed on the first window in an overlaid manner. The writing display area is a first area of the writing layer.
[0116] For example, after receiving the writing instruction, the writing instruction is responded. At this time, in order to edit the writing traces on the first file content, the writing layer is generated. The writing layer can be understood as a display layer that receives the writing editing operation and draws the writing traces. The size of the writing layer can be infinite or limited. At present, the size of the writing layer is equal to the total size required when all pages of the first file content are displayed. It can be understood that if the first file content has one page of file sub-content, when the first window displays the page of file sub-content (the file sub-content fills the first window), the size of the writing layer is equal to the size of the page of file sub-content displayed in the first window. If the first file content has multiple pages of file sub-content, the first window displays one page of file sub-content by default (the file sub-content fills the first window), and other file sub-contents also need to be prepared to be displayed in the first window. At this time, when all pages of file sub-contents and the split lines between adjacent pages of file sub-contents are displayed, a certain size is required, which is larger than the size of the area in the first window for displaying the first file content. In order to enable each page of file sub-content to be edited with writing traces, the size of the writing layer needs to be equal to the total size required when all pages are displayed, so that the writing layer can cover each page of file sub-content when the user edits the writing traces on each page of file sub-content. For example, Figure 3 The first window first schematic diagram provided by an embodiment of the present application is shown in FIG. 3. Figure 3 The first window 31 displays the first page of file sub-content in the first file content. At present, the first file content has two pages of file sub-content. Figure 4 The page layout schematic diagram provided by an embodiment of the present application is shown in FIG. 4. Figure 4When the two pages of document content are displayed in the first window 31, the required layout consists of the first page's document content 32, the dividing line 33, and the second page's document content 34. However, the first page's document content 32 is displayed in the first window, while the dividing line 33 and the second page's document content 34 are hidden and not displayed in the first window 31. In this case, the required size of the writing layer should be equal to the size required when the two pages of document content plus the dividing line are displayed; that is, the size of the writing layer should be equal to... Figure 4 If the dimensions of the first document content after typesetting are equal, then the content of the first document and each point on the dividing line can be found in the writing layer.
[0117] After generating the writing layer, it can be overlaid on the first window, meaning the writing layer's layer level is higher than the first window's layer level. In one embodiment, when overlaying the writing layer on the first window, specifically, a portion of the writing layer is overlaid on the first window. This portion can then serve as the writing display area. The handwriting within this display area can be displayed, while handwriting in other areas of the writing layer remains undisplayed. That is, the writing display area is for user interaction; when the user edits handwriting, they are editing the handwriting displayed in the display area. The size of the writing display area is equal to the size of the display area in the first window when the first file content is displayed. In one embodiment, the portion of the writing layer currently serving as the writing display area is designated as the first area. The first area is the area in the writing layer corresponding to the file content displayed in the first window; for example,... Figure 4 Taking the layout shown as an example, when the first window displays the content of the first page of the document, the area in the writing layer corresponding to the content of the first page (the first area) can be considered the writing display area and overlay it on the first window. All other areas in the writing layer except the first area are hidden. That is, the first area in the writing layer can be considered to be displayed in the application interface, but because the writing layer is a transparent display layer, it cannot be seen from the user's perspective. Alternatively, it can be considered that based on the area displaying the first document content in the first window, a higher-level area of equal position and size (i.e., the writing display area) is fixed on the screen, and the first area of the writing layer is displayed in this area. Later, the user can change the area in the writing layer that serves as the writing display area according to their needs, that is, change the writing display area from the first area to other areas in the writing layer. It can be understood that when the first document content consists of only one page of document content, the entire area of the writing layer can be used as the writing display area, that is, the first area is the entire area of the writing layer.
[0118] After covering the writing display area on the first window, the user can edit the handwriting through the writing display area and display the corresponding handwriting in the writing display area.
[0119] In step 230, the first file content in the first window is replaced by the second file content, and when the first PDF file includes the first handwriting data in the set annotation format, corresponding handwriting is drawn in the writing layer according to the first handwriting data. The second file content is file content obtained by copying the first PDF file and does not include the first handwriting data in the set annotation format.
[0120] For example, after the writing application reads the first file content of the first PDF file, the first PDF file is also copied to obtain another PDF file. At present, the PDF file obtained by copying is referred to as a copy PDF file. The copy PDF file also includes a file header, a file body, a cross-reference table, and a file tail, and the data contained in the four parts is consistent with the data contained in the four parts of the first PDF file.
[0121] After obtaining the copy PDF file, the first handwriting data in the set annotation format is searched in the copy PDF file. The set annotation format refers to a brush annotation format. The first handwriting data refers to data recorded in the PDF file in the brush annotation format, which can also be considered as related data of the brush type annotation, that is, the first handwriting data is an Annotation with a subtype of ink. The first handwriting data can restore the handwriting written by the user through the brush. The first handwriting data can include the coordinates of each handwriting point in the handwriting written by the user, the page number, the transparency of the handwriting, the line width, the dash pattern, the color, the appearance, the handwriting point belonging to the handwriting, and the like.
[0122] If the first handwriting data is found, the first handwriting data is removed from the copy PDF file. After the removal, the file content of the copy PDF file can be referred to as the second file content. If the first handwriting data is not found, the file content of the copy PDF file can be referred to as the second file content. That is, compared with the first file content, the second file content does not include the first handwriting data in the set annotation format.
[0123] In one embodiment, after the writing display area is overlaid on the first window, the writing application also replaces the first file content in the first window by the second file content. Optionally, the second file content is displayed in the first window in the form of a picture. The rule of the writing application for displaying the second file content in the first window is the same as the rule for displaying the first file content, and only the first file content in the first window is replaced by the second file content. Optionally, when the first file content is multi-page, the second file content is also multi-page. When the second file content is displayed in the first window, the page number displayed is the same as the page number displayed when the first file content is replaced, for example, the second window displays the second page file sub-content of the first file content, and when the first file content is replaced by the second file content, the first window displays the second page file sub-content of the second file content.
[0124] When the second file content is displayed in the first window, the writing application parses the first PDF file to find the first handwriting data therein. If the first handwriting data is contained in the first PDF file, the writing application obtains the first handwriting data from the first PDF file and draws the corresponding writing handwriting in the writing layer according to the first handwriting data, and if the first handwriting data is not contained in the first PDF file, the writing application determines that there is no writing handwriting to be drawn at present, and thus gives up drawing the writing handwriting in the writing layer.
[0125] It should be noted that when the first PDF file contains the first handwriting data and the first file content is displayed in the first window, the writing handwriting formed by the first handwriting data is also displayed in the first window, and after the first file content is replaced by the second file content, the writing handwriting formed by the first handwriting data is no longer displayed in the first window but drawn in the writing layer. In other words, the writing handwriting is taken out of the first window and drawn in the writing layer for editing.
[0126] It can be understood that a writing handwriting is composed of handwriting points, and the writing handwriting can be obtained by connecting the handwriting points in writing order. Therefore, when the writing handwriting is drawn in the writing layer, the positions of the handwriting points in the writing layer (currently represented by two-dimensional coordinates) need to be known first, and then the handwriting points are drawn in the writing layer in combination with the drawing format (such as color, line width, transparency, etc.) of the writing handwriting, so as to obtain the writing handwriting.
[0127] In one embodiment, each page of file sub-content (including the case of only one page of file sub-content) in the first file content has a corresponding coordinate system, and the coordinate system used by each page of file sub-content is referred to as a first coordinate system. The origin of the first coordinate system is at the lower left corner of the page where the file sub-content is located. For example, Figure 4 In the above example, the first page of file sub-content corresponds to a first coordinate system, and the second page of file sub-content also corresponds to a first coordinate system, and the origin of each first coordinate system is at the lower left corner of the corresponding page. At this time, each handwriting point in the writing handwriting corresponding to the first handwriting data has a corresponding coordinate in the first coordinate system of the corresponding page, and the coordinate of the handwriting point in the first coordinate system is referred to as a first coordinate. The page number of the page where the handwriting point is located and the first coordinate in the page number are recorded in the first handwriting data.
[0128] The writing layer also has a corresponding coordinate system, and the coordinate system used by the writing layer is referred to as a second coordinate system. The origin of the second coordinate system is at the upper left corner of the writing layer. It can be understood that the coordinate system used by the writing layer is the same as the coordinate system used by the first window, that is, the writing layer and the first window share the same second coordinate system, and thus each point displayed in the first window can be found at the same position in the writing layer.
[0129] Currently, since the first coordinate system and the second coordinate system are different, and the real width and height of the page where the file sub-content is located and the width and height of the page displayed in the first window are different, when the writing application draws the corresponding writing trace in the writing layer according to the first handwriting data, it is necessary to convert the first coordinate of each handwriting point in the writing trace in the first coordinate system into the second coordinate in the second coordinate system (which can be realized by proportional scaling and coordinate transformation), and then draw the corresponding writing trace in the writing layer based on the second coordinate and other contents in the first handwriting data (such as the transparency, line width, dashed pattern, color, etc. of the handwriting).
[0130] In the process of converting the handwriting point from the first coordinate to the second coordinate, the conversion relationship between the first coordinate system and the second coordinate system where the handwriting point is located can be determined, and the second coordinate can be obtained by substituting the first coordinate into the conversion relationship. The conversion relationship between the first coordinate system and the second coordinate system can be set according to the actual situation.
[0131] In one embodiment, when the first file content includes multiple pages of file sub-contents, the multiple pages of file sub-contents are displayed in the first window and can be continuously read (i.e. the file sub-contents displayed in the first window can be adjusted by scrolling up and down), each page of file sub-contents has a corresponding first coordinate system, and the first handwriting data includes at least the first coordinate of each handwriting point in the writing trace in the corresponding first coordinate system. And when the first window displays the file sub-contents of adjacent pages, there is a division line between the file sub-contents of adjacent pages. At this time, drawing the corresponding writing trace in the writing layer according to the first handwriting data includes steps 231-235:
[0132] Step 231, obtaining the first display height and the first display width of the page where the file sub-content is displayed, the actual height and the actual width of the page where the file sub-content is located, and the second display height of the division line.
[0133] For a PDF file, each page has a corresponding page height and page width. For example, an A4 size page has a page height of 297mm and a page width of 210mm, and an A5 size page has a page height of 210mm and a page width of 148mm. In addition, the page height and the page width can also be set by the user. If the PDF file has multiple pages, the page height and the page width of each page can be the same or different. In the embodiment, the corresponding page height and page width of each page are referred to as the actual height and the actual width of the page, that is, each page of the file sub-content in the first PDF file has a corresponding actual height and actual width, and when the writing application parses the first PDF file and displays the corresponding first file content in the first window, the actual height and the actual width of the page where each page of file sub-content in the first file content is located can be obtained.
[0134] When the one-page file sub-content is displayed in the first window, the actual height and the actual width are scaled so that the page is adapted to the first window, i.e. the first window can completely display the page and the page fills the first window (in actual application, the first window can only display part of the page and the rest of the page is displayed by up and down scrolling). At this time, the one-page file sub-content has corresponding display height and display width when it is displayed in the first window, and the display height and the display width are respectively recorded as the first display height and the first display width. Optionally, since the one-page file sub-content fills the first window, the first display height and the first display width can also be understood as the height and the width of the area in the first window that displays the first file content.
[0135] Optionally, the units of the first display height and the first display width should be the same as the units of the actual height and the actual width, such as mm. At this time, the writing application can determine the height (i.e. the number of pixels in the height direction) and the width (i.e. the number of pixels in the width direction) of the pixels occupied by the file sub-content when it is displayed in the first window, and then convert the height and the width of the pixels into the first display height and the first display width in mm. Further optionally, the first display height and the first display width can also be the height and the width of the pixels occupied by the file sub-content when it is displayed in the first window. It can be understood that when the first window applies the second coordinate system, the range of the coordinate occupied by the area that displays the first file content in the X axis of the second coordinate system is equal to the first display width, and the range of the coordinate occupied by the area that displays the first file content in the Y axis of the second coordinate system is equal to the first display height.
[0136] The first display width and the first display height corresponding to each page file sub-content are equal.
[0137] In one embodiment, when the first window displays two pages of adjacent file sub-contents, there is a split line between the two pages of adjacent file sub-contents, and the display color and display height of the split line can be preset by the writing application. Since the first window displays file sub-contents, the split line also occupies a certain area, i.e., the size of the writing layer also takes into account the size occupied by the split line. Therefore, when converting the first coordinates into the second coordinates, the height of the split line also needs to be considered. Based on this, in the embodiment, the height of the split line also needs to be obtained, which can be understood as the interval height of the two pages of adjacent file sub-contents displayed in the first window. The height of the split line is referred to as the second display height. The second display height and the first display height should be of the same unit. It can be understood that when the first window applies the second coordinate system, the coordinate range occupied by the split line displayed in the second coordinate system on the Y axis is equal to the second display height.
[0138] Step 232, determining the height scaling ratio according to the first display height and the actual height, and determining the width scaling ratio according to the first display width and the actual width.
[0139] Since the actual height and the actual width are scaled when displaying one page of file sub-contents in the first window, so that the page is adapted to the first window, i.e., so that the first window can completely display the page and the page fills the first window. Therefore, when converting the first coordinates into the second coordinates, the scaling ratio of the page of file sub-contents displayed in the first window needs to be determined first. When determining the scaling ratio, the scaling ratio of the file sub-contents in the height direction (i.e., the Y axis direction) is determined first by the first display height and the actual height, which is referred to as the height scaling ratio based on the height. Assuming that the actual height of the file sub-contents is hPdf, and the first display height is hDisplay, then the height scaling ratio of the page of file sub-contents is hDisplay / hPdf. And the scaling ratio of the file sub-contents in the width direction (i.e., the X axis direction) is determined by the first display width and the actual width, which is referred to as the width scaling ratio based on the width. Assuming that the actual width of the file sub-contents is wPdf, and the first display width is wDisplay, then the width scaling ratio of the file sub-contents is wDisplay / wPdf.
[0140] Step 233, determining the display scaling ratio when displaying the file sub-contents in the first window according to the height scaling ratio and the width scaling ratio.
[0141] For example, after obtaining the height scaling ratio and the width scaling ratio, the minimum scaling ratio between the two is selected, and the selected scaling ratio is recorded as the display scaling ratio. Assuming that the display scaling ratio is recorded as rate, the height scaling ratio is recorded as hDisplay / hPdf, and the width scaling ratio is recorded as wDisplay / wPdf, the determination formula of the display scaling ratio is rate = Math.Min(wDisplay / wPdf, hDisplay / hPdf).
[0142] It can be understood that each page of the file sub-content has a corresponding display scaling ratio.
[0143] In step 234, the second coordinates of the handwriting point in the second coordinate system are determined according to the display scaling ratio, the first coordinates of the handwriting point corresponding to the file sub-content, the first display height and the second display height of the page where the file sub-content is located. The second coordinate system is the coordinate system used by the writing layer, and the size of the writing layer is equal to the total size required when all the pages in the second file content are displayed.
[0144] The total size required when all the pages in the second file content are displayed is equal to the total size required when all the pages in the first file content are displayed.
[0145] The second coordinates of the handwriting point in the second coordinate system should be composed of the coordinate value on the X axis and the coordinate value on the Y axis. Therefore, the writing application needs to calculate the X axis coordinate value and the Y axis coordinate value of the handwriting point in the second coordinate system respectively. At this time, step 234 can further include steps 2341-2342:
[0146] In step 2341, the product of the X axis coordinate value in the first coordinates of the handwriting point corresponding to the file sub-content and the display scaling ratio is taken as the X axis coordinate value of the handwriting point in the second coordinate system.
[0147] It can be understood that when the actual height and the actual width of the file sub-content are scaled, the first coordinate system of the page can also be considered to be scaled. At present, the scaled first coordinate system and the second coordinate system use the same X axis (that is, the coordinate range of both is the coordinate range corresponding to the first display width), wherein scaling can be understood as the position of the origin of the first coordinate system being unchanged and the coordinate range used being changed. For example, the actual width is 210 mm, so the coordinate range used by the X axis in the first coordinate system before scaling is 0-210, the width of the page after scaling is 105 mm (that is, the first display width is 105 mm), so the coordinate range used by the X axis in the scaled first coordinate system is 0-105. For another example, the actual width is 210 mm, so the coordinate range used by the X axis in the first coordinate system before scaling is 0-210, the width of the page after scaling is 400 pixels (that is, the first display width is 400 pixels), so the coordinate range used by the X axis in the scaled first coordinate system is 0-399. It can be understood that the origin of the first coordinate system is located at the lower left corner of the corresponding page, and the origin of the second coordinate system is located at the upper left corner of the writing layer. When the page in the first PDF file is displayed in the first window, the first coordinate system will also be scaled synchronously with the scaling of the page, and the page after scaling will be spread in the X axis direction (that is, the horizontal direction) of the first window, and the writing layer can also be considered to be spread in the X axis direction of the first window, that is, when two X axes are displayed, the widths of the two X axes are the same. Therefore, the X axis of the scaled first coordinate system and the X axis of the second coordinate system can be the same coordinate axis. Based on this principle, the X axis coordinate value in the first coordinate of the handwriting point is obtained, and then the X axis coordinate value is multiplied by the display scaling ratio corresponding to the file sub-content where the handwriting point is located, and the product result can be used as the X axis coordinate value of the handwriting point in the second coordinate system. For example, assuming that the X axis coordinate value in the first coordinate of the handwriting point is x, the display scaling ratio is rate, and the X axis coordinate value of the handwriting point in the second coordinate system is xResult, then the determination formula of the X axis coordinate value of the handwriting point in the second coordinate system is: xResult=x*rate. According to this method, the X axis coordinate value of each handwriting point in the second coordinate system can be determined.
[0148] In actual application, the width scaling ratio can also be directly used as the display scaling ratio used when the X axis coordinate value in the second coordinate system is currently calculated.
[0149] In step 2342, a first value is determined by multiplying the Y-axis coordinate value in the first coordinate of the handwriting point corresponding to the file sub-content by the display scaling ratio, a second value is determined by subtracting the first display height of the file sub-content from the first value, and a sum value obtained by adding the second value and a third value is taken as the Y-axis coordinate value of the handwriting point in the second coordinate system, the third value being a product of a fourth value and a fifth value, the fourth value being a sum of the first display height and the second display height of the file sub-content, and the fifth value being a value obtained by subtracting 1 from the page number of the file sub-content in the first PDF file.
[0150] It can be understood that when the actual height and the actual width of the file sub-content are scaled, the first coordinate system of the page can also be considered to be scaled, and the amplitude value of the coordinate range of the file sub-content on the Y-axis of the scaled first coordinate system is equal to the first display height. For example, when the actual height is 297 mm, the coordinate range of the Y-axis in the first coordinate system before scaling is 0-297, and the first display height of the page after scaling is 800 pixels, the coordinate range of the Y-axis in the first coordinate system after scaling is 0-799, and the amplitude value is 800, which is equal to the first display height. At this time, since the origin of the first coordinate system is located at the lower left corner of the corresponding page, and the origin of the second coordinate system is located at the upper left corner of the writing layer, the sum of the first display height of each page file sub-content and the second display height of each split line required to display all file sub-contents can be considered as the amplitude value of the coordinate range occupied by the writing layer on the Y-axis when the second coordinate system is used. For example, referring to FIG. 7, the sum of the first display height of each page file sub-content and the second display height of each split line required to display all file sub-contents is 800, which is equal to the amplitude value of the coordinate range occupied by the writing layer on the Y-axis when the second coordinate system is used. Figure 4The sum of the first display height of the file subcontent and the second display height of the split line can be equal to the amplitude value of the coordinate range occupied by the writing layer on the Y axis when the writing layer uses the second coordinate system. Based on this principle, after obtaining the Y axis coordinate value in the first coordinate of the handwriting point, the Y axis coordinate value is multiplied by the display scaling ratio corresponding to the file subcontent where the handwriting point is located, and the multiplication result is recorded as a first value. The first value can represent the coordinate value of the handwriting point on the Y axis in the first coordinate system after the file subcontent is scaled and displayed. Then, the first display height of the file subcontent is subtracted from the first value, and the subtraction result is recorded as a second value. The second value can represent the distance from the handwriting point to the upper boundary of the scaled file subcontent. Then, the second value is added to a third value, and the sum is taken as the Y axis coordinate value of the handwriting point in the second coordinate system. The third value is the distance from the upper boundary of the file subcontent where the handwriting point is located to the upper boundary of the writing layer, that is, the value corresponding to the upper boundary of the file subcontent on the Y axis in the second coordinate system is equal to the third value. After adding the second value and the third value, the sum can represent the distance from the handwriting point to the upper boundary of the writing layer. Since the origin of the second coordinate system is located at the upper left corner of the writing layer, the distance from the handwriting point to the upper boundary of the writing layer can be taken as the Y axis coordinate value of the handwriting point in the second coordinate system. In one embodiment, the third value can be obtained by multiplying a fourth value and a fifth value. The fourth value is the sum of the first display height of the file subcontent and the second display height of the split line, and the fifth value is the value obtained by subtracting 1 from the page number of the file subcontent in the first PDF file. It can be understood that, assuming that the file subcontent where the handwriting point is located belongs to the Mth page in the first PDF file, when the first window displays the file subcontent, there should be M-1 pages of file subcontent and M-1 split lines between the position corresponding to the upper boundary of the writing layer and the file subcontent. Therefore, the third value should be equal to the sum of M-1 first display heights and M-1 second display heights. Therefore, the sum of the first display height and the second display height is recorded as the fourth value, and the value obtained by subtracting 1 from the page number corresponding to the file subcontent where the handwriting point is located is taken as the fifth value. After multiplying the fourth value and the fifth value, the third value can be obtained. For example, assuming that the Y axis coordinate value in the first coordinate of the handwriting point is recorded as y, the display scaling ratio is recorded as rate, and the Y axis coordinate value of the handwriting point in the second coordinate system is recorded as yResult, the determination formula of the Y axis coordinate value of the handwriting point in the second coordinate system is: yResult = hDisplay - y*rate + (hDisplay + extraHeight)*(m-1). Wherein, hDisplay represents the first display height, extraHeight represents the second display height, and m is the page number of the file subcontent where the handwriting point is located in the first PDF file. According to this method, the Y axis coordinate value of each handwriting point in the second coordinate system can be determined.
[0151] In actual application, the high scaling ratio can be directly used as the display scaling ratio used when the Y-axis coordinate value in the second coordinate system is calculated.
[0152] It can be understood that in actual application, when the display rule of the file sub-content in the first window changes (for example, the file sub-content can be displayed in multiple pages in the first window), the corresponding coordinate conversion rule can be adaptively adjusted.
[0153] In step 235, corresponding handwriting points are drawn in the writing layer according to the second coordinates, and after all the handwriting points are drawn in the writing layer, the writing handwriting corresponding to the first handwriting data is realized.
[0154] According to the foregoing steps, the second coordinates of each handwriting point in the first handwriting data in the second coordinate system can be obtained. Then, corresponding handwriting points can be drawn in the writing layer based on the second coordinates, and the writing handwriting corresponding to the first handwriting data can be obtained based on the drawn handwriting points, that is, after each handwriting point belonging to the same writing handwriting is connected in the drawing order, the writing handwriting can be obtained. The handwriting belonging to the same writing handwriting can be determined by the first handwriting data, and each handwriting point in the first handwriting data is recorded in the drawing order.
[0155] It should be noted that when the writing handwriting is drawn in the writing layer, only the writing handwriting in the first area is displayed on the display screen, and the writing handwriting in other areas of the writing layer will not be displayed on the display screen, and it can also be considered that the writing handwriting in other areas is hidden.
[0156] It can be understood that the foregoing method of converting the first coordinates into the second coordinates is also applicable to the case where the first PDF file has only one page of file sub-content.
[0157] It can be understood that if the first PDF file includes the first handwriting data, then replacing the first file content in the first window with the second file content can be considered as canceling the display of the writing handwriting corresponding to the first handwriting data in the first window, and drawing the editable writing handwriting in the writing layer based on the first handwriting data. From the perspective of the user, the writing handwriting drawn in the writing layer is still displayed in the first PDF file.
[0158] In step 240, a handwriting editing operation is received, and the handwriting editing operation acts on the writing display area.
[0159] The handwriting editing operation refers to an operation of editing the writing handwriting in the writing layer. Currently, the handwriting editing operation is mainly directed to the writing handwriting in the writing display area (i.e., the displayed writing handwriting). The handwriting editing operation includes operations such as writing new writing handwriting, deleting displayed writing handwriting, and modifying displayed writing handwriting. The triggering manner of the handwriting editing operation is not limited at present.
[0160] Optionally, the handwriting editing operation can be input to the handwriting editing implementation device by a finger or a writing pen, or input to the handwriting editing implementation device by an external device such as a mouse.
[0161] Step 250: Display corresponding handwriting in the writing display area according to the handwriting editing operation.
[0162] For example, after receiving the handwriting editing operation, the handwriting editing operation is responded to, and corresponding handwriting in the writing display area is displayed, which can reflect the response result of the handwriting editing operation.
[0163] Step 260: Receive a file saving operation.
[0164] The file saving operation refers to an operation of saving the modified first PDF file. Currently, the modified first PDF file mainly refers to the first PDF file after editing the handwriting. The triggering mode of the file saving operation is not limited at present.
[0165] Step 270: Generate second handwriting data in the set annotation format according to the handwriting in the writing layer.
[0166] For example, after receiving the file saving operation, the writing application obtains the handwriting in the writing layer, and obtains the data in the brush annotation format that can be saved in the PDF file based on the handwriting, which is currently referred to as the second handwriting data. The second handwriting data is used to describe the handwriting.
[0167] In one embodiment, the writing application first obtains the coordinates of each stroke point of the writing stroke in the writing layer in the writing layer (i.e. the coordinates in the second coordinate system), and then converts the coordinates of each stroke point in the second coordinate system into the coordinates of the corresponding first coordinate system of the page to which the writing stroke belongs, and then obtains the second stroke data based on the coordinates of each stroke point in the first coordinate system, the transparency of the writing stroke, the line width, the dashed line pattern, the color, the writing stroke to which the stroke point belongs, etc. When converting the coordinates of the stroke point in the second coordinate system into the coordinates in the corresponding first coordinate system, the calculation method when converting the coordinates of the stroke point in the first coordinate system into the coordinates in the second coordinate system can be referred to. Assuming that the coordinate value of the stroke point on the X-axis in the second coordinate system is denoted as xResult', and the coordinate value of the stroke point on the X-axis in the corresponding first coordinate system is denoted as x', then x' = xResult' / rate, where rate is the display scaling ratio. The coordinate value of the stroke point on the Y-axis in the second coordinate system is denoted as yResult', and the coordinate value of the stroke point on the Y-axis in the corresponding first coordinate system is denoted as y', then y' = (hDisplay + (hDisplay + extraHeight) * (m - 1) - yResult') / rate, where hDisplay represents the first display height, extraHeight represents the second display height, and m is the page number of the file sub-content to which the stroke point belongs in the copy PDF file. In one embodiment, the page number of the file sub-content to which the stroke point belongs can be determined based on the Y-axis coordinate value of the stroke point in the second coordinate system, the first display height and the second display height, i.e. based on the first display height and the second display height, the coordinate range of each page of the file sub-content on the Y-axis in the second coordinate system can be determined, and then based on the Y-axis coordinate value of the stroke point in the second coordinate system and the coordinate range of each file sub-content on the Y-axis in the second coordinate system, the page number of the file sub-content to which the stroke point belongs can be determined. In practical applications, the page number of the stroke point can also be determined by other methods.
[0168] It can be understood that when the first file content includes multi-page file sub-contents, the corresponding second file content also includes multi-page file sub-contents, and the multi-page file sub-contents can be continuously read. At this time, if the first window displays part of contents of two adjacent file sub-contents, when the user edits the writing trace in the writing layer, the writing trace can also pass through the division line between the two adjacent file sub-contents. At this time, the writing application can first delete the trace points on the division line, and then obtain the second trace data based on the remaining trace points. It can be understood that after the trace points are deleted, the writing trace passing through the trace points will be divided into multiple segments. Alternatively, after the trace points on the division line are deleted, the trace points located at the edges of the file sub-contents can be sparse. At this time, the writing application can also supplement the trace points at the edges of the file sub-contents to ensure that the writing trace obtained after the supplement can be located at the corresponding boundaries of the file sub-contents. Then, the second trace data is obtained based on the trace points in the writing layer (including the trace points after the supplement).
[0169] Step 280, obtaining a second PDF file based on the second trace data and the second file content.
[0170] For example, after obtaining the second trace data, it is saved together with the second file content to obtain a new PDF file. At present, the new PDF file is referred to as the second PDF file. Alternatively, the second trace data is saved in the file body of the second PDF file, and the cross-reference table and the file tail of the second PDF file are regenerated to obtain the second PDF file.
[0171] The foregoing technical solution can also be considered as removing the first trace data in the first PDF file, saving the remaining data together with the second trace data obtained after editing the writing trace, and obtaining the second PDF file.
[0172] It can be understood that after the writing application opens the second PDF file again, the writing trace corresponding to the second trace data can also be edited according to the foregoing method. When other PDF editors open the second PDF file, the brush-type annotation (i.e., the writing trace) can be drawn based on the second trace data, and the brush-type annotation can be edited.
[0173] The above, after receiving the writing instruction, generating the writing layer, covering the writing display area on the first window, the writing display area is the first area of the writing layer, and replacing the first file content of the first PDF file displayed in the first window with the second file content, and when the first PDF file includes the first handwriting data in the set annotation format, drawing the writing handwriting in the writing layer according to the first handwriting data, wherein the second file content is the file content copied from the first file content and does not contain the first handwriting data, then receiving the handwriting editing operation, and responding to the handwriting editing operation to display the corresponding writing handwriting in the writing display area, receiving the file saving operation, generating the second handwriting data in the set annotation format from the writing handwriting in the writing layer, and obtaining the second PDF file based on the second handwriting data and the second file content. The technical means solves the technical problem that the writing handwriting saved in the PDF file in the form of a picture cannot be edited again in the related art. Currently, the writing handwriting is saved in the PDF file in the set annotation format provided by the PDF. When the writing handwriting opens the PDF file, the data in the set annotation format can be read and interpreted, and the corresponding writing handwriting can be drawn, so that the writing handwriting can be edited again. Moreover, when the writing handwriting is enlarged in the writing application, the writing handwriting will not be distorted, that is, the display clarity of the writing handwriting is ensured. Moreover, the set annotation format is a brush annotation format, that is, the writing handwriting is saved in the PDF file in the form of a brush annotation, which can ensure that the writing handwriting drawn based on the first handwriting data in the brush annotation format is as close to the real handwriting as possible. Moreover, in combination with the size of the writing layer being equal to the total size when all pages of the second file content are displayed, the first coordinates of each handwriting point in the writing handwriting in the first coordinate system used by the corresponding file sub-content, the first display height and the first display width of the page where the file sub-content is located when the file sub-content is displayed in the first window, and the actual height and actual width of the page where the file sub-content is located, and the second display height when the first window displays the split line, the second coordinates of the handwriting point in the writing layer can be obtained, and then the writing handwriting in the writing layer can be drawn. Moreover, in combination with the position relationship between the origins of the first coordinate system and the second coordinate system, the first coordinates can be mapped to the second coordinates through reasonable calculation means, that is, the handwriting points in the first PDF file can be mapped to the writing layer, and the calculation process is simple and easy to implement.
[0174] Figure 5 A flowchart of a handwriting editing implementation method provided for another embodiment of the application, which is a specific embodiment of the handwriting editing implementation method provided for the foregoing embodiments. In this embodiment, the second file content includes multiple file sub-contents, the multiple file sub-contents are displayed page by page in the first window and can be read continuously, and there is a split line between the file sub-contents of adjacent pages when the first window displays the file sub-contents of the adjacent pages.
[0175] It can be understood that the second file content has the same number of pages as the first file content, and therefore, the first file content can also be considered to include multiple-page file sub-contents, the multiple-page file sub-contents being displayed in the first window in a single page and being continuously readable, and there is a split line between adjacent page file sub-contents when the first window displays the adjacent page file sub-contents.
[0176] Reference Figure 5 The handwriting editing implementation method includes steps 410-4180:
[0177] Step 410, in the whiteboard application interface, a PDF file selection instruction is received, and the PDF file selection instruction is used to select a first PDF file.
[0178] For example, the currently displayed application interface of the writing application is a whiteboard application interface, and the whiteboard application interface displays a control for opening a file saved in the local or network. When it is detected that the control receives a setting operation (such as a click operation), a file selection window is popped up in the currently displayed application interface, and the file selection window displays files that can be selected by a user. For example, Figure 6 For an embodiment of the present application, a schematic diagram of a file selection window is provided, referring to Figure 6 The file selection window 51 is displayed in the currently displayed application interface of the writing application, and the file selection window 51 displays files that can be opened by the writing application in the local. In addition, the file selection window 51 can also display the folder where the file is located. The user can open the folder in the file selection window 51, so that the file selection window 51 displays the files in the folder for the user to select. Optionally, for files that cannot be opened by the writing application, they can not be displayed in the file selection window, or they can be displayed in the file selection window and distinguished from the files that can be opened by the writing application, so that the user can distinguish which files can be opened by the writing application.
[0179] Currently, the file selection window displays at least the first PDF file. Then, when an operation of selecting the first PDF file is detected, it is determined that a PDF file selection instruction is received.
[0180] Step 420, according to the PDF file selection instruction, copying the first PDF file to obtain a copy PDF file.
[0181] For example, the writing application obtains the first PDF file according to the PDF file selection instruction, and then copies the first PDF file to obtain a copy PDF file. Currently, the copy PDF file also consists of four parts: a file header, a file body, a cross-reference table, and a file tail, and the data contained in the four parts is consistent with the data contained in the four parts of the first PDF file.
[0182] Step 430, searching for the first handwriting data in the copy PDF file in the set annotation format, and when the first handwriting data is found, removing the first handwriting data in the set annotation format in the copy PDF file, taking the file content obtained after removing the first handwriting data as the second file content, and when the first handwriting data is not found, taking the file content of the copy PDF file as the second file content.
[0183] For example, after obtaining the copy PDF file, the first handwriting data in the copy PDF file in the set annotation format is searched. The set annotation format refers to the brush annotation format. That is, the writing application searches whether there is data (the first handwriting data) in the brush annotation format in the file body of the copy PDF file. If the first handwriting data is found, the first handwriting data is removed from the file body of the copy PDF file. At this time, compared with the first file content, the second file content lacks the first handwriting data in the brush annotation format. The file content of the copy PDF file after removal can be recorded as the second file content. If the first handwriting data is not found, the file content of the copy PDF file can be recorded as the second file content. At this time, the second file content is the same as the first file content.
[0184] Step 440, generating a content picture according to the file sub-content. One content picture corresponds to one page of file sub-content.
[0185] For example, the writing application reads each page of file sub-content of the second file content (which can be determined by the data recorded in the file body of the copy PDF file), and generates a corresponding content picture based on each page of file sub-content. One page of file sub-content corresponds to one content picture. At this time, each content picture does not have handwriting in the brush annotation format. It can be understood that when the second file content has only one page of file sub-content, the page of file sub-content also generates a content picture. That is, when the second file content includes at least one page of file sub-content, each page of file sub-content has a corresponding content picture.
[0186] It should be noted that no matter what type (such as text, picture, table, etc.) of object (element) each file sub-content in the second file content contains, at present, each type of element is displayed in the form of a picture. At this time, the writing application does not need to parse various types of objects and display them according to the corresponding types, but only needs to display each object in the corresponding content picture.
[0187] Step 450, generating a first window according to a PDF file selection instruction, and displaying the first file content of the first PDF file in the first window.
[0188] For example, after the writing application obtains the first PDF file according to the PDF file selection instruction, it also generates content images corresponding to the sub-contents of each page in the first PDF file. This can be done by referring to the generation method of content images corresponding to the sub-contents of each page in the copy PDF file; that is, the writing application determines the sub-contents of each page in the first PDF file based on the data recorded in the file body, and then generates corresponding content images based on each page's sub-contents. When the first PDF file includes first handwriting data, the corresponding content image contains handwriting in a pen annotation format.
[0189] Then, the writing application displays its first window within the current application interface. This first window can be displayed in the application interface at a preset size. For example, Figure 7 A second schematic diagram of a first window provided for one embodiment of this application, with reference to Figure 7 After the user selects the first PDF file, the writing application is... Figure 6 The application interface has been transformed into Figure 7 In the application interface, the file selection window is closed, and the first window 61 pops up to display the first file content of the first PDF file.
[0190] In one embodiment, the first window uses a ListBox provided by the WPF (Windows Presentation Foundation) framework as the container for displaying the content of the first file. In this case, the content images corresponding to the sub-contents of each page in the first file are displayed as list items. After specifying the display area (i.e., the size of the area in the first window where the first file content is displayed) within the container, the content images can be displayed in the first window according to the specified display area. Currently, the specified display area is the area required to display one content image. It can be understood that after specifying the display area, the ListBox provides a scrollable view, allowing the user to easily preview the content images.
[0191] Optionally, after the writing application displays the first window, the user can also perform operations on the first window, such as maximizing, minimizing, or moving the display position of the first window. Figure 8 This is a third schematic diagram of a first window provided in one embodiment of this application. Figure 8 It shows when the user... Figure 7 The diagram shows the display of the first window 61 in the application interface when the first window 61 is maximized. At this time, the first window is displayed in the application interface in a maximized manner, that is, the area in the first window that displays the content of the first file is also maximized.
[0192] It should be noted that steps 430 and 440 and step 450 can be executed simultaneously, or in sequence (e.g., first execute steps 430 and 440, and then execute step 450, or first execute step 450, and then execute steps 430 and 440), and embodiments do not limit this.
[0193] It can be understood that after the user selects the first PDF file, the writing application defaults the user to read the first PDF file, at this time, it is not necessary to parse the types of objects in each file sub-content in the first PDF file, but only to display each object in the corresponding content image, and display in the first window. When the user starts the writing function, the writing application determines that the user needs to edit the writing traces in the first PDF file, at this time, the first writing trace with the set annotation format in the first PDF file is drawn in the writing layer based on the first writing trace with the set annotation format in the first PDF file, and the first file content in the first window is replaced by the second file content, that is, the writing application needs to parse the first writing trace with the set annotation format.
[0194] Step 460, receiving a writing instruction, the writing instruction is used to start the function of editing the writing trace on the first file content of the first PDF file, and the first file content is displayed in the first window.
[0195] Step 470, according to the writing instruction, generating a writing layer, and displaying a writing display area on the first window, the writing display area being a first area of the writing layer.
[0196] The currently generated writing layer is suitable for the currently displayed first window, for example, when the first window is maximized, the size of the generated writing layer needs to be suitable for the maximized first window, and when the first window is displayed in a pre-set size (i.e., not maximized), the size of the generated writing layer needs to be suitable for the non-maximized first window. At this time, the size required by the writing layer can be determined according to the size of the area (i.e., the specified display range) in the first window for displaying the first file content, and the number of pages of each file sub-content and the second display height of the division line. Generally, the size of the area for displaying the first file content is equal to the size of a content image completely displayed in the first window.
[0197] Optionally, the first area in the writing layer is overlaid on the first window as a writing display area, and the first window cannot be operated by the user, i.e., cannot be maximized, minimized, etc. Further optionally, the first area in the writing layer is overlaid on the first window, and the first window can be maximized, minimized, etc. by the user, at this time, the writing layer changes synchronously with the change of the first window, i.e., the size of the writing layer can be re-determined according to the change of the first window, and the writing layer is modified to make the writing layer suitable for the first window.
[0198] Step 480, display the content picture corresponding to the second file content in the first window to realize replacing the first file content with the second file content, and when the first PDF file includes the first handwriting data in the set annotation format, draw the corresponding writing handwriting in the writing layer according to the first handwriting data, the second file content being the file content obtained by copying the first PDF file and not including the first handwriting data in the set annotation format.
[0199] Optionally, when replacing the first file content with the second file content in the first window, specifically, replacing the content picture of the first file content currently displayed in the first window with the content picture of the second file content, i.e., displaying the content picture of the second file content in the form of a list item, and the specified display range when displaying does not change.
[0200] Meanwhile, when the first PDF file includes the first handwriting data, the first handwriting data is drawn in the writing layer.
[0201] Step 490, receive a handwriting editing operation, the handwriting editing operation acting in the writing display area.
[0202] Step 4100, display the corresponding writing handwriting in the writing display area according to the handwriting editing operation.
[0203] Step 4110, receive an area scrolling operation, the area scrolling operation acting in the writing display area.
[0204] Currently, the second file content includes multiple pages of file sub-contents, and the multiple pages of file sub-contents can be continuously read in the first window.
[0205] Illustratively, the ListBox provides a scrollable view, i.e., after the user performs a scrolling operation on the first window, the first window can scroll the content pictures displayed in the view to realize the user's quick preview of the content pictures, and each page of content pictures can be continuously read. On this basis, when the writing handwriting is drawn using the writing layer, the user can also scroll the currently displayed area in the writing layer through the scrolling operation and the content pictures in the first window are synchronously scrolled to realize the effect that the content pictures and the writing handwriting are followed.
[0206] Currently, the scrolling operation performed by the user in the writing layer is recorded as an area scrolling operation, which is used to scroll the writing layer in the writing display area, i.e., the area scrolling operation can change the area in the writing layer as the writing display area. Since only the first area corresponding to the writing display area is displayed in the writing layer, and other areas are hidden, the only area that the user can interact with is the first area in the writing display area, i.e., the area scrolling operation acts on the writing display area. The triggering mode of the area scrolling operation is not limited at present, which is generally distinguished from the conventional writing operation.
[0207] In one embodiment, the writing application subscribes to the ManipulationDelta event provided by WPF. The ManipulationDelta event refers to mouse down and mouse move events. If the detected touch operation acting on the writing display area can simulate mouse down and mouse move operations, the ManipulationDelta event is triggered, and it is determined that the area scrolling operation is received.
[0208] At step 4120, the writing layer in the writing display area is scrolled according to the area scrolling operation, so as to change the writing display area from the first area of the writing layer to a second area of the writing layer, and the second file content displayed in the first window is scrolled, so as to realize the movement of the second file content following the movement of the writing trace.
[0209] After the area scrolling operation is received, the writing layer is scrolled according to the scrolling direction (at present, mainly the downward scrolling direction or the upward scrolling direction) and the scrolling distance obtained by the area scrolling operation (for example, upward scrolling by N pixels). At this time, the area of the writing layer displayed in the writing display area changes. At present, the area of the writing layer displayed in the writing display area after responding to the area scrolling operation is referred to as the second area. That is, the first area in the writing display area can be scrolled to the second area through the area scrolling operation. The first area and the second area can be completely different areas or partially overlapping areas. When the first area is scrolled to the second area, part of the first area and the second area is also displayed in the writing display area, instead of directly replacing the first area with the second area. It can be understood that at this time, the writing trace in the writing layer is also scrolled, that is, the writing trace on the second area is displayed in the writing display area and can be viewed by the user, and the writing trace in the first area is hidden (that is, no longer displayed) with the hiding of the first area.
[0210] In one embodiment, when responding to the area scrolling operation (that is, processing the ManipulationDelta event), the ScrollToVerticalOffset provided by WPF is also called, that is, the scroll bar offset (which can also be regarded as the scrolling offset of the content picture in the ListBox view) is determined through the ScrollToVerticalOffset. At present, the scroll bar offset should be equal to the scrolling distance. Then, the content picture in the ListBox view is scrolled according to the scroll bar offset, so as to realize the movement of the second file content following the movement of the writing trace.
[0211] For example, Figure 9 The writing trace 71 displayed in the writing layer (at present, mainly in the writing display area) overlaid on the first window in the first schematic diagram of the writing trace provided by one embodiment of the present application is as followsFigure 9 Afterwards, the user can perform a region scroll operation of upward scrolling on the writing display region, and then the writing application responds to the writing scroll operation to scroll the region of the writing layer in the writing display region upward, Figure 10 A second writing trace diagram provided by an embodiment of the present application, Figure 10 The position of the writing trace 71 shown in the second writing trace diagram in the writing display region is based on Figure 9 The position of the writing trace 71 after responding to the region scroll operation shown in the second writing trace diagram, at this time, the writing trace 71 is scrolled upward by a certain position, and the content picture in the first window is also scrolled upward by a certain position, that is, the writing trace 71 is synchronized to scroll with the content picture.
[0212] It can be understood that the visual presentation of the scroll response can refer to the visual presentation when scrolling the PDF page in WPS or Office.
[0213] In addition to the region scroll, the user can also zoom in or zoom out the writing trace, at this time, the file sub-content (that is, the content picture) displayed in the first window is also zoomed in or zoomed out synchronously to ensure that the writing trace and the file sub-content change synchronously.
[0214] Step 4130, receiving a file save operation.
[0215] Step 4140, determining the writing trace belonging to the file sub-content of the same page.
[0216] It can be understood that since each page of file sub-content in the second file content can be continuously read, when the user performs a writing editing operation on the writing layer, the corresponding file sub-content corresponding to the writing trace may cross pages. For example, Figure 11 A third writing trace diagram provided by an embodiment of the present application, referring to Figure 11 The distribution of the writing trace 81 corresponds to two pages of file sub-content, at this time, it can be considered that the writing trace is drawn across pages, that is, a writing trace crosses multiple pages of file sub-content, therefore, it is necessary to identify the file sub-content to which each trace point in the writing trace belongs, and based on the identification result, the writing trace is segmented to make a segmented writing trace only correspond to one file sub-content and no longer cross-page display.
[0217] In an embodiment, the page index required to determine each trace point is described by taking the example of determining the writing trace belonging to the same file sub-content in combination with the page index, at this time, step 4140 includes step 4141-step 4143:
[0218] Step 4141, obtaining the first display height of the page on which the file sub-content is displayed in the first window and the second display height of the segmentation line.
[0219] The first display height and the second display height can be determined according to the foregoing description. In this step, the first display height and the second display height can be directly obtained and used. The first display height can also be understood as the display height of the content image when the content image is displayed in the first window.
[0220] In step 4142, the page index to which each stroke point in the writing layer belongs is determined according to the fifth coordinate of each stroke point in the writing layer in the writing layer, the first display height and the second display height.
[0221] In an example, the coordinate of each stroke point in the writing layer in the writing layer is recorded as the fifth coordinate. It can be understood that the fifth coordinate can also be understood as the coordinate of the stroke point in the second coordinate system. Each stroke point in the writing layer has a corresponding fifth coordinate.
[0222] The writing application can determine the page index to which each stroke point belongs in combination with the fifth coordinate, the first display height and the second display height. At present, the page index can also be understood as the page number required by the currently recognized stroke point. Each stroke point (whether or not located on the split line) has a corresponding page index.
[0223] In an example, when determining the page index to which each stroke point belongs, the coordinate point of the stroke point in the second coordinate system is first determined to cross how many pages of content images. The calculation method can be Yn / (displayHeight+splitHeight), where Yn represents the Y-axis coordinate value in the fifth coordinate of the stroke point, displayHeight represents the first display height, and splitHeight represents the second display height. The integer in the value obtained after Yn / (displayHeight+splitHeight) can be understood as the number of pages of content images crossed. For example, when the first window displays the third page of content images, the stroke point in the writing display area covers the third page of content images. At this time, the stroke point can be considered to cross two pages of content images, that is, the integer in the value obtained after calculation by the foregoing formula should be 2. Then, the value obtained after adding 1 to the integer is used as the page index corresponding to the stroke point, that is, if the stroke point crosses two pages of content images, the page index of the stroke point can be considered to be 3, that is, the stroke point can be a stroke point corresponding to the third page of content images or a stroke point on the split line below the third page of content images. At this time, it can also be considered that the calculation result of Yn / (displayHeight+splitHeight) is rounded up, and the integer obtained after rounding up is used as the page index of the corresponding stroke point.
[0224] In step 4143, the writing strokes belonging to the same page of the file sub-content are determined according to the page index to which each stroke point belongs and the writing order of each stroke point.
[0225] The writing order can also be understood as the drawing order of the stroke points when drawing the stroke in the writing layer.
[0226] For example, according to the writing order of the stroke points in a stroke (the stroke currently being processed is recorded as the stroke being processed), the page index of each stroke point is determined in sequence. If the page index of the stroke point currently determined is inconsistent with the page index of the stroke determined last time, it indicates that the page corresponding to the stroke point has changed, and it can be considered that a new stroke has been started, that is, the stroke being processed is segmented. At this time, the starting point of the new stroke is the stroke point of the currently determined page index, and the ending point of the other stroke is the stroke point of the last determined page index. Then, the page index of the next stroke point being processed can be determined, and the process is repeated until all stroke points in the stroke being processed are traversed. Then, the next stroke is obtained and the foregoing process is repeated.
[0227] After all the stroke points are traversed in this way, the segmentation of the cross-page stroke can be realized.
[0228] Step 4150, identifying the first stroke point on the segmentation line in the stroke and eliminating the first stroke point.
[0229] For example, referring to Figure 11 , when the stroke 81 crosses the page, some stroke points in the stroke 81 can correspond to the position of the segmentation line 82 in the first window, that is, it can be considered that the stroke points are on the segmentation line 82. Currently, the stroke points on the segmentation line are recorded as the first stroke points.
[0230] After the strokes are segmented, the first stroke point on the segmentation line also needs to be identified.
[0231] The way to identify the first stroke point can be: the coordinate range occupied by each segmentation line on the Y axis in the second coordinate system can be determined in combination with the first display height of the file sub-content, the second display height of the segmentation line, and the page number corresponding to the file sub-content. Then, the stroke points whose Y axis coordinate values in the second coordinate system fall within the coordinate range corresponding to the segmentation line are found, and the found stroke points are determined as the first stroke points. The way to identify the first stroke point can also be: the first stroke points are identified in combination with the first display height of the file sub-content, the second display height of the segmentation line, and the page index of each stroke point.
[0232] In one embodiment, the first stroke points are identified in combination with the first display height of the file sub-content, the second display height of the segmentation line, and the page index of each stroke point, which is described as an example. At this time, step 4150 includes steps 4151-4154:
[0233] Step 4151, determine the remainder of the Y-axis coordinate value in the fifth coordinate of the handwriting point in the handwriting layer and the first display height.
[0234] For example, the Y-axis coordinate value in the fifth coordinate of the handwriting point in the handwriting layer is obtained, and the remainder of the Y-axis coordinate value and the first display height is calculated. For example, the first display height is denoted as displayHeight, the Y-axis coordinate value in the fifth coordinate of the handwriting point is denoted as Yn, and the remainder is denoted as result. Then, result=Yn%displayHeight, % means remainder.
[0235] Step 4152, multiply the page index to which the handwriting point belongs by the second display height after subtracting 1 to obtain a sixth value.
[0236] The page index to which the handwriting point belongs is determined, and the page index is subtracted by 1. Then, the value obtained after subtracting 1 is multiplied by the second display height, and the total height of each split line crossed by the current handwriting point can be obtained.
[0237] Step 4153, determine the seventh value after the difference between the remainder and the sixth value, and determine whether the seventh value is within a preset value range, wherein the preset value range refers to the value range between 0 and the second display height.
[0238] For example, the remainder is subtracted from the sixth value, and the result of the subtraction is denoted as the seventh value. The seventh value can be represented as: result-(index-1)*splitHeight. Wherein, result represents the remainder, index represents the page index to which the handwriting point belongs, and splitHeight represents the second display height.
[0239] After obtaining the seventh value, it is determined whether the seventh value is within a preset value range. The preset value range is the value range between 0 and the second display height, for example, the second display height is denoted as splitHeight, and the preset value range can be denoted as (0, splitHeight). That is, it is determined whether the seventh value is in (0, splitHeight).
[0240] Step 4154, if the seventh value is within the preset value range, it is determined that the handwriting point is a first handwriting point located on the split line and the first handwriting point is removed, and if the seventh value is not within the preset value range, it is determined that the handwriting point is not located on the split line and the handwriting point is retained.
[0241] If the seventh value is in the preset value range, it indicates that the corresponding handwriting point is located on the split line, at this time, the handwriting point is determined as the first handwriting point located on the split line, and the first handwriting point is deleted in the writing layer. If the seventh value is not in the preset data range, it indicates that the corresponding handwriting point is not located on the split line, at this time, the handwriting point is determined as not the first handwriting point, and the handwriting point is retained in the writing layer.
[0242] After all the handwriting points in the writing layer are processed in the foregoing manner, all the first handwriting points can be identified and deleted. It can be understood that after the first handwriting points are deleted, the length of the writing handwriting in which the first handwriting points are located will be shortened, but the writing handwriting is completely located in the page corresponding to the file sub-content, and there is no handwriting point located on the split line.
[0243] In some cases, after the first handwriting points in the writing handwriting are deleted, the handwriting points close to the edge of the page in the writing handwriting can become sparse, at this time, the sparse handwriting points at the edge of the page also need to be supplemented. For example, Figure 12 The fourth writing handwriting diagram provided by an embodiment of the present application is shown in FIG. 9, which shows Figure 12 The writing handwriting 91 is composed of a plurality of handwriting points and lines between adjacent handwriting points, and the first handwriting point 92 located on the split line 94 exists in the writing handwriting 91. Figure 13 The fifth writing handwriting diagram provided by an embodiment of the present application is shown in FIG. 10, which shows Figure 13 After the first handwriting point 92 is deleted, the handwriting points 93 at the edge of the writing handwriting 91 are sparse, that is, the distance between the handwriting points 93 and the edge of the page where the file sub-content is located is large, therefore, the edge of the writing handwriting 91 needs to be supplemented to make the writing handwriting as close as possible to the edge of the page where the file sub-content is located. In an embodiment, after step 4150, the method further includes: determining at least one group of writing handwriting that needs to be supplemented, and traversing the handwriting points in the group of writing handwriting according to the writing order of the handwriting points; if the page index of the second handwriting point currently traversed is inconsistent with the page index of the third handwriting point previously traversed, determining a first line formula between the second handwriting point and the third handwriting point according to the sixth coordinate of the second handwriting point in the writing layer and the seventh coordinate of the third handwriting point in the writing layer; determining the eighth coordinate of the first edge handwriting point and the ninth coordinate of the second edge handwriting point according to the first line formula, the first edge handwriting point corresponding to the same page as the second handwriting point, and the second edge handwriting point corresponding to the same page as the third handwriting point; drawing the first edge handwriting point and the second edge handwriting point in the writing layer according to the eighth coordinate and the ninth coordinate, and connecting the first edge handwriting point and the second handwriting point and connecting the second edge handwriting point and the third handwriting point.
[0244] The set of writing traces that need to be filled in is a set of writing traces obtained by splitting a writing trace drawn by a user across pages based on page indexes, and if there is a first writing point, the first writing point is removed, and if there is no first writing point, the set of writing traces obtained by splitting the writing trace drawn by the user across pages can be directly used as the set of writing traces that need to be filled in. For example, referring to Figure 12 and Figure 13 , the writing trace 91 and the writing trace 95 are two writing traces obtained by splitting a writing trace drawn by a user across pages, and the first writing point on the split line 94 in the writing trace 91 is removed, and the two writing traces (i.e., the writing trace 91 and the writing trace 95 in Figure 13 ) obtained can be considered as the set of writing traces that need to be filled in. For another example, Figure 14 is a sixth writing trace diagram provided by an embodiment of the present application, referring to Figure 14 , a user draws a writing trace 97 across pages, the writing trace 97 can be split into six writing traces based on page indexes to which the writing points belong, and if there is a first writing point on the split line 98 in the six writing traces, the first writing point is removed, and the six writing traces obtained after the first writing point is removed can be considered as the set of writing traces that need to be filled in.
[0245] Then, in the set of writing traces that need to be filled in, the writing points are traversed in sequence according to writing orders of the writing points. When the writing points are traversed, a page index to which a currently traversed writing point belongs is obtained, and the page index to which the currently traversed writing point belongs is compared with a page index to which a previously traversed writing point belongs. At present, in order to facilitate understanding of the technical solution, the currently traversed writing point is recorded as a second writing point, and the previously traversed writing point is recorded as a third writing point. Then, it is determined whether the page index of the second writing point and the page index of the third writing point are consistent. If they are consistent, the next writing point is continuously traversed. If they are not consistent, it is indicated that the second writing point and the third writing point belong to two writing traces and are located at edges of the two writing traces respectively. At this time, the edges of the two writing traces can be filled in based on the second writing point and the third writing point located at the edges respectively.
[0246] When filling in the missing points, the formula for connecting the second and third handwriting points is determined based on the coordinates of the second handwriting point in the second coordinate system (currently denoted as the sixth coordinate) and the coordinates of the third handwriting point in the second coordinate system (currently denoted as the seventh coordinate). This formula is currently denoted as the first connection formula. In one embodiment, taking a direct connection between the second and third handwriting points as an example, the first connection formula should be a linear equation in two variables: y = kx + b. Then, substituting the sixth coordinate of the second handwriting point and the seventh coordinate of the third handwriting point into the first connection formula, the specific values of the coefficients k and b can be calculated. Afterwards, writing the specific values of the two coefficients into the aforementioned equation yields the first connection formula with fixed coefficients, thus determining the currently usable first connection formula. In practical applications, other equations can also be used as the first connection formula.
[0247] After obtaining the first connection formula, the coordinates of the handwriting point on the line connecting the second and third handwriting points, near the page edge where the second handwriting point is located, can be determined in the second coordinate system. Currently, the handwriting point on the connecting line at the page edge is denoted as the first edge handwriting point, and its coordinates in the second coordinate system are designated as the eighth coordinate. Specifically, the page corresponding to the second handwriting point has two boundaries along the Y-axis in the second coordinate system. The second handwriting point is closer to one of these boundaries. Figure 13 For example, stroke point 93 is the second stroke point, and stroke point 96 is the third stroke point. The second stroke point is close to the bottom boundary of its corresponding page. The coordinate value of this bottom boundary on the Y-axis in the second coordinate system can be determined by the first display height and the second display height. Then, after substituting this coordinate value as the Y-axis coordinate value into the first connection formula, the resulting X value can be considered the X-axis coordinate value in the second coordinate system. The point corresponding to the X-axis and Y-axis coordinate values in the writing layer can be considered the first edge stroke point. This first edge stroke point is located on the page boundary and corresponds to the same page as the second stroke point. That is, the X-axis and Y-axis coordinate values can be used as the eighth coordinate of the first edge stroke point in the second coordinate system. It is understandable that the first edge stroke point can also be the stroke point between the second stroke point and the page boundary. That is, based on the coordinate value range formed by the Y-axis coordinate value of the second stroke point in the second coordinate system and the Y-axis coordinate value of the page boundary in the second coordinate system, a coordinate value is selected and substituted into the first connection formula as the Y-axis coordinate value in the eighth coordinate system to obtain the X-axis coordinate value in the eighth coordinate system.
[0248] In the same way, the coordinates of the handwriting point on the line connecting the second and third handwriting points (currently referred to as the second edge handwriting point) near the page edge of the third handwriting point in the second coordinate system (currently referred to as the ninth coordinate) can also be determined.
[0249] After the eighth coordinate of the first edge stroke point and the ninth coordinate of the second edge stroke point are determined, the first edge stroke point and the second edge stroke point can be drawn in the writing layer based on the eighth coordinate and the ninth coordinate respectively. Then, the first edge stroke point and the second stroke point can be connected to fill in the writing stroke where the second stroke point is located, and the second edge stroke point and the third stroke point can be connected to fill in the writing stroke where the third stroke point is located.
[0250] Then, the next stroke point can be traversed, and the filling in can be performed in the above manner when needed. At this time, the writing stroke 91 and the writing stroke 95 shown in FIG. 9A are taken as examples, and two stroke points can be filled in according to the foregoing manner. Figure 13 Figure 15 The seventh writing stroke diagram provided by an embodiment of the present application is a writing stroke diagram obtained after the writing stroke 91 and the writing stroke 95 shown in FIG. 9A are filled in, and compared with the writing stroke diagram shown in FIG. 9A, the two writing strokes in the writing stroke diagram shown in FIG. 9B are obviously closer to the page edge. Figure 13 Figure 13 Figure 15 Figure 14 The writing stroke 97 shown in FIG. 9C is taken as an example. The writing stroke 97 can be divided into six writing strokes, and ten stroke points need to be filled in. The positions of the ten stroke points are the positions pointed to by the ten arrows in FIG. 9C. Figure 14
[0251] In actual applications, the writing stroke needing to be filled in can also be determined and filled in through other manners. For example, the writing stroke to which the first stroke point belongs before being removed is searched, and then it is judged whether the distance between the stroke point closest to the page edge in the writing stroke and the page edge exceeds a pre-set distance threshold. If yes, it is indicated that the stroke point needs to be filled in. At this time, a formula of a line (which can be denoted as a second line formula) between the stroke point closest to the page edge and the stroke point written before is calculated, and then the coordinate value on the X axis is determined based on the second line formula and the coordinate value of the page boundary on the Y axis, so as to obtain the coordinate of the edge stroke point in the second coordinate system, and to realize the drawing of the edge stroke point.
[0252] In step 4160, the fourth coordinates of the stroke points in the pages corresponding to the respective file sub-contents are determined according to the third coordinates of the stroke points in the writing layer. Each page of each file sub-content has a corresponding first coordinate system, and the writing layer uses a second coordinate system. The size of the writing layer is equal to the total size required when all the pages in the second file content are displayed.
[0253] The total size required when all the pages in the second file content are displayed is equal to the total size required when all the pages in the first file content are displayed, and both are equal to the size of the writing layer.
[0254] Exemplarily, the coordinates of each handwriting point (including the handwriting point after the supplement) in the current writing layer in the second coordinate system are marked as third coordinates, and then the third coordinates of each handwriting point are converted into coordinates in the first coordinate system used by the file sub-content to which the handwriting point belongs, which are currently marked as fourth coordinates.
[0255] In the process of converting the third coordinates into the fourth coordinates, the coordinate value of the handwriting point on the X axis in the third coordinates is marked as xResult', the coordinate value of the handwriting point on the X axis in the fourth coordinates is marked as x', and x' = xResult' / rate, where rate is the display scaling ratio. The coordinate value of the handwriting point on the Y axis in the third coordinates is marked as yResult', the coordinate value of the handwriting point on the Y axis in the fourth coordinates is marked as y', and y' = (hDisplay + (hDisplay + extraHeight) * (m-1) - yResult') / rate, where hDisplay represents the first display height, extraHeight represents the second display height, and m is the page number of the file sub-content in which the handwriting point is located in the copy PDF file. Currently, the page index of the handwriting point can be used as the page of the file sub-content in which the handwriting point is located in the copy PDF file. In this way, the fourth coordinates of each handwriting point can be obtained.
[0256] Step 4170, generating second handwriting data in the set annotation format according to the fourth coordinates.
[0257] Exemplarily, the second handwriting data in the brush annotation format is generated based on the fourth coordinates of each handwriting point, and the second handwriting data can further include the transparency, line width, dash pattern, color, and writing pen of the handwriting of the handwriting point.
[0258] Step 4180, obtaining a second PDF file based on the second handwriting data and the second file content.
[0259] It can be understood that in actual applications, the first window of the writing application can also not display the split lines when displaying the file sub-contents of each page, that is, there is no gap between the file sub-contents of adjacent pages. This case is also applicable to the handwriting editing implementation method described above, except that the second display height of the split line can be marked as 0, and the first handwriting point does not need to be found and removed.
[0260] The above, through the PDF file selection instruction, the first PDF file selected by the user can be opened in the whiteboard application interface, and the first PDF file is displayed in the form of a first window, facilitating subsequent viewing of the first PDF file and secondary editing of the writing traces in the first PDF file and writing of new editable writing traces. Moreover, when the second file content includes multiple page file sub-contents, the multiple page file sub-contents can be read continuously, and when a receiving area scrolling operation is received, the writing layer in the writing display area and the second file content in the first window are scrolled synchronously, the second file content can also be moved following the movement of the writing traces, and cross-page annotations of the second file content can be implemented, that is, single-page annotations and cross-page annotations of the second file content can be implemented. Moreover, after the user selects the first PDF file, in addition to displaying the first file content of the first PDF file in the first window, a copy of the first PDF file is also copied to obtain a copy PDF file, and the second file content is obtained based on the copy PDF file, so that the first file content in the first window can be quickly replaced by the second file content after the user starts the writing function, reducing the response time of the writing function. Moreover, each page file sub-content in the second file content generates a corresponding content image, and the content image is displayed in the first window after the writing function is started, which can reduce the data processing amount of the writing application, that is, there is no need to parse and display data of other types of elements in the PDF file except the first trace data. Moreover, when the user draws writing traces across pages, the second trace data in the specified annotation format is obtained based on the writing traces, the writing traces belonging to the same page file sub-content are identified first, that is, the writing traces across pages are segmented, and after the segmentation, the trace points located on the segmentation line can also be removed, then the second trace data is obtained based on the retained trace points, which can accurately correspond the writing traces across pages to each page file sub-content, thereby ensuring the accuracy of the second trace data. Moreover, by determining the page index to which each trace point belongs, the writing traces belonging to the same page file sub-content can be determined, which can ensure the accuracy of the writing traces belonging to the same page file sub-content, and in combination with the fifth coordinate of the trace point in the writing layer and the first display height of the page to which the file sub-content belongs and the second display height of the segmentation line, the first trace point located on the segmentation line can be accurately identified and removed, facilitating subsequent accurate correspondence of the writing traces across pages to each page file sub-content. Moreover, after the writing traces across pages are segmented and the first trace point is removed, in order to prevent the trace points of the writing traces at the edge of the page from being too sparse, the writing traces are also supplemented, so that the writing traces are as close as possible to the edge of the page.
[0261] It can be understood that, based on the technical means of the aforementioned handwriting editing implementation method, the writing application can also obtain a PDF file in which the handwriting can be edited again, in the case that the writing application does not open a PDF file. For example, after a user draws handwriting in the writing application by using a writing function (without opening a certain file, only writing), when the user selects to save as a PDF file, the writing application confirms all the handwriting in the current canvas (i.e., the entire area in which the handwriting can be drawn) as belonging to one page, and saves the handwriting according to the brush annotation type (the coordinate conversion can refer to the coordinate conversion manner of the aforementioned embodiment, only the second display height is deleted, and the first display height and the first display width are determined as the display height and the display width of the rectangular area containing all the elements currently to be saved), to obtain a PDF file. At this time, if there are other elements, such as pictures, graphics, or tables inserted by the user, in the canvas, the other elements form a picture and are saved in the PDF file.
[0262] An embodiment of the present application further provides a handwriting editing implementation device, which refers to Figure 1 The handwriting editing implementation device comprises a processor 11, a memory 12, and a display screen 13. The processor 11, the memory 12, and the display screen 13 can be connected through a bus or other manners. The display screen 13 comprises a display component and a touch component, the display component is used for display, and the touch component is used for receiving a touch operation; the memory 12 is used for storing one or more programs; when the one or more programs are executed by the one or more processors 11, the one or more processors 11 implement the handwriting editing implementation method in any of the aforementioned embodiments. The related content of each component can refer to the foregoing description.
[0263] The handwriting editing implementation device is used for executing any handwriting editing implementation method, has corresponding functions and beneficial effects, and the specific details not described herein can refer to the related description of the handwriting editing implementation method.
[0264] An embodiment of the present application further provides a storage medium containing computer executable instructions, which are used for executing the related operations in the handwriting editing implementation method provided in any embodiment of the present application when executed by a processor, and have corresponding functions and beneficial effects.
[0265] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product.
[0266] Accordingly, embodiments of the present application can be embodied in hardware and / or in software (including firmware, resident software, micro-code, etc.). Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable code. Embodiments of the present application are described in terms of methods, apparatus (systems), and computer program products embodied in computer-usable storage media (including, but not limited to, magnetic cassettes, diskettes, disks, tapes, optical storage media, etc.) according to one embodiment of the present application. It is to be understood that both the Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more blocks or combinations of one or more blocks in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks
[0267] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can implement information storage by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0268] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0269] It should be noted that the above are only preferred embodiments of the present application and the principles of technology used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for realizing handwriting editing, characterized by, The method comprises the following steps: receiving a writing instruction, the writing instruction being used to start a function of editing writing traces on first file content of a first PDF file, the first file content being displayed in a first window; generating a writing layer according to the writing instruction, and displaying a writing display area on the first window in an overlaid manner, the writing display area being a first area of the writing layer; replacing the first file content in the first window with second file content, and drawing corresponding writing traces in the writing layer according to first trace data in a set annotation format when the first PDF file comprises the first trace data in the set annotation format, the second file content being file content obtained after copying the first PDF file and not comprising the first trace data in the set annotation format; receiving a trace editing operation, the trace editing operation being performed on the writing display area; displaying corresponding writing traces in the writing display area according to the trace editing operation; receiving a file saving operation; generating second trace data in the set annotation format according to the writing traces in the writing layer; obtaining a second PDF file based on the second trace data and the second file content.
2. The handwriting editing implementation method according to claim 1, characterized in that, Before the receiving of the writing instruction, the method further comprises the following steps: in a whiteboard application interface, receiving a PDF file selection instruction, the PDF file selection instruction being used to select a first PDF file; generating a first window according to the PDF file selection instruction, and displaying first file content of the first PDF file in the first window.
3. The handwriting editing implementation method according to claim 1, characterized in that, The second file content comprises multiple pages of file sub-contents, the multiple pages of file sub-contents being able to be read continuously in the first window. After the displaying of the corresponding writing traces in the writing display area according to the trace editing operation, the method further comprises the following steps: receiving an area scrolling operation, the area scrolling operation being performed on the writing display area; scrolling the writing layer in the writing display area according to the area scrolling operation, so as to replace the writing display area from the first area of the writing layer to a second area of the writing layer, and scroll the second file content displayed in the first window, so as to realize the movement of the second file content following the movement of the writing traces.
4. The handwriting editing implementation method according to claim 2, wherein, After the receiving of the PDF file selection instruction in the whiteboard application interface, the method further comprises the following steps: copying the first PDF file according to the PDF file selection instruction to obtain a copy PDF file; finding first trace data in a set annotation format in the copy PDF file, and removing the first trace data in the set annotation format in the copy PDF file when the first trace data is found, taking file content obtained after the removal of the first trace data as the second file content, and taking file content of the copy PDF file as the second file content when the first trace data is not found.
5. The handwriting editing implementation method according to claim 4, wherein, The second file content comprises at least one page of file sub-contents. The method further comprises: searching for the first handwriting data in a set annotation format in the copy PDF file, and removing the first handwriting data in the set annotation format in the copy PDF file when the first handwriting data is found, taking the file content obtained after the first handwriting data is removed as the second file content, and taking the file content of the copy PDF file as the second file content when the first handwriting data is not found. generating a content picture according to the file sub-content, one content picture corresponding to one page of the file sub-content; The method further comprises: displaying the content picture corresponding to the second file content in the first window to replace the first file content with the second file content.
6. The handwriting editing implementation method according to claim 1, wherein, The first file content comprises multiple pages of file sub-content, the multiple pages of file sub-content are displayed page by page in the first window and can be read continuously, each page of the file sub-content has a corresponding first coordinate system, the first handwriting data at least comprises a first coordinate of each handwriting point in the writing handwriting in the corresponding first coordinate system, and there is a split line between adjacent pages of file sub-content when the first window displays the file sub-content of the adjacent pages. The method further comprises: obtaining a first display height and a first display width of the page on which the file sub-content is displayed in the first window, an actual height and an actual width of the page on which the file sub-content is located, and a second display height of the split line; determining a height scaling ratio according to the first display height and the actual height, and determining a width scaling ratio according to the first display width and the actual width; determining a display scaling ratio when the file sub-content is displayed in the first window according to the height scaling ratio and the width scaling ratio; determining a second coordinate of each handwriting point in a second coordinate system according to the display scaling ratio, the first coordinate of the handwriting point corresponding to the file sub-content, the first display height of the page on which the file sub-content is located, and the second display height, the second coordinate system being a coordinate system used by the writing layer, and the size of the writing layer being equal to the total size required when all pages in the second file content are displayed; drawing each handwriting point in the writing layer according to the second coordinate, and drawing the writing handwriting corresponding to the first handwriting data after all the handwriting points are drawn in the writing layer.
7. The handwriting editing implementation method according to claim 6, wherein, The origin of the first coordinate system is located at the lower left corner of the corresponding page, and the origin of the second coordinate system is located at the upper left corner of the writing layer, The method further comprises: multiplying the X-axis coordinate value in the first coordinate of the handwriting point corresponding to the file sub-content by the display scaling ratio to obtain the X-axis coordinate value of the handwriting point in the second coordinate system. The first value obtained by multiplying the Y-axis coordinate value in the first coordinate of the handwriting point corresponding to the file subcontent and the display zoom ratio, the second value obtained by subtracting the first display height of the file subcontent from the first value, and the sum value obtained by adding the second value and the third value, wherein the third value is the product of the fourth value and the fifth value, the fourth value is the sum of the first display height and the second display height of the file subcontent, and the fifth value is the page number of the file subcontent in the first PDF file minus 1, are taken as the Y-axis coordinate value of the handwriting point in the second coordinate system.
8. The handwriting editing implementation method according to claim 1, characterized in that, The second file content includes multiple file subcontents, and the multiple file subcontents are displayed in the first window in a single page and can be continuously read, and there is a split line between adjacent file subcontents when the first window displays the adjacent file subcontents. The second handwriting data in the set annotation format is generated according to the handwriting in the writing layer, and the method comprises the steps of: determining the handwriting belonging to the same page file subcontent; identifying the first handwriting point on the split line in the handwriting, and eliminating the first handwriting point; determining the fourth coordinate of each handwriting point in the corresponding file subcontent according to the third coordinate of each handwriting point in the writing layer in the writing layer, wherein each file subcontent has a corresponding first coordinate system, the writing layer uses a second coordinate system, and the size of the writing layer is equal to the total size required when all pages of the second file content are displayed; generating the second handwriting data in the set annotation format according to the fourth coordinate.
9. The handwriting editing implementation method according to claim 8, wherein, The handwriting belonging to the same page file subcontent is determined, and the method comprises the steps of: obtaining the first display height of the page where the file subcontent is displayed in the first window and the second display height of the split line; determining the page index to which each handwriting point belongs according to the fifth coordinate of each handwriting point in the writing layer in the writing layer, the first display height and the second display height; determining the handwriting belonging to the same page file subcontent according to the page index to which each handwriting point belongs and the writing order of each handwriting point.
10. The handwriting editing implementation method according to claim 9, wherein, The first handwriting point on the split line in the handwriting is identified, and the first handwriting point is eliminated, and the method comprises the steps of: determining the remainder of the Y-axis coordinate value in the fifth coordinate of the handwriting point and the first display height; multiplying the page index to which the handwriting point belongs minus 1 and the second display height to obtain a sixth value; determining a seventh value obtained by subtracting the remainder from the sixth value, and determining whether the seventh value is in a preset value range, wherein the preset value range refers to the value range between 0 and the second display height; if the seventh value is in the preset value range, the handwriting point is determined to be the first handwriting point on the split line and the first handwriting point is eliminated, and if the seventh value is not in the preset value range, the handwriting point is determined not to be on the split line and the handwriting point is retained.
11. The handwriting editing implementation method according to claim 9, wherein, The method further comprises: identifying a first handwriting point on the split line in the handwriting, and eliminating the first handwriting point; determining at least one group of handwriting that needs to be filled in, and traversing each handwriting point in the group of handwriting according to the writing order of each handwriting point; if the page index of the second handwriting point currently traversed is inconsistent with the page index of the third handwriting point previously traversed, determining a first connecting line formula between the second handwriting point and the third handwriting point according to a sixth coordinate of the second handwriting point in the writing layer and a seventh coordinate of the third handwriting point in the writing layer; determining an eighth coordinate of a first edge handwriting point corresponding to the same page as the second handwriting point and a ninth coordinate of a second edge handwriting point corresponding to the same page as the third handwriting point according to the first connecting line formula; 12. A handwriting editing implementing apparatus characterized by comprising: drawing the corresponding first edge handwriting point and second edge handwriting point in the writing layer according to the eighth coordinate and the ninth coordinate, and connecting the first edge handwriting point and the second handwriting point and connecting the second edge handwriting point and the third handwriting point. comprise: a display screen, one or more processors, and a memory; the memory is configured to store one or more programs; the display screen is configured to display; 13. A computer readable storage medium having stored thereon a computer program, characterized in that, when the one or more programs are executed by the one or more processors, the one or more processors implement the handwriting editing method as claimed in any one of claims 1-11. The computer program is executed by the processor to implement the handwriting editing method as claimed in any one of claims 1-11.