The invention relates to the technical field of
data processing, and provides a file
conversion method for reserving a PDF
file format in order to solve the problem that an existing PDF conversion tool cannot completely reserve an original text structure of a PDF file and convert the original text structure into an Excel format, the invention provides a file
conversion method for reserving the PDF
file format, the PDF file is read to obtain text information and
layout information, and position coordinates of pixel points corresponding to the text information are obtained; generating an
XML file through the position coordinates and the
layout information; obtaining size information of the PDF file according to the
layout information, establishing a two-dimensional
list according to the size information, analyzing the
XML file, and storing text information in the
XML file into the two-dimensional
list; and compressing null rows and null columns in the
list, and writing data in the two-dimensional list into the Excel object. According to the method, not only are the text layout and structure in the PDF file reserved, but also the accuracy and efficiency of
data conversion can be remarkably improved.