A method of entering handwritten form data into a PDF electronic form

By combining optical character recognition and coordinate system construction with masked form field technology, the problem of handwritten form data being unrecognizable and handwriting preserved in PDF electronic forms has been solved, achieving both data processing capability and consistent appearance.

CN117558013BActive Publication Date: 2026-05-22FUJIAN FOXIT SOFTWARE DEV LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN FOXIT SOFTWARE DEV LTD
Filing Date
2022-08-05
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing technologies cannot accurately recognize handwritten form data as computer-readable characters and cannot preserve the user's handwriting, resulting in electronic forms looking inconsistent with handwritten forms and data that cannot be processed by applications.

Method used

By using optical character recognition to obtain strings and character positions in PDF electronic forms, constructing a page coordinate system, calculating the physical coordinates of input form fields, creating masked form fields, and adding PDF scripts, the system achieves computer-readable characters and handwriting preservation.

Benefits of technology

It enables the preservation of the user's original handwriting in PDF electronic forms while allowing the data to be processed by the application, ensuring that the electronic form looks consistent with the paper form.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003784298840000011
    Figure HDA0003784298840000011
  • Figure HDA0003784298840000012
    Figure HDA0003784298840000012
Patent Text Reader

Abstract

A method for entering handwritten form data into a PDF electronic form, which first converts a paper form into a PDF electronic form, then constructs a mask form field according to the range of manually filled characters on the PDF page, and then adds corresponding PDF scripts to the mask form field and the input form field in the PDF electronic form respectively, the execution content of the PDF script of the mask form field being that if a user clicks the mask form field, the mask form field disappears and the input form field below the mask form field is automatically focused and enters an editing state, and after the user exits the editing, the mask form field is displayed again; the execution content of the PDF script of the input form field being that after the focus is obtained, the mask form field is hidden, and after the focus is lost, the mask form field is displayed again. The application can not only retain the original input handwriting of the user and ensure that the appearance of the electronic form is highly consistent with that of the filled paper form, but also ensure that the content input by the user can be processed by the background application program of the electronic form.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of PDF document processing, and more specifically, to a method for inputting handwritten form data into a PDF electronic form. Background Technology

[0002] Optical Character Recognition (OCR) is the process of converting images of typed, handwritten, or printed text into machine-coded text using electronic or mechanical means. It can extract meaningful text characters from scanned documents, photographs of documents, scene photographs, or subtitles superimposed on images. OCR is the process of analyzing and recognizing image files of textual materials to obtain text and layout information.

[0003] The following are some common methods for converting handwritten forms into PDF electronic forms:

[0004] (1) Use a scanner to scan the user's handwritten form and convert it into an image. Then, directly convert the image file into a PDF document and archive it as the final electronic form.

[0005] (2) Use a scanner to scan the user's handwritten form and convert it into an image. Then, perform optical character recognition on the form area where the user's handwritten input is entered to identify the user's written text content. Then, automatically fill the corresponding form field of the original electronic form with the result of optical character recognition and finally generate a PDF electronic form file containing the user's input data.

[0006] The problems with scheme (1) are as follows:

[0007] The text data entered by the user cannot be read and processed by the electronic form application because the original electronic form and the user input content have been converted into images. The data information of the document has been visualized and is difficult for the application to obtain.

[0008] The problems with scheme (2) are as follows:

[0009] The appearance of handwritten text cannot be preserved, and all input text will be displayed using a uniform font. All user input will be displayed using the same font, making it impossible to restore the user's unique "handwriting". For example, in contract forms, it may be desirable to preserve the user's handwriting, which cannot be achieved with solution (2). Summary of the Invention

[0010] This invention provides a method for inputting handwritten form data into a PDF electronic form, thereby solving the problems existing in the prior art.

[0011] To achieve the above objectives, the present invention provides a method for inputting handwritten form data into a PDF electronic form, comprising:

[0012] S1: The user manually fills out a paper form;

[0013] S2: Digitize the paper form completed by the user to obtain the corresponding PDF electronic form;

[0014] S3: Perform optical character recognition on the PDF electronic form to obtain the string in the PDF electronic form and the position of each character;

[0015] S4: Construct a page coordinate system for the PDF electronic form, and obtain the coordinates of the input form field of the PDF electronic form in the page coordinate system;

[0016] S5: Calculate the coordinates of the input form field in the physical coordinate system;

[0017] S6: Construct a user input area and initialize it. The range of the initialized user input area is the same as the range of the input form field.

[0018] S7: Traverse each character in the string obtained in step S3. The traversal rules are as follows: For each character, if the physical coordinates of the character's location intersect with the physical coordinates of the input form field, then the area where the character is located is further included in the user input area until all characters in the string have been traversed.

