A-PDF :: Affordable PDF Tools

How do you extract text from PDF with rearranging on position?

Return KB main page

Question

If I want to extract text content from PDF pages, then how can I rearrange the text based on position using command line?

Solution

A-PDF Text Extractor Command Line version provides you simple method to extract text from PDF files, you can even set page range, and text output type as required.

You can use the simple command line below to carry out your requirement:

PTCMD  [] [Options]
 
Parameters:
  : The PDF file to be extract.
  : The output text file.
Options:
  -W              : Password of the pdf file if application.
  -B and -E: Range of page number.
  -P        : Select to extract only odd pages or even pages 
                              or all pages. Default is All. Options available:
                                All, Odd, Even
  -H
and -F
: Some special variants can be put at Header or Footer area of every page to display page information. Following are the variants: &p Current page number &a All page count &f PDF file name with full path. Such as c:\pdfs\my.pdf &n PDF file name. Such as my.pdf &d Extracting date -O : Output type can be used in different situation.
Includes:
Original: Follow the inner order of PDF files.
Smart: Rearrange text based on the position.
Position: output text with positions. Format:
@X=,Y=@@ENDTEXT@
The unit of X,Y is point(1/72 inch) -T : Output the text extracted into screen, not file. Return Code: 0: Extract successfully. 1: Extract failed. 2: Parameters error. 3: Source file not found. 4: Load source file error. 5: Output file error. 6: Decrypt source failed. EXAMPLES: PTCMD my.pdf PTCMD c:\pdfs\my.pdf c:\pdfs\out.txt -W"P@ssw0rd" -B4 -E20 -Peven PTCMD "c:\pdfs\my.pdf" -H" http://a-pdf.com" -F" =Page&p="

order

Related products

We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.

Return KB main page