Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sat Aug 19, 2017 2:44 am


Tips & Tricks, Questions regarding shell scripts, awk, perl, sed and much more.

Author Message
mandrei99
Post  Post subject: How to convert pdf to text in FreeBSD  |  Posted: Thu Jan 08, 2015 10:03 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

How to convert pdf to text in FreeBSD

How to convert pdf to text in FreeBSD

A simple tool to extract or convert text from a pdf file (unprotected) to a text file is using "xpdf" port.

Code:
# cd /usr/ports/graphics/xpdf && make install clean

Opt out "X11 (graphics) support" if you're not interested in X11 support.

Example of converting pdf file to test file:
Code:
# ls
simple.pdf
# /usr/local/libexec/xpdf/pdftotext simple.pdf
# ls
simple.pdf     simple.txt
# cat simple.txt
A Simple PDF File
<PDF TEXT>


Simple PDF File 2
<PDF TEXT>


"pdftotext" utility from xpdf converts a pdf file to a new text file keeping the page numbering for reference.





Top
mandrei99
Post  Post subject: Re: How to convert pdf to text in FreeBSD  |  Posted: Thu Jan 08, 2015 10:08 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
To save pdf file contents to a text file with different filename than the pdf file, use
Code:
# /usr/local/libexec/xpdf/pdftotext Simple2.pdf - >my_new_text_file_from_pdf.txt
# ls
my_new_text_file_from_pdf.txt   simple.pdf


Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "How to convert pdf to text in FreeBSD"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to convert a text into a list of words, one per line

LaR3

0

4424

Wed Aug 05, 2009 7:02 am

LaR3 View the latest post

There are no new unread posts for this topic. How to get the word frequency in a text

LaR3

0

2329

Wed Aug 05, 2009 7:01 am

LaR3 View the latest post

There are no new unread posts for this topic. grep match pattern: Binary file bincharacters.txt matches - How to make grep treat a file as text

mandrei99

0

642

Wed Dec 11, 2013 7:15 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux / FreeBSD: Avoid bash history duplicate lines with HISTCONTROL

mandrei99

0

546

Mon Jan 12, 2015 12:01 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO