将pdf转换为csv或xls [英] Convert pdf to csv or xls

查看:90
本文介绍了将pdf转换为csv或xls的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道用于将pdf文档转换为csv或xls的php脚本? pdf是一个数据表,数据需要保留在其列中。我可以将数据获取到txt,但每条记录中的字段之间有可变数量的空格。如果不是脚本,完成工作的方法或一些想法?


谢谢

Does anyone know of a php script to convert a pdf document to csv or xls? The pdf is a table of data and the data needs to stay in its columns. I can get the data to txt but there are variable numbers of spaces between fields in each record. If not a script, a way to get the job done or some ideas?

Thanks

推荐答案


有没有人知道用于将pdf文档转换为csv或xls的php脚本? pdf是一个数据表,数据需要保留在其列中。我可以将数据获取到txt,但每条记录中的字段之间有可变数量的空格。如果不是一个脚本,一种完成工作的方法或一些想法?


谢谢
Does anyone know of a php script to convert a pdf document to csv or xls? The pdf is a table of data and the data needs to stay in its columns. I can get the data to txt but there are variable numbers of spaces between fields in each record. If not a script, a way to get the job done or some ideas?

Thanks



pdf不能转换为任何这些格式。实际上它不能准确地转换成任何格式。

pdf can''t be converted to any of these formats. Actually it can''t be converted accurately to any format.


如何使用爆炸并在该文本输出上 preg_split 将其拆分为有用的数据?


假设你得到一个新行中的每一行,你可以先用\\\
换行符char展开它们,然后用正则表达式将每一行拆分成字段。像/ \s + /这样的东西应该工作。
How about using explode and preg_split on that text output to split them into useful data?

Assuming you get every row in a new line, you could start by exploding them by the \n newline char and then splitting every line into fields using regex. Something like "/\s+/" should work.



如何使用爆炸并在该文本输出上 preg_split 将其拆分为有用的数据?


假设你得到一个新行中的每一行,你可以先用\ n换行符对它们进行爆炸,然后用正则表达式将每一行拆分成字段。像/ \s + /这样的东西应该管用。
How about using explode and preg_split on that text output to split them into useful data?

Assuming you get every row in a new line, you could start by exploding them by the \n newline char and then splitting every line into fields using regex. Something like "/\s+/" should work.



您认为这适用于pdf吗?

Do you think that would work on pdf?


这篇关于将pdf转换为csv或xls的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