Specific embodiment
In being described below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specifically
The present invention can also be realized in the other embodiments of details.In other situations, omit to well-known system, device, electricity
Road and the detailed description of method, in case unnecessary details interferes description of the invention.
It it should be appreciated that ought be special described by the instruction of term " comprising " use in this specification and in the appended claims
Sign, entirety, step, operation, the presence of element and/or component, but be not precluded from one or more of the other feature, entirety, step,
Operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is
Refer to any combinations and all possible combinations of one or more of the associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determining " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Fig. 1 is the realization flow diagram of the creation method of pdf document textview field provided in an embodiment of the present invention, as schemed institute
It states, the method may include following steps:
Step S101 obtains all default objects in the pending page, and obtains the default object and wait to locate described
Manage the position in the page.
Wherein, the pending page can be the page for needing to create textview field in pdf document, in practical applications, at least
There are the pending pages of one page, can handle the pending page of every page respectively according to page number order, can also handle institute simultaneously
The pending page having.If handling the pending page of every page respectively according to page number order, the institute in the pending page is obtained
There is default object to refer to obtain all default objects in the currently pending page;If all pending pages are handled simultaneously
Face obtains all default objects in the pending page and refers to obtain all default pairs in the pending page of every page respectively
As.In other words, it is necessary to be grouped according to the pending page to default object, it is impossible to not pre- in the same pending page
If object is handled.
Wherein, presetting object includes following any one:Cell, horizontal line, radio box, check box.Need what is illustrated
It is that default object includes but not limited to each object listed above, is not specifically limited herein.
Step S102 extracts the pre- of the default object according to position of the default object in the pending page
If the text message in scope.
Wherein, the preset range for presetting object can be it is artificial preset, including:The inside of default object is preset
The surface of object, the front of default object, the left side of default object, the top of default object, default object underface,
The dead astern of default object.It should be noted that the preset range of default object includes but not limited to each model listed above
It encloses, is not specifically limited herein.In practical applications, it is necessary to be set according to actual conditions the preset range of default object, for example,
Default object is cell, can set the preset range of default object as the left side of cell or the top of cell.It needs
Illustrate, in order to meet conventional reading habit, user is facilitated to read pdf document, the preset range of the default object can
Be with face the visual angle of the user of pdf document come it is definite.
Step S103 is the default Object Creation textview field, and using the text message as the name of the textview field
Claim.
Optionally, it is described to obtain in the pending page if the default object to be obtained is cell referring to Fig. 2
All default objects, including:
Step S201 obtains all lines in the pending page, to all lines in the pending page
It is pre-processed, and the division form of the overlapping relation based on the pretreated lines.
Wherein, pretreatment can include any one of following:Classification, duplicate removal, connection, sequence.It should be noted that pretreatment
Various processing methods including but not limited to listed above, are not specifically limited herein.
In practical applications, all line classifications got, duplicate removal, connection, sequence are first done into standard for identification form
It is standby.Overlapping relation division form based on the pretreated lines can be the line that will intersect or be indirectly connected directly with one another
Item is divided into same form, that is, identifies form.
Step S202 determines table border line of the lines being divided into same form with the presence or absence of closing.
In practical applications, after form is identified, also need to judge whether this form is effective form, it can be by determining
The lines being divided into same form judge with the presence or absence of the mode of the table border line of closing.If it is divided into same form
There is the table border line of closing in interior lines, then it is effective form to illustrate the form identified;If it is divided into same form
For interior lines there is no the table border line of closing, then it is invalid form to illustrate the form identified.
Step S203 if the lines being divided into same form have the table border line of closing, obtains the form
Cell.
In practical applications, it is necessary to find out list out of this effective form after the form for determining to identify is effective form
First lattice can find cell by way of confirming the lines in effective form with the presence or absence of the form line of closing.
After finding out cell, also need to determine the ranks span of each cell, in order to determine the size of textview field.Need what is illustrated
It is that the form line of closing is different from the table border line closed, the table border line of closing can be the line for forming table border
Item, the form line of closing can be the lines of form Inner Constitution cell.
Further, the default object is extracted in the position according to the default object in the pending page
Preset range in text message, including:
Whether judge inside the cell comprising text message;
If not including text message inside the cell, it is adjacent to extract the cell in the pending page
Cell in text message.
In practical applications, if comprising text message inside cell, illustrate need not to be that the cell creates text
This domain;If not including text message in cell, illustrate to need to create textview field for the cell.Create textview field it
Before, it is thus necessary to determine that the textview field title of the cell, i.e., in the pending page in the adjacent cell of extraction unit lattice
Text message.The adjacent cell of cell can be the cell of on the left of cell or top.It is adjacent in extraction unit lattice
Cell text message after, textview field is created for the cell, and using the text message of extraction as text domain
Title.
Optionally, if the default object to be obtained is horizontal line, it is in the lines for determining to be divided into same form
After the no table border line that there is closing, further include:
Step S204 if the lines being divided into same form have the table border line of closing, obtains the form
Inside it is not belonging to the horizontal line of closing form line.
In practical applications, table border line of the lines being divided into same form with the presence or absence of closing is determined, if drawing
The table border line that the lines in same form have closing is assigned to, then it is effective form to illustrate the form;In effective form
There may be the cell for needing to create textview field, there may also be the horizontal lines for needing establishment textview field.In effective form
If there is the form line of closing, then illustrate that there are cells in effective form;If there is not closing in effective form
Form line, there may be horizontal lines in these form lines do not closed.So after effective form is identified, it can also be from this
The horizontal line for being not belonging to closing form line is obtained in effective form.
Further, the default object is extracted in the position according to the default object in the pending page
Preset range in text message, including:
According to the front position of horizontal line described in location determination of the horizontal line in the pending page
Or position directly below;
Extract the text message on the front position or position directly below of the horizontal line;
Described is the default Object Creation textview field, and using the text message as the title of the textview field, bag
It includes:
Textview field is created in the top of position of the horizontal line in the pending page, so that the textview field
Width and the horizontal line equal length;
Using the text message as the title of the textview field;
The horizontal line includes:Horizontal route object, continuous underscore character.
In practical applications, continuous underscore character can also regard horizontal line as.It obtains in the pending page
All lines include:Obtain all lines in the pending page, all continuous underscore words in the pending page of acquisition
Symbol.Continuous underscore character is specifically made of several continuous underscore characters and can not be limited herein taking human as presetting
It is fixed.
In addition, in practical applications, if the default object obtained is check box, since check box can be regarded as one
The form of very little, so the creation method of check box textview field may be referred to step S101-S103 and S201- in pdf document
Method described in S203.
For the creation method in PDF file digital signature domain, institute in step S101-S103 and S201-S204 is referred to
The creation method for the pdf document textview field stated, unlike, it is to make the text message extracted in the creation method of textview field
For the title of textview field, and it is text message using predetermined keyword is included in the creation method in digital signature domain as text
The title in domain.For example, in English pdf document, predetermined keyword can be set to " signature ", will include
Title of the text message of " signature " as textview field;In Chinese pdf document, predetermined keyword can be set to " label
Name ", will include the title of the text message as textview field of " signature ".
The embodiment of the present invention obtains the default object in institute by obtaining all default objects in the pending page
State the position in the pending page;The default object is extracted according to position of the default object in the pending page
Preset range in text message;For the default Object Creation textview field, and using the text message as the text
The title in domain;It realizes and automatically generates cell textview field and horizontal line textview field for pdf document, solve in the prior art
Manually addition form fields size, position be inaccurate and the problem of heavy workload.
Fig. 3 is the realization flow diagram of the creation method for the pdf document textview field that further embodiment of this invention provides, such as
Shown in figure, if the default object obtained is radio box, all default objects obtained in the pending page further include:
Step S301 obtains all roads being made of four sections of end to end Beziers in the pending page
Footpath object.
In practical applications, judge path objects whether by four sections of end to end Beziers form can include with
Lower step:Whether the point for judging to form path objects is 13;If forming the point of path objects as 13, the path is judged
Whether whether the starting point of object include comprising Move To marks, remaining point comprising Bezier To marks, terminal
Close Figure indicate.Wherein, Move To marks, Bezier To marks, Close Figure marks can be in program
Instruction.
Step S302 judges whether each section of Bezier in the path objects is 1/4 arc section.
Step S303, if each section of Bezier of the path objects is 1/4 arc section, by the path pair
As being defined as first kind radio box, and obtain the first kind radio box.
Further, the default object is extracted in the position according to the default object in the pending page
Preset range in text message, including:
According to first kind radio box described in location determination of the first kind radio box in the pending page just
Rear position;
Extract the text message on the dead astern position of the first kind radio box;
Described is the default Object Creation textview field, and using the text message as the title of the textview field, tool
Body is:
Textview field is created for the first kind radio box, and using the text message as the title of the textview field.
Step S304, if abandoning the path in the presence of the Bezier for not being 1/4 arc section in the path objects
Object.
Optionally, it is described to obtain owning in the pending page if the default object obtained is radio box referring to Fig. 4
Default object, further includes:
Step S401 obtains all text objects in the pending page;
Step S402 judges to whether there is preset characters in the text object;
The character definition is the second class radio box if there are preset characters in the text object by step S403, and
Obtain the second class radio box.
In practical applications, preset characters can be that character shape is the circular or Unicode identical with radio box shape
Code or ASCII character.In other words, the shape of some text objects is circular or, such text object identical with radio box shape,
Such as Unicode codes, ASCII character, radio box can be regarded as.It should be noted that preset characters are not limited to Unicode, ASCII
Code, is not especially limited herein.
Further, the default object is extracted in the position according to the default object in the pending page
Preset range in text message, be specially:
The adjacent bit of the second class radio box is extracted according to position of the second class radio box in the pending page
The text message put;
Described is the default Object Creation textview field, and using the text message as the title of the textview field, tool
Body is:
Textview field is created for the second class radio box, and using the text message as the title of the textview field.
Wherein, the adjacent position of the second class radio box can be included any one of following:The
Front, dead astern, surface, the underface of two class radio boxes.It is not specifically limited herein.
Further, for the default Object Creation textview field, and using the text message as the textview field
After title, including:
The radio box is grouped according to position of the radio box in the pending page.
In practical applications, it is title category in order to ensure the radio box textview field in same group radio box to be grouped
Uniterming mutual exclusion in same category and/or same group.Such as:In effective form, text message " payment frequency " is residing
The dead astern of position is arranged in sequence with 3 radio boxes, and the title of each radio box textview field is respectively " daily ", " monthly ", " often
Year ";This 3 radio boxes can be divided into one group according to this position of 3 radio boxes in the pending page, this 3 radio boxes
The title of textview field belongs to same category, i.e. " payment frequency ", and this 3 uniterming mutual exclusions.
The embodiment of the present invention obtains the default object in institute by obtaining all default objects in the pending page
State the position in the pending page;The default object is extracted according to position of the default object in the pending page
Preset range in text message;For the default Object Creation textview field, and using the text message as the text
The title in domain;It realizes and automatically generates radio box textview field for pdf document, it is big to solve artificial addition form fields in the prior art
Small, position is inaccurate and the problem of heavy workload.
It is to be understood that the size of the sequence number of each step is not meant to the priority of execution sequence, each process in above-described embodiment
Execution sequence should determine that the implementation process without tackling the embodiment of the present invention forms any limit with its function and internal logic
It is fixed.
Fig. 5 is the schematic diagram of the creating device of pdf document textview field provided in an embodiment of the present invention, for convenience of description,
It illustrates only and the relevant part of the embodiment of the present invention.
The creating device 5 of the pdf document textview field includes:
Acquiring unit 51 for obtaining all default objects in the pending page, and obtains the default object in institute
State the position in the pending page;
Extraction unit 52, for described default pair of the position extraction according to the default object in the pending page
Text message in the preset range of elephant;
Creating unit 53, for for the default Object Creation textview field, and using the text message as the text
The title in domain.
Optionally, the acquiring unit 51 includes:
Preprocessing module, for obtaining all lines in the pending page, to the institute in the pending page
There are lines to be pre-processed, and the division form of the overlapping relation based on the pretreated lines;
Determining module, for determining table border line of the lines being divided into same form with the presence or absence of closing;
Cell acquisition module if the lines for being divided into same form have the table border line of closing, obtains
Take the cell of the form;
Further, the extraction unit 52 includes:
Judgment module, for whether judging inside the cell comprising text message;
Extraction module if for not including text message inside the cell, extracts in the pending page
Text message in the adjacent cell of the cell.
Optionally, the acquiring unit 51 further includes:
Horizontal line acquisition module, for the form side in the lines for determining to be divided into same form with the presence or absence of closing
After wire, if the lines being divided into same form have the table border line do not closed, obtain and do not belong in the form
In the horizontal line of closing form line;
The horizontal line includes:Horizontal route object, continuous underscore character.
Optionally, the acquiring unit 51 further includes:
Path objects acquisition module, it is all by four sections of end to end Bezier in the pending page for obtaining
The path objects of curve composition;
Arc section judgment module, for judging whether each section of Bezier in the path objects is 1/4 circular arc
Section;
First definition module, if being 1/4 arc section for each section of Bezier of the path objects, by institute
It states path objects and is defined as first kind radio box, and obtain the first kind radio box;
Discard module, if in the path objects exist be not 1/4 arc section Bezier, abandon described in
Path objects.
Optionally, the acquiring unit 51 further includes:
Text object acquisition module, for obtaining all text objects in the pending page;
Code value judgment module, for judging to whether there is preset characters in the text object;
Second definition module, if in the text object there are preset characters, be the second class by the character definition
Radio box, and obtain the second class radio box.
Further, the creating device 5 further includes:
Grouped element, for for the default Object Creation textview field, and using the text message as the text
After the title in domain, the radio box is grouped according to position of the radio box in the pending page.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work(
Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion
The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used
To be that unit is individually physically present, can also two or more units integrate in a unit, it is above-mentioned integrated
The form that hardware had both may be employed in unit is realized, can also be realized in the form of SFU software functional unit.In addition, each function list
Member, the specific name of module are not limited to the protection domain of the application also only to facilitate mutually distinguish.Above system
The specific work process of middle unit, module may be referred to the corresponding process in preceding method embodiment, and details are not described herein.
Fig. 6 is the schematic diagram of terminal device provided in an embodiment of the present invention.As shown in fig. 6, the terminal device 6 of the embodiment
Including:Processor 60, memory 61 and it is stored in the calculating that can be run in the memory 61 and on the processor 60
Machine program 62.The processor 60 realizes the establishment side of above-mentioned each pdf document textview field when performing the computer program 62
Step in method embodiment, such as step S101 to S107 shown in FIG. 1.Alternatively, the processor 60 performs the computer
The function of each module/unit in above-mentioned each device embodiment, such as the function of module 51 to 53 shown in Fig. 5 are realized during program 62.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 61, and are performed by the processor 60, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 62 in the terminal device 6 is described.For example, the computer program 62 can be divided
Acquiring unit, extraction unit, creating unit are cut into, each unit concrete function is as follows:
Acquiring unit for obtaining all default objects in the pending page, and obtains the default object described
Position in the pending page;
Extraction unit, for extracting the default object according to position of the default object in the pending page
Preset range in text message;
Creating unit, for for the default Object Creation textview field, and using the text message as the textview field
Title.
Optionally, the acquiring unit includes:
Preprocessing module, for obtaining all lines in the pending page, to the institute in the pending page
There are lines to be pre-processed, and the division form of the overlapping relation based on the pretreated lines;
Determining module, for determining table border line of the lines being divided into same form with the presence or absence of closing;
Cell acquisition module if the lines for being divided into same form have the table border line of closing, obtains
Take the cell of the form;
Further, the extraction unit includes:
Judgment module, for whether judging inside the cell comprising text message;
Extraction module if for not including text message inside the cell, extracts in the pending page
Text message in the adjacent cell of the cell.
Optionally, the acquiring unit further includes:
Horizontal line acquisition module, for the form side in the lines for determining to be divided into same form with the presence or absence of closing
After wire, if the lines being divided into same form have the table border line do not closed, obtain and do not belong in the form
In the horizontal line of closing form line;
The horizontal line includes:Horizontal route object, continuous underscore character.
Optionally, the acquiring unit further includes:
Path objects acquisition module, it is all by four sections of end to end Bezier in the pending page for obtaining
The path objects of curve composition;
Arc section judgment module, for judging whether each section of Bezier in the path objects is 1/4 circular arc
Section;
First definition module, if being 1/4 arc section for each section of Bezier of the path objects, by institute
It states path objects and is defined as first kind radio box, and obtain the first kind radio box;
Discard module, if in the path objects exist be not 1/4 arc section Bezier, abandon described in
Path objects.
Optionally, the acquiring unit further includes:
Text object acquisition module, for obtaining all text objects in the pending page;
Code value judgment module, for judging to whether there is preset characters in the text object;
Second definition module, if in the text object there are preset characters, be the second class by the character definition
Radio box, and obtain the second class radio box.
Further, the creating device further includes:
Grouped element, for for the default Object Creation textview field, and using the text message as the text
After the title in domain, the radio box is grouped according to position of the radio box in the pending page.
The terminal device 6 can be that the calculating such as desktop PC, notebook, palm PC and cloud server are set
It is standby.The terminal device may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6
The only example of terminal device 6 does not form the restriction to terminal device 6, can include than illustrating more or fewer portions
Part either combines some components or different components, such as the terminal device can also include input-output equipment, net
Network access device, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng.
The memory 61 can be the internal storage unit of the terminal device 6, such as the hard disk of terminal device 6 or interior
It deposits.The memory 61 can also be the External memory equipment of the terminal device 6, such as be equipped on the terminal device 6
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, the memory 61 can also both include the storage inside list of the terminal device 6
Member also includes External memory equipment.The memory 61 is used to store needed for the computer program and the terminal device
Other programs and data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
In the above-described embodiments, all emphasize particularly on different fields to the description of each embodiment, be not described in detail or remember in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is performed with hardware or software mode, specific application and design constraint depending on technical solution.Professional technician
Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, is only a kind of division of logic function, there can be other dividing mode in actual implementation, such as
Multiple units or component may be combined or can be integrated into another system or some features can be ignored or does not perform.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device
Or the INDIRECT COUPLING of unit or communication connection, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical location, you can be located at a place or can also be distributed to multiple
In network element.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
That unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list
The form that hardware had both may be employed in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit realized in the form of SFU software functional unit and be independent production marketing or
In use, it can be stored in a computer read/write memory medium.Based on such understanding, the present invention realizes above-mentioned implementation
All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method..Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or some intermediate forms etc..Computer-readable Jie
Matter can include:Can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disc, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It is it should be noted that described
The content that computer-readable medium includes can carry out appropriate increasing according to legislation in jurisdiction and the requirement of patent practice
Subtract, such as in some jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and
Telecommunication signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to foregoing reality
Example is applied the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to foregoing each
Technical solution recorded in embodiment modifies or carries out equivalent substitution to which part technical characteristic;And these are changed
Or replace, the essence of appropriate technical solution is not made to depart from the spirit and scope of various embodiments of the present invention technical solution, it should all
It is included within protection scope of the present invention.