Summary of the invention
To solve the above-mentioned problems, the embodiment of the invention discloses a kind of page display method and device, particular technique sides
Case is as follows:
A kind of page display method, including:
Obtain at least two pages of destination document;
The content width and page width of the accessed each page of measurement, for any one page in each page
Face, page width and content width to the page carry out difference operation, obtain the left and right distance values of the page;
From obtained left and right distance values, the smallest left and right distance values are selected, and will be with the page in destination document
Left and right boundary at a distance of be respectively the smallest left and right distance values and the straight line parallel with the left and right boundary of the page be determined as it is left and right
Cutting wires;
Along fixed cutting wires, cutting edge processing is carried out to the page in destination document;
The page for being dismissed side is shown;
Wherein, left distance values are the distance value of the left margin of the content of the page and the page left margin of the page, right spacing
Value is the distance value of the right margin of the content of the page and the page right margin of the page, and left and right cutting wires are for target text
Any page in shelves carries out the cutting wires of left and right cutting edge processing.
Optionally, further including before carrying out cutting edge processing to the page in destination document along fixed cutting wires:
The header information for extracting the accessed page, the position of the lower boundary of header is determined according to the header information extracted
It sets, and by the following boundary line of header, is determined as upper cutting wires;
Wherein, the upper cutting wires are the cutting wires for carrying out upper cutting edge processing to any page in destination document.
Optionally, further including before carrying out cutting edge processing to the page in destination document along fixed cutting wires:
For any one page in accessed each page, the content in the beginning of the page region of the page is scanned;
The beginning of the page region is for the apical position and area size positioned at the page:The region of the preset ratio value of page-size *;
The quantity M of the identical page of beginning of the page region content is counted, and according to probability value calculation formula P=M/N, is calculated:
Destination probability value, N are the sum of the accessed page;
In the case where the destination probability value is not less than preset probability threshold value, by the following boundary line in beginning of the page region, really
It is set to cutting wires;
Wherein, the upper cutting wires are the cutting wires for carrying out upper cutting edge processing to any page in destination document.
Optionally, further including before carrying out cutting edge processing to the page in destination document along fixed cutting wires:
The footer information for extracting the accessed page, the position of the coboundary of footer is determined according to the footer information extracted
It sets, and by the upper border line of footer, is determined as lower cutting wires;
Wherein, the lower cutting wires are the cutting wires for carrying out lower cutting edge processing to any page in destination document.
Optionally, further including before carrying out cutting edge processing to the page in destination document along fixed cutting wires:
By with the lower horizontal line of the page in the destination document be apart preset distance value and with the lower horizontal line
Parallel straight line is determined as lower cutting wires;
Wherein, the lower cutting wires are the cutting wires for carrying out lower cutting edge processing to any page in destination document.
Optionally, which is characterized in that the method also includes:
The location information of the page for having been dismissed side or the fixed cutting wires is saved.
Optionally, described that the page for being dismissed side is shown, including:
According to the triggering command of user, the page for being dismissed side is shown.
A kind of page display device, including:
Page acquisition module, for obtaining at least two pages of destination document;
Difference operation module, for measuring the content width and page width of accessed each page, for described each
Any one page in the page carries out difference operation to the page width of the page and content width, obtain the page a left side,
Right distance values;
First cutting wires determining module, for selecting the smallest left and right spacing from obtained left and right distance values
Value, and will with the left and right boundary of the page in destination document at a distance of be respectively the smallest left and right distance values and with the left and right side of the page
The parallel straight line in boundary is determined as left and right cutting wires;
Page cutting edge module, for carrying out cutting edge processing to the page in destination document along fixed cutting wires;
Page display module, for being shown to the page for being dismissed side;
Wherein, left distance values are the distance value of the left margin of the content of the page and the page left margin of the page, right spacing
Value is the distance value of the right margin of the content of the page and the page right margin of the page, and left and right cutting wires are for target text
Any page in shelves carries out the cutting wires of left and right cutting edge processing.
Optionally, described device further includes:
Second cutting wires determining module, for extracting the header information of the accessed page, according to the header extracted
Information determines the position of the lower boundary of header, and by the following boundary line of header, is determined as upper cutting wires;
Wherein, the upper cutting wires are the cutting wires for carrying out upper cutting edge processing to any page in destination document.
Optionally, described device further includes:
Third cutting wires determining module, for being directed to any one page in accessed each page, to the page
The content in beginning of the page region is scanned;The beginning of the page region is for the apical position and area size positioned at the page:The page is big
The region of the small preset ratio value of *;
The quantity M of the identical page of beginning of the page region content is counted, and according to probability value calculation formula P=M/N, is calculated:
Destination probability value, N are the sum of the accessed page;
In the case where the destination probability value is not less than preset probability threshold value, by the following boundary line in beginning of the page region, really
It is set to cutting wires;
Wherein, the upper cutting wires are the cutting wires for carrying out upper cutting edge processing to any page in destination document.
Optionally, described device further includes:
4th cutting wires determining module, for extracting the footer information of the accessed page, according to the footer extracted
Information determines the position of the coboundary of footer, and by the upper border line of footer, is determined as lower cutting wires;
Wherein, the lower cutting wires are the cutting wires for carrying out lower cutting edge processing to any page in destination document.
Optionally, described device further includes:
5th cutting wires determining module, for that apart will be preset with the lower horizontal line of the page in the destination document
Distance value and the straight line parallel with the lower horizontal line, are determined as lower cutting wires;
Wherein, the lower cutting wires are the cutting wires for carrying out lower cutting edge processing to any page in destination document.
Optionally, described device further includes:
Preserving module is carried out for the location information to the page for having been dismissed side or the fixed cutting wires
It saves.
Optionally, the page display module, is specifically used for:
According to the triggering command of user, the page for being dismissed side is shown.
Using above-mentioned technical proposal, page display method and device provided in an embodiment of the present invention are obtaining destination document
At least two pages after, the content width and page width of accessed each page can be measured, for each page
Any one page in face, page width and content width to the page carry out difference operation, obtain the left and right of the page
Distance values;And from obtained left and right distance values, the smallest left and right distance values are selected, and will be with the page in destination document
Left and right boundary at a distance of be respectively the smallest left and right distance values and the straight line parallel with the left and right boundary of the page be determined as it is left and right
Cutting wires;Then along fixed cutting wires, cutting edge processing is carried out to the page in destination document, and to the page for being dismissed side
Face is shown.
The embodiment of the present invention can dismiss the left and right white space in document file page, therefore, can as far as possible to text
Shelves subject content related content is shown, brings biggish reading convenience for user.
Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in the present invention, implement below in conjunction with the present invention
Attached drawing in example, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment
Only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, the common skill in this field
Art personnel every other embodiment obtained without creative efforts belongs to the model that the present invention protects
It encloses.
The rapid development of mobile terminal technology is obtained increasingly using the mobile devices reading documents such as mobile phone, tablet computer
The favor of multi-user.Due in electronic document would generally comprising some with the electronic document incoherent content of theme, such as
Page back gauge, headerfooter etc., these contents will affect the reading of user.To solve the above-mentioned problems, the embodiment of the present invention mentions
A kind of page display method and device are gone out.
A kind of page display method provided in an embodiment of the present invention is introduced first below.
As shown in Figure 1a, a kind of page display method provided in an embodiment of the present invention may include:
S101 obtains at least two pages of destination document.
Specifically, in one embodiment of the invention, above-mentioned S101 may include:
Obtain whole pages of destination document;
Or
The page of present count magnitude in destination document is obtained, for example obtains before destination document page 5 of the page.
S102 measures the content width and page width of accessed each page, for any in each page
One page, page width and content width to the page carry out difference operation, obtain the left and right distance values of the page.
Left distance values in the embodiment of the present invention be the left margin of the content of the page and the page left margin of the page away from
From value, right distance values are the distance value of the right margin of the content of the page and the page right margin of the page.
In order to make it easy to understand, being illustrated in conjunction with example:The page as shown in Figure 1 b is the page comprising actual content
Face, the width of the page are the distance between left margin and right margin of the page, the content of pages width for the page content institute
The width accounted for, page width and content width to the page carry out after difference operation, so that it may obtain the left spacing in figure
Numerical value and right spacing numerical value.
S103 selects the smallest left and right distance values from obtained left and right distance values, and will in destination document
The left and right boundary of the page is at a distance of respectively the smallest left and right distance values and the straight line parallel with the left and right boundary of the page is determined as
Left and right cutting wires;Wherein, left and right cutting wires are the sanction for carrying out left and right cutting edge processing to any page in destination document
Trimming.
For example S101 has got 5 pages, does difference operation to the page width and content width of above-mentioned 5 pages
Afterwards, 5 left distance values, 5 right distance values are obtained;It, can be from having obtained in view of the content in the display page as much as possible
Left and right distance values in, choose the smallest left and right distance values;
Assuming that the left and right distance values of the page in Fig. 1 b are above-mentioned the smallest left and right distance values;At this point, the left side in Fig. 1 b
Dotted line is left cutting wires, and the right dotted line in Fig. 1 b is right cutting wires.
S104 carries out cutting edge processing to the page in destination document along fixed cutting wires.
S105 shows the page for being dismissed side.
Optionally, in one embodiment of the invention, above-mentioned S105 may include:
After carrying out cutting edge processing to the page in destination document, directly the page for being dismissed side is shown.
Optionally, in another embodiment of the present invention, above-mentioned S105 may include:
According to the triggering command of user, the page for being dismissed side is shown.
The page for being dismissed side is carried out specifically, user can trigger electronic equipment by way of triggering command
Display.
It can be seen that page display method provided in an embodiment of the present invention, at least two pages for obtaining destination document
Later, the content width and page width that accessed each page can be measured, for any one in each page
The page, page width and content width to the page carry out difference operation, obtain the left and right distance values of the page;And from institute
In obtained left and right distance values, the smallest left and right distance values are selected, and by the left and right boundary phase with the page in destination document
Away from respectively the smallest left and right distance values and the straight line parallel with the left and right boundary of the page is determined as left and right cutting wires;Then edge
Fixed cutting wires carry out cutting edge processing to the page in destination document, and show to the page for being dismissed side.
The embodiment of the present invention can dismiss the left and right white space in document file page, therefore, can as far as possible to text
Shelves subject content related content is shown, brings biggish reading convenience for user.
Optionally, in another embodiment of the present invention, the page display method can also the method shown in Fig. 1 a
On the basis of increase S106.
It should be noted that S106 can both be executed according to the execution of method shown in Fig. 2 sequence, it can also be according to other
Execution sequentially executes, and the embodiment of the present invention is not construed as limiting this.S106 is described in detail below:
S106 extracts the header information of the accessed page, determines the following of header according to the header information extracted
The position on boundary, and by the following boundary line of header, it is determined as upper cutting wires;Wherein, the upper cutting wires are for destination document
In any page carry out the cutting wires of cutting edge processing.
It is understood that being seldom concerned about the content in header region, therefore can be by page since user is in reading documents
The content clip in eyebrow region falls, to facilitate user to read the core content of document.
Specifically, present invention method can be directly obtained the above-mentioned type document for some type of document
Header, and then the lower boundary in header region is determined, and using the lower boundary in header region as upper cutting wires.
Optionally, in another embodiment of the present invention, the page display method can also the method shown in Fig. 1 a
On the basis of increase S107, S108 and S109.
It should be noted that S107, S108 and S109 can both be executed according to the execution of method shown in Fig. 3 sequence,
It can be executed according to other execution sequence, the embodiment of the present invention is not construed as limiting this.S107, S108 and S109 are carried out below
Detailed description:
It is understood that being seldom concerned about the content in header region, therefore can be by page since user is in reading documents
The content clip in eyebrow region falls, to facilitate user to read the core content of document.
However, the page of the type document can not be directly obtained for the document of some type of document such as type PDF
Eyebrow, needs to get at this time the header of the type document by certain method, specific implementation process see S107, S108 and
S109。
S107 carries out the content in the beginning of the page region of the page for any one page in accessed each page
Scanning;Wherein, the beginning of the page region is for the apical position and area size positioned at the page:The preset ratio value of page-size *
Region.
It should be noted that the usual value of preset ratio value in the embodiment of the present invention is 20%, it is of course also possible to root
According to actual needs, the value of preset ratio value is configured, such as 10%, 30% etc., the embodiment of the present invention to this not
It limits.
For example S101 has got 10 pages, beginning of the page region is preceding 20% region of the page, at this time, it may be necessary to above-mentioned
The content in preceding 20% region of 10 pages is scanned.
S108, the quantity M of the identical page of statistics beginning of the page region content, and according to probability value calculation formula P=M/N, meter
It calculates:Destination probability value, N are the sum of the accessed page.
Such as after S107 is scanned the content in 20% region before above-mentioned 10 pages, discovery has the page of 9 pages
The content in first region is identical, at this point, destination probability value P=9/10*100%=90%.
S109, in the case where the destination probability value is not less than preset probability threshold value, by the lower boundary in beginning of the page region
Line is determined as upper cutting wires;Wherein, the upper cutting wires are for carrying out upper cutting edge processing to any page in destination document
Cutting wires.
It should be noted that the usual value of preset probability threshold value in the embodiment of the present invention is 80%, it is of course also possible to
According to actual needs, the value of preset ratio value is configured, such as 70%, 90% etc., the embodiment of the present invention is to this
It is not construed as limiting.
For example the preset usual value of probability threshold value is 80%, since destination probability value P=90% is greater than 80%,
It can be using the following boundary line in beginning of the page region as upper cutting wires.
Optionally, in another embodiment of the present invention, the page display method can be in method shown in Fig. 2
On the basis of increase S110.
It should be noted that S110 can both be executed according to the execution of method shown in Fig. 4 sequence, it can also be according to other
Execution sequentially executes, and the embodiment of the present invention is not construed as limiting this.S110 is described in detail below:
S110 extracts the footer information of the accessed page, the top of footer is determined according to the footer information extracted
The position on boundary, and by the upper border line of footer, it is determined as lower cutting wires;Wherein, the lower cutting wires are for destination document
In any page carry out the cutting wires of lower cutting edge processing.
It is understood that being seldom concerned about the content of footer area, therefore can be by page since user is in reading documents
The content clip in foot region falls, to facilitate user to read the core content of document.
Specifically, present invention method can be directly obtained the above-mentioned type document for some type of document
Footer, and then the coboundary of footer area is determined, and using the coboundary of footer area as lower cutting wires.
Optionally, in another embodiment of the present invention, the page display method can be in method shown in Fig. 3
On the basis of increase S111.
It should be noted that S111 can both be executed according to the execution of method shown in Fig. 5 sequence, it can also be according to other
Execution sequentially executes, and the embodiment of the present invention is not construed as limiting this.S111 is described in detail below:
S111, by with the lower horizontal line of the page in the destination document be apart preset distance value and with the bottom end
The parallel straight line of horizontal line, is determined as lower cutting wires;Wherein, the lower cutting wires are for any page in destination document
Carry out the cutting wires of lower cutting edge processing.
Specifically, can determine the lower cutting wires of the page according to the upper cutting wires determined in S109;Specifically, obtaining
Determining target range of the upper cutting wires away from the page top;Apart will be with the lower horizontal line of the page in the destination document
The target range value and the straight line parallel with the lower horizontal line, are determined as lower cutting wires.
Optionally, in another embodiment of the present invention, the page display method can also include:
The location information of the page for having been dismissed side or the fixed cutting wires is saved, thus with
When the document is read at family again, quickly the content relevant to subject content in document can be shown.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of page display devices.
As shown in fig. 6, a kind of page display device provided in an embodiment of the present invention, may include:
Page acquisition module 601, for obtaining at least two pages of destination document;
Difference operation module 602, for measuring the content width and page width of accessed each page, for described
Any one page in each page, page width and content width to the page carry out difference operation, obtain the page
Left and right distance values;
First cutting wires determining module 603, for selecting left and right the smallest from obtained left and right distance values
Away from value, and will with the left and right boundary of the page in destination document at a distance of be respectively the smallest left and right distance values and with the page it is left and right
The parallel straight line in boundary is determined as left and right cutting wires;
Page cutting edge module 604, for carrying out cutting edge processing to the page in destination document along fixed cutting wires;
Page display module 605, for being shown to the page for being dismissed side;
Wherein, left distance values are the distance value of the left margin of the content of the page and the page left margin of the page, right spacing
Value is the distance value of the right margin of the content of the page and the page right margin of the page, and left and right cutting wires are for target text
Any page in shelves carries out the cutting wires of left and right cutting edge processing.
It can be seen that page display device provided in an embodiment of the present invention, at least two pages for obtaining destination document
Later, the content width and page width that accessed each page can be measured, for any one in each page
The page, page width and content width to the page carry out difference operation, obtain the left and right distance values of the page;And from institute
In obtained left and right distance values, the smallest left and right distance values are selected, and by the left and right boundary phase with the page in destination document
Away from respectively the smallest left and right distance values and the straight line parallel with the left and right boundary of the page is determined as left and right cutting wires;Then edge
Fixed cutting wires carry out cutting edge processing to the page in destination document, and show to the page for being dismissed side.
The embodiment of the present invention can dismiss the left and right white space in document file page, therefore, can as far as possible to text
Shelves subject content related content is shown, brings biggish reading convenience for user.
Optionally, in another embodiment of the present invention, the page display device can be with device shown in Fig. 6
On the basis of increase by the second cutting wires determining module 606.
It should be noted that the second cutting wires determining module 606 can both be carried out according to the connection type of Fig. 7 shown device
Connection, can also be attached, the embodiment of the present invention is not construed as limiting this according to other connection types.It is cut below to second
The function of line determining module 606 is described in detail:
The second cutting wires determining module 606, for extracting the header information of the accessed page, according to extracting
Header information determine that the position of the lower boundary of header is determined as upper cutting wires and by the following boundary line of header;Wherein, described
Upper cutting wires are the cutting wires for carrying out upper cutting edge processing to any page in destination document.
Optionally, in another embodiment of the present invention, the page display device can be with device shown in Fig. 6
On the basis of increase third cutting wires determining module 607.
It should be noted that third cutting wires determining module 607 can both be carried out according to the connection type of Fig. 8 shown device
Connection, can also be attached, the embodiment of the present invention is not construed as limiting this according to other connection types.Third is cut below
The function of line determining module 607 is described in detail:
The third cutting wires determining module 607, for being directed to any one page in accessed each page, to this
The content in the beginning of the page region of the page is scanned;The beginning of the page region is for the apical position and area size positioned at the page:Page
The region of the preset ratio value of face size *;
The quantity M of the identical page of beginning of the page region content is counted, and according to probability value calculation formula P=M/N, is calculated:
Destination probability value, N are the sum of the accessed page;
In the case where the destination probability value is not less than preset probability threshold value, by the following boundary line in beginning of the page region, really
It is set to cutting wires;Wherein, the upper cutting wires are the sanction for carrying out upper cutting edge processing to any page in destination document
Trimming.
Optionally, in another embodiment of the present invention, the page display device can be with device shown in Fig. 7
On the basis of increase the 4th cutting wires determining module 608.
It should be noted that the 4th cutting wires determining module 608 can both be carried out according to the connection type of Fig. 9 shown device
Connection, can also be attached, the embodiment of the present invention is not construed as limiting this according to other connection types.It is cut below to the 4th
The function of line determining module 608 is described in detail:
The 4th cutting wires determining module 608, for extracting the footer information of the accessed page, according to extracting
Footer information determine that the position of the coboundary of footer is determined as lower cutting wires and by the upper border line of footer;Wherein, described
Lower cutting wires are the cutting wires for carrying out lower cutting edge processing to any page in destination document.
Optionally, in another embodiment of the present invention, the page display device can be with device shown in Fig. 8
On the basis of increase the 5th cutting wires determining module 609.
It should be noted that the 5th cutting wires determining module 609 both can according to Figure 10 shown device connection type into
Row connection, can also be attached, the embodiment of the present invention is not construed as limiting this according to other connection types.It is cut out below to the 5th
The function of trimming determining module 609 is described in detail:
5th cutting wires determining module 609, for that apart will be pre- with the lower horizontal line of the page in the destination document
If distance value and the straight line parallel with the lower horizontal line, be determined as lower cutting wires;Wherein, the lower cutting wires be for
The cutting wires of lower cutting edge processing are carried out to any page in destination document.
Optionally, in another embodiment of the present invention, the page display device can also include:
Preserving module is carried out for the location information to the page for having been dismissed side or the fixed cutting wires
It saves.
Optionally, in another embodiment of the present invention, the page display module 605, specifically can be used for:
According to the triggering command of user, the page for being dismissed side is shown.
For device embodiment, since it is substantially similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each module can be realized in the same or multiple software and or hardware when invention.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,
The storage medium designated herein obtained, such as:ROM/RAM, magnetic disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.