Perl program to convert PDF to text/CSV


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl program to convert PDF to text/CSV
# 1  
Old 01-05-2011
Perl program to convert PDF to text/CSV

Please suggest ways to easily convert pdf to text in perl only on windows (no other tools can be downloaded)

Here is what I have been doing :

using a module CAM::PDF to extract data. But it shows everything in messy format Smilie

But this module is the only one working with the pdf files I am using Smilie.

Now I found another way to get text and its location using below link.
search - How do I get character offset information from a pdf document? - Stack Overflow
by Chris author of the module.

example below:
Code:
text 'E' at (52.08,704.16)
text 'm' at (73.62096,704.16)
text 'p' at (113.58936,704.16)
text 'lo' at (140.49648,704.16)
text 'y' at (181.19904,704.16)
text 'e' at (204.43584,704.16)
text 'e' at (230.93808,704.16)
text ' N' at (257.44032,704.16)
text 'a' at (294.6504,704.16)
text 'm' at (320.772,704.16)
text 'e' at (360.7416,704.16)
text 'Employee Name' at (56.4,124.56)
text 'Employee Title' at (56.4,114.24)
text 'Company Name' at (56.4,103.92)

My solution is get x and y put in array/hash and then dump the page which will look almost the same as pdf.

please suggest if there is another way and also a way dump to screen easily using x and y with perl.

Thanks in advance.

---------- Post updated at 06:52 AM ---------- Previous update was at 05:08 AM ----------

Let me put question differently:

Could any one suggest me a way in perl to have text displayed when X and Y are specified in format (56.4,103.92) and ( 73.72096, 704.16)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert text to csv

Hi, Is there somebody there to post an idea on how to convert this 5 liner row to 1 liner or tab delimiter to be import to database. Here the text file format: Description: Description1 Link: https://www.google.com Date: June 2, 2018 Time: 00:07:44 Age: 1 days ago Description:... (2 Replies)
Discussion started by: lxdorney
2 Replies

2. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

3. Shell Programming and Scripting

Convert text to CSV

Hi Gurus I need urgent help to convert a flat log file into csv format to load into database. Log looks like: a=1 b=2 c=3 a=4 b=5 c=6 Only the values at right side of = will come into csv and it should create a new line once it receives "a" field. (8 Replies)
Discussion started by: sandipjee
8 Replies

4. Shell Programming and Scripting

Convert perl program to shell

Hi is there a way that i can convert this simple perl program into shell script #!usr/bin/perl -w use strict; use warnings; open INPUTFILE, "uniqprobecoordinates.out" || die "canot open the file $!"; open OUTPUTFILE, ">", "1_4reads.out"; while(<INPUTFILE>) { chomp; ... (3 Replies)
Discussion started by: bhargavpbk88
3 Replies

5. Solaris

Convert csv file into pdf file from putty

Hi, My requirement is that i have to convenrt a csv file inyo a pdf file . So is there any command which will do that ??? thanks Sambuddha (2 Replies)
Discussion started by: Sambuddha
2 Replies

6. HP-UX

Convert text file into pdf on HP-UX platform

I am looking for a tool to convert text file into pdf on HP-UX platform. Current version of OS - $ uname -a HP-UX XXXXXXX B.11.23 U ia64 4125393404 unlimited-user license I'm able to get "ClibPDF-2.02"; A library for creating PDF files on HP-UX 11.00, PA-RISC 1.1 Not sure if... (2 Replies)
Discussion started by: mail4usr
2 Replies

7. Programming

convert text file to csv

hi all, i have a select query that gives me the output in the following way... SYSTYPE -------------------------------------------------------------------------------- Success Failures Total RFT ---------- ---------- ---------- ---------- TYP 1 0 ... (3 Replies)
Discussion started by: sais
3 Replies

8. Shell Programming and Scripting

Perl - Convert html to pdf - PDF::FromHTML

Hi, I am trying to convert html to pdf using perl module PDF::FromHTML, am getting the error as given below. not well-formed (invalid token) at line 2, column 17, byte 56 at C:/Perl/lib/XML/Parser.pm line 187 at C:/Perl/site/lib/PDF/FromHTML.pm line 140 The perl code is as given... (2 Replies)
Discussion started by: DILEEP410
2 Replies

9. UNIX for Advanced & Expert Users

how to convert text/csv to excel

Hello All, I have a sql report with 50 columns and 1000 rows result in a file ( txt / csv). is there is any way that we can move them to excel in KSH. Thanks, Sateesh (7 Replies)
Discussion started by: kotasateesh
7 Replies

10. AIX

How convert PCL or PDF file to text in AIX

I need to conver a PCL or PDF file to text in AIX, and I donīt know how. (0 Replies)
Discussion started by: 10789
0 Replies
Login or Register to Ask a Question