[0019] S8: Based on the user input area obtained in step S7, create a mask form field on the page of the PDF electronic form that corresponds to the input form field, and define the type of the mask form field as "button";

[0020] S9: Define the value of the input form field as the string obtained in step S3;

[0021] S10: Extract the image corresponding to the masked form field from the PDF electronic form and set it as the appearance of the masked form field;

[0022] S11: Add a PDF script to the masked form field. The PDF script of the masked form field executes as follows: if the user clicks on the masked form field, the masked form field disappears and the input form field below the masked form field is automatically focused and enters the editing state. After the user exits the editing, the masked form field is redisplayed.

[0023] S12: Add a PDF script to the input form field. The PDF script of the input form field executes as follows: hide the masked form field after gaining focus, and redisplay the masked form field after losing focus.

[0024] In one embodiment of the present invention, the paper form has at least one table, and correspondingly, the electronic form has at least one input form field.

[0025] In one embodiment of the present invention, the electronic processing of the paper form in step S2 is performed by a scanner.

[0026] The method for inputting handwritten form data into a PDF electronic form provided by this invention can preserve the user's original handwriting, ensuring that the appearance of the electronic form is highly consistent with the appearance of the filled-out paper form, while also ensuring that the content entered by the user can be processed by the background application of the electronic form. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a schematic diagram of a masked form field according to an embodiment of the present invention;

[0029] Figure 2 This is a schematic diagram of an input form field according to an embodiment of the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] When a user manually fills out a paper form, existing methods for converting handwritten forms into PDF electronic forms can only convert the user's input into images, and cannot recognize the characters entered as computer-readable characters. Alternatively, they can only recognize the handwritten content as computer-readable characters, but cannot preserve the user's handwriting. This invention overcomes the shortcomings of existing technologies by recognizing the characters entered by the user as computer-readable characters while preserving the user's original handwriting.

[0032] An embodiment of the present invention provides a method for inputting handwritten form data into a PDF electronic form, comprising:

[0033] S1: The user manually fills out a paper form;

[0034] Paper forms are typically created by users on a computer, such as using document processing software capable of creating tables, like Word or Excel, and then printed out. Alternatively, paper forms can also be drawn manually by users. This invention does not limit the initial source of paper forms; any form that has a header and table content and can present data or content in one or more rows / columns falls under the category of forms in this invention.

[0035] S2: Digitize the paper form completed by the user to obtain the corresponding PDF electronic form;

[0036] Converting paper forms to PDF electronic forms is generally achieved by scanning. For example, you can use a scanner to scan the form and define the output format as PDF to obtain the PDF electronic form corresponding to the previous step.

[0037] S3: Perform optical character recognition on the PDF electronic form to obtain the string in the PDF electronic form and the position of each character;

[0038] Optical Character Recognition (OCR) is the most commonly used character recognition technology. It can recognize strings in PDF electronic forms and the location of each character, making it easier to process each character in the string in subsequent steps.

[0039] In this step, the accuracy of optical character recognition is closely related to the clarity of the handwriting when the user manually fills in the information in step S1. The clearer and neater the handwriting, the more accurate the recognition. It should also be noted that even if the handwriting filled in by the user is inaccurate or unclear, resulting in recognition errors or omissions, the present invention can correct them in subsequent steps, which will be explained in detail below.

[0040] S4: Construct a page coordinate system for the PDF electronic form, and obtain the coordinates of the input form field of the PDF electronic form in the page coordinate system;

[0041] The page coordinate system is generally constructed with the bottom left corner of the page as the origin, the bottom edge of the page as the X-axis, and the left edge of the page as the Y-axis.

[0042] An input form field refers to an independent table area. In a paper form, there can be one table or multiple independent tables. Each independent table area corresponds to one input form field. Therefore, there can also be one or more input form fields. When there are multiple input form fields, the subsequent process can be executed for each input form field separately.

[0043] S5: Calculate the coordinates of the input form field in the physical coordinate system;

[0044] If the physical coordinate system and the page coordinate system are the same, this step is not required; otherwise, this step is required.

[0045] S6: Construct a user input area and initialize it. The range of the initialized user input area is the same as the range of the input form field.

[0046] S7: Traverse each character in the string obtained in step S3. The traversal rules are as follows: For each character, if the physical coordinates of the character's location intersect with the physical coordinates of the input form field, then the area where the character is located is further included in the user input area until all characters in the string have been traversed.

[0047] The purpose of steps S6 and S7 is to identify which specific areas the user has handwritten. Because when a user inputs by hand, due to personal habits, table height / width, and other factors, the content handwritten by the user may not all be within the area defined by the table lines. In order to avoid missing any handwritten content, these two steps are used to perform a comprehensive check, ensuring that all areas containing the user's handwritten characters are included in the user input area.

