CN102368263A - File format converting method and device - Google Patents
File format converting method and device Download PDFInfo
- Publication number
- CN102368263A CN102368263A CN2011103140429A CN201110314042A CN102368263A CN 102368263 A CN102368263 A CN 102368263A CN 2011103140429 A CN2011103140429 A CN 2011103140429A CN 201110314042 A CN201110314042 A CN 201110314042A CN 102368263 A CN102368263 A CN 102368263A
- Authority
- CN
- China
- Prior art keywords
- page
- picture
- file
- height
- maximum height
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The invention provides a file format converting method and device. The method comprises the following steps of: adaptively adjusting the last nonnull column of each page of a file to be processed to obtain the largest height and the largest width of each adjusted page as well as the largest height and the largest width of each picture of each page; comparing the largest height of each page with the largest height of each picture, taking a larger value as the height H of the page, comparing the largest width of each page with the largest width of each picture, and taking a larger value as the width W of the page; obtaining the height H1 of a principal plane and the width W1 of the principal plane; and obtaining the ratio of H1 to H and the ratio of W1 to W, assigning a smaller value to M, and scaling and outputting each page of the adjusted file according to the scaling proportion of M if M is smaller than 1.
Description
Technical field
The invention belongs to networking technology area, relate in particular to a kind of method and device of file layout conversion.
Background technology
In today of network technology widespread usage, various office softwares such as MS office, WPS have become requisite application tool, and people often will be with changing between all kinds of documents based on the needs of some displayings or Network Transmission etc.For example, in network interaction communication,, be a kind of common way with outputing on the webpage after the document conversion.In prior art, application number is that 200910198421.9 invention " document format conversion system and method " discloses a kind of document format conversion system and method.This system comprises picture conversion module, text acquisition module, character image mapping block.The picture conversion module is in order to transfer each page of document to the data of picture format.Literal, each literal the status information in picture of text acquisition module in order to obtain each page of document.The character image mapping block in order to generate the pairing mapping table of each page Word message and picture, includes the status information of each literal in picture in this table.Picture conversion module, text acquisition module convert each page of each document into a harmless picture file and a text that comprises all Word messages of this page.
Foregoing invention is integrated into uniform data format through the method that picture, literal transformed respectively and shine upon with the document of all kinds of complicacies; Need not to download any software and can in browser, directly check document; For how diagram file is intactly showed, solution is not provided on webpage.At present when some diagram files such as excel change, page can only the display part in Pagination Display perhaps, cause the incomplete phenomenon of the page, influenced communication efficiency greatly.
Summary of the invention
The present invention provides a kind of method and device of file layout conversion, to address the above problem.
The present invention provides a kind of method of file layout conversion, and the inventive method may further comprise the steps.Last non-NULL row of each page of pending file are carried out the self-adaptation adjustment, obtain each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page.Relatively page maximum height and said picture maximum height are got higher value as page height H, and relatively page breadth extreme and said picture breadth extreme are got higher value as pagewidth W.Obtain paper height H 1 and paper width W 1.Obtain the ratio of H1 and H and the ratio of W1 and W, give M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of adjusted file carries out convergent-divergent output.
The present invention also provides a kind of device of file layout conversion, comprises adjusting module, value module, acquisition module and processing module.Wherein, adjusting module connects the value module, and the value module connects acquisition module, acquisition module connection processing module.Adjusting module is used for last non-NULL row of each page of pending file are carried out the self-adaptation adjustment, obtains each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page.The value module is used for comparison page maximum height and said picture maximum height, gets higher value as page height H, and relatively page breadth extreme and said picture breadth extreme are got higher value as pagewidth W.Acquisition module is used to obtain paper height H 1 and paper width W 1.Processing module is used to obtain the ratio of H1 and H and the ratio of W1 and W, gives M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of adjusted file carries out convergent-divergent output.
Compared to prior art; According to the method and the device of file layout conversion provided by the invention, output on the webpage converting picture format to after the automatic adjustment of diagram file, kept the integrality of file; And need not download relevant office software, can on webpage, directly read.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
The process flow diagram of the file layout change-over method that provides for preferred embodiment according to the present invention shown in Figure 1;
The synoptic diagram of the file layout conversion equipment that provides for preferred embodiment according to the present invention shown in Figure 2.
Embodiment
Hereinafter will and combine embodiment to specify the present invention with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
The process flow diagram of the file layout change-over method that provides for preferred embodiment according to the present invention shown in Figure 1 may further comprise the steps:
Step 101: last non-NULL row of each page of pending file are carried out the self-adaptation adjustment, obtain each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page.
At first; Each page of pending file is adjusted; Particularly, travel through each row of the pending file page, obtain the col width L1 of last non-NULL column unit lattice; Col width to last non-NULL column unit lattice carries out the self-adaptation adjustment, obtains the adjusted col width L2 of said last non-NULL column unit lattice.
Secondly, obtain each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page.The maximum height of obtaining each picture in the page of adjustment back with the process of breadth extreme is: travel through line by line and search picture, obtain height, the width of each picture successively and compare, obtain higher value, obtain the maximum height and the breadth extreme of picture.For example, the height that the height that obtains first pictures is 9, width is 4, the second pictures is 8, and width is 6; Then give maximum height with numerical value 9 assignment, numerical value 6 assignment are given breadth extreme, next search the 3rd pictures; With the height and numerical value 9 comparisons of the 3rd pictures, the higher value assignment is given maximum height, with the width and numerical value 6 comparisons of the 3rd pictures; The higher value assignment is given breadth extreme, by that analogy, searches the picture end up to traveling through line by line.
Step 102: compare page maximum height and said picture maximum height, get higher value as page height H, relatively page breadth extreme and said picture breadth extreme are got higher value as pagewidth W.
Step 103: obtain paper height H 1 and paper width W 1.Said paper height and paper width are meant content of pages is printed on the paper height of said paper and width.
Step 104: obtain the ratio of H1 and H and the ratio of W1 and W, give M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of adjusted file carries out convergent-divergent output.
As stated, if then directly export said adjustment back each page of file M >=1.
With the process of adjusted each page output be: at first each conversion of page of adjusted file is become PDF, convert picture format to by PDF again, output on the webpage at last, or print to paper.
For example, adjusted pending file comprises the page one and the page two, value after relatively page-out one page face height be 40 centimetres, pagewidth is 30 centimetres.Obtaining the paper height is 36 centimetres, and the paper width is 24 centimetres.This moment, the ratio of H1 and H was 36: 40=0.9, the ratio of W1 and W are 24: 30=0.8, then give M with smaller value 0.8 assignment; This moment, M<1 was carried out convergent-divergent output with the page one according to the scaling of M=0.8, promptly; The said page one page height multiply by 0.8 by 40 centimetres be scaled 32 centimetres; Pagewidth multiply by 0.8 by 30 centimetres and is scaled 24 centimetres, and outputing to highly is 36 centimetres, and width is on 24 centimetres the paper.
And for example, value after relatively page-out two page heights be 30 centimetres, pagewidth is 24 centimetres.Obtaining the paper height is 36 centimetres, and the paper width is 24 centimetres.This moment, the ratio of H1 and H was 36: 30=1.2; The ratio of W1 and W is 24: 24=1, give M with smaller value 1 assignment, at this moment M >=1; Then said adjustment back each page of file is directly exported; That is, it highly is 36 centimetres that the said page two is directly outputed to according to life size, and width is on 24 centimetres the paper.
The synoptic diagram of the file layout conversion equipment that provides for preferred embodiment according to the present invention shown in Figure 2.As shown in Figure 2, the file layout conversion equipment 1 that preferred embodiment of the present invention provides comprises adjusting module 10, value module 20, acquisition module 30 and processing module 40.Wherein, adjusting module 10 connects value module 20, and value module 20 connects acquisition module 30, acquisition module 30 connection processing modules 40.Adjusting module 10 is used for last non-NULL row of each page of pending file are carried out the self-adaptation adjustment, obtains each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page.Value module 20 is used for comparison page maximum height and picture maximum height, gets higher value as page height H, and relatively page breadth extreme and picture breadth extreme are got higher value as pagewidth W.Acquisition module 30 is used to obtain paper height H 1 and paper width W 1.Processing module 40 is used to obtain the ratio of H1 and H and the ratio of W1 and W, gives M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of adjusted file carries out convergent-divergent output.
In sum; File conversion form method and device that preferred embodiment according to the present invention provides output on the webpage converting picture format to after the automatic adjustment of diagram file, have kept the integrality of file; And need not download other office software, can on webpage, directly read.The present invention is applicable to the excel part of microsoft office, also is applicable to the excel part among the WPS.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (7)
1. the method for a file layout conversion is characterized in that, may further comprise the steps:
Last non-NULL row of each page of pending file are carried out the self-adaptation adjustment, obtain each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page;
More said page maximum height and said picture maximum height are got higher value as page height H, and more said page breadth extreme and said picture breadth extreme are got higher value as pagewidth W;
Obtain paper height H 1 and paper width W 1;
Obtain the ratio of H1 and H and the ratio of W1 and W, give M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of said adjusted file carries out convergent-divergent output.
2. method according to claim 1 is characterized in that, converts each page output of said adjusted file to PDF, converts picture format to by PDF again.
3. method according to claim 1 is characterized in that, last non-NULL of said each page of pending file row are carried out the self-adaptation adjustment before, travel through each row of the said pending file page, obtain the col width L1 of last non-NULL column unit lattice itself; After last non-NULL of said each page of pending file row are carried out the self-adaptation adjustment; Obtain the col width L2 of the cell of last non-NULL row of adjustment back; If L2>L1; Whether have picture cover said self-adaptation adjusted cell, if then move on to the next line cell to said picture if judging in said each page of pending file.
4. method according to claim 1; It is characterized in that; Obtaining the maximum height of each picture in the page of said adjustment back and the process of breadth extreme is: traversal is searched picture line by line; Obtain height, the width of each picture successively and compare, obtain higher value, obtain the maximum height and the breadth extreme of picture.
5. method according to claim 1 is characterized in that, if then directly export said adjustment back each page of file M >=1.
6. according to the described method of claim 1~5, it is characterized in that said file comprises the excel of Microsoft, WPS excel file.
7. the device of file layout conversion; It is characterized in that comprise adjusting module, value module, acquisition module and processing module, said adjusting module connects said value module; Said value module connects said acquisition module, and said acquisition module connects said processing module:
Said adjusting module is used for last non-NULL row of said each page of pending file are carried out the self-adaptation adjustment, obtains each picture maximum height and breadth extreme in adjustment each page maximum height of back and breadth extreme, the page;
Said value module is used for more said page maximum height and said picture maximum height, gets higher value as page height H, and more said page breadth extreme and said picture breadth extreme are got higher value as pagewidth W;
Said acquisition module is used to obtain paper height H 1 and paper width W 1;
Said processing module is used to obtain the ratio of H1 and H and the ratio of W1 and W, gives M with the smaller value assignment, if M<1, then the scaling with the said M of each page foundation of adjusted file carries out convergent-divergent output.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110314042 CN102368263B (en) | 2011-10-17 | 2011-10-17 | File format converting method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110314042 CN102368263B (en) | 2011-10-17 | 2011-10-17 | File format converting method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102368263A true CN102368263A (en) | 2012-03-07 |
CN102368263B CN102368263B (en) | 2013-03-06 |
Family
ID=45760827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110314042 Active CN102368263B (en) | 2011-10-17 | 2011-10-17 | File format converting method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102368263B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108228050A (en) * | 2017-12-13 | 2018-06-29 | 阿里巴巴集团控股有限公司 | A kind of picture Zoom method, device and electronic equipment |
CN110795914A (en) * | 2018-07-16 | 2020-02-14 | 珠海金山办公软件有限公司 | Method and device for converting PDF document into picture and electronic equipment |
CN114118023A (en) * | 2021-12-02 | 2022-03-01 | 江苏中威科技软件系统有限公司 | Method for converting OFD file |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040107403A1 (en) * | 2002-09-05 | 2004-06-03 | Tetzchner Jon Stephensen Von | Presenting HTML content on a small screen terminal display |
US20050278418A1 (en) * | 2002-04-19 | 2005-12-15 | Chandrasekar Rathakrishnan | System and method for use of multiple applications |
CN101526953A (en) * | 2009-01-19 | 2009-09-09 | 北京跳网无限科技发展有限公司 | WWW transformation technology |
CN101699426A (en) * | 2009-11-06 | 2010-04-28 | 上海传知信息科技发展有限公司 | Document format conversion system and method |
-
2011
- 2011-10-17 CN CN 201110314042 patent/CN102368263B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050278418A1 (en) * | 2002-04-19 | 2005-12-15 | Chandrasekar Rathakrishnan | System and method for use of multiple applications |
US20040107403A1 (en) * | 2002-09-05 | 2004-06-03 | Tetzchner Jon Stephensen Von | Presenting HTML content on a small screen terminal display |
CN101526953A (en) * | 2009-01-19 | 2009-09-09 | 北京跳网无限科技发展有限公司 | WWW transformation technology |
CN101699426A (en) * | 2009-11-06 | 2010-04-28 | 上海传知信息科技发展有限公司 | Document format conversion system and method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108228050A (en) * | 2017-12-13 | 2018-06-29 | 阿里巴巴集团控股有限公司 | A kind of picture Zoom method, device and electronic equipment |
CN108228050B (en) * | 2017-12-13 | 2021-01-22 | 创新先进技术有限公司 | Picture scaling method and device and electronic equipment |
CN110795914A (en) * | 2018-07-16 | 2020-02-14 | 珠海金山办公软件有限公司 | Method and device for converting PDF document into picture and electronic equipment |
CN114118023A (en) * | 2021-12-02 | 2022-03-01 | 江苏中威科技软件系统有限公司 | Method for converting OFD file |
CN114118023B (en) * | 2021-12-02 | 2022-07-26 | 江苏中威科技软件系统有限公司 | Method for converting OFD file |
Also Published As
Publication number | Publication date |
---|---|
CN102368263B (en) | 2013-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104410667B (en) | Conversion method and system of a kind of XML message to JSON messages | |
CN102289376A (en) | Embedded multi-language WEB page realization method and system | |
US20050262049A1 (en) | System, method, device, and computer code product for implementing an XML template | |
CN101040283A (en) | Form related data reduction | |
CN1613105A (en) | Presenting html content on a small screen terminal display | |
CN104020984A (en) | Method and device for generating static page | |
CN102364457A (en) | Document transformation method and system | |
CN101470729B (en) | Web page picture displaying method and device | |
CN102368263B (en) | File format converting method and device | |
CN101908078A (en) | Method and device for importing webpage data to EXCEL sheet | |
US20100202015A1 (en) | Image processing apparatus, image processing method, program, and storage medium | |
CN101651938A (en) | Telephone number recognition system for mobile terminal and application method thereof | |
CN101640664A (en) | Internet portal service system and management method thereof | |
CN102831190A (en) | Method for browsing current-mode logic (CML) files on low-end equipment | |
CN100552670C (en) | A kind of method of automatic discriminating digit document type page | |
CN101183372B (en) | Style list processing system and method | |
CN103389976A (en) | Searching method and searching system for terminal | |
CN102262628B (en) | Webpage segmentation method and paging server | |
CN102289497A (en) | Document preview image generating system and method | |
CN113705181A (en) | Method for annotating files in browser | |
CN101859293B (en) | Electronic reader and edition document storage method | |
CN104267941A (en) | Dynamic responsive web generation method and device | |
CN105975218A (en) | Graphic file browsing and printing device and method based on data converter | |
CN101655874A (en) | Web page segmentation method and web page segmentation device | |
CN106021582B (en) | Method for filtering position information, method and device for extracting effective webpage information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee after: Kuo Di education and science company limited Address before: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee before: Suzhou Kuodi Network Technology Co., Ltd. |