[0048] S8: Based on the user input area obtained in step S7, create a mask form field on the page of the PDF electronic form that corresponds to the input form field, and define the type of the mask form field as "button";

[0049] Based on the way the covered form fields are generated, it can be seen that the area covers the entire user handwriting area.

[0050] S9: Define the value of the input form field as the string obtained in step S3;

[0051] S10: Extract the image corresponding to the masked form field from the PDF electronic form and set it as the appearance of the masked form field;

[0052] S9 and S10 define two main properties of masked form fields: value and appearance. The "value" is a computer-readable string, and the "appearance" ensures that the user's handwriting is preserved.

[0053] S11: Add a PDF script to the masked form field. The PDF script of the masked form field executes as follows: if the user clicks on the masked form field, the masked form field disappears and the input form field below the masked form field is automatically focused and enters the editing state. After the user exits the editing, the masked form field is redisplayed.

[0054] S12: Add a PDF script to the input form field. The execution content of the PDF script of the input form field is: hide the mask form field after getting focus and redisplay the mask form field after losing focus.

[0055] Steps S11 and S12 complete the script addition process. The PDF electronic form realizes corresponding presentations according to the user's manual operations. Among them, if the characters identified in step S3 are incorrect or missing, the user can click on the mask form field. At this time, the input form field will be displayed and enter the editing state. The user can manually correct the incorrect characters or add the unrecognized characters.

[0056] Figure 1 It is a schematic diagram of the mask form field according to an embodiment of the present invention. Figure 2 It is a schematic diagram of the input form field according to an embodiment of the present invention. As Figure 1 、 Figure 2 shown, the item manually filled in by the user is "Nationality", and the content manually filled in is "China". It can be seen that the area where the user manually fills in exceeds the underline area of the form. At this time, the mask form field identified by the present invention includes all the areas (gray shaded areas) covered by the characters manually filled in by the user. If the user clicks on this mask form field at this time, the input form field below it will be displayed. As Figure 2 shown, since the handwriting of this user is clear and distinguishable, it can be clearly recognized that the handwritten content is the Chinese characters "China". The vertical line "︱" behind is the cursor prompt, which flashes to prompt the user's current input position. After the user exits the editing state, what is presented is Figure 1 , showing the user's original input handwriting.

[0057] The method for entering handwritten form data into a PDF electronic form provided by the present invention can not only retain the user's original input handwriting, ensure that the appearance of the electronic form is highly consistent with the appearance of the filled paper form, but also ensure that the content input by the user can be processed by the background application program of the electronic form.

[0058] Those of ordinary skill in the art can understand that: The drawings are only schematic diagrams of an embodiment, and the modules or processes in the drawings are not necessarily essential for implementing the present invention.

[0059] Those of ordinary skill in the art can understand that: The modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be correspondingly changed and located in one or more devices different from this embodiment. The modules in the above embodiments can be combined into one module, or can be further split into multiple sub - modules.

[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for inputting handwritten form data into a PDF electronic form, characterized in that, include: S1: The user manually fills out a paper form; S2: Digitize the paper form completed by the user to obtain the corresponding PDF electronic form; S3: Perform optical character recognition on the PDF electronic form to obtain the string in the PDF electronic form and the position of each character; S4: Construct a page coordinate system for the PDF electronic form, and obtain the coordinates of the input form field of the PDF electronic form in the page coordinate system; S5: Calculate the coordinates of the input form field in the physical coordinate system; S6: Construct a user input area and initialize it. The range of the initialized user input area is the same as the range of the input form field. S7: Traverse each character in the string obtained in step S3. The traversal rules are as follows: For each character, if the physical coordinates of the character's location intersect with the physical coordinates of the input form field, then the area where the character is located is further included in the user input area until all characters in the string have been traversed. S8: Based on the user input area obtained in step S7, create a mask form field on the page of the PDF electronic form that corresponds to the input form field, and define the type of the mask form field as "button"; S9: Define the value of the input form field as the string obtained in step S3; S10: Extract the image corresponding to the masked form field from the PDF electronic form and set it as the appearance of the masked form field; S11: Add a PDF script to the masked form field. The PDF script of the masked form field executes as follows: if the user clicks on the masked form field, the masked form field disappears and the input form field below the masked form field is automatically focused and enters the editing state. After the user exits the editing, the masked form field is redisplayed. S12: Add a PDF script to the input form field. The PDF script of the input form field executes as follows: hide the masked form field after gaining focus, and redisplay the masked form field after losing focus.

2. The method for inputting handwritten form data into a PDF electronic form according to claim 1, characterized in that, The paper form has at least one table, and the electronic form has at least one input form field.

3. The method for inputting handwritten form data into a PDF electronic form according to claim 1, characterized in that, In step S2, the paper form is digitized using a scanner.