From 479c920ec79d743d39db64e12cd600bba7c6d85f Mon Sep 17 00:00:00 2001 From: "yusuke.shinyama.dummy" Date: Wed, 5 May 2010 05:51:22 +0000 Subject: [PATCH] documentation git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@216 1aa58f4a-7d42-0410-adbc-911cccaed67c --- docs/usage.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/usage.html b/docs/usage.html index b2fb787..b1b5677 100644 --- a/docs/usage.html +++ b/docs/usage.html @@ -25,6 +25,10 @@ from other applications.

A typical way to parse a PDF file is the following:

+from pdfminer.pdfparser import PDFParser, PDFDocument
+from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
+from pdfminer.pdfdevice import PDFDevice
+
 # Open a PDF file.
 fp = open('mypdf.pdf', 'rb')
 # Create a PDF parser object associated with the file object.
@@ -34,7 +38,7 @@ doc = PDFDocument()
 # Connect the parser and document objects.
 parser.set_document(doc)
 doc.set_parser(parser)
-# Supply the document password for initialization.
+# Supply the password for initialization.
 # (If no password is set, give an empty string.)
 doc.initialize(password)
 # Check if the document allows text extraction. If not, abort.
@@ -52,12 +56,12 @@ for page in doc.get_pages():
 

-In PDFMiner, there are several objects involved in parsing a PDF file. -Figure 1. shows the relationships between these objects. +In PDFMiner, there are several objects involved in parsing a PDF file, +as shown in Figure 1.


-Figure 1. Relationships between objects +Figure 1. Relationships between PDFMiner objects
@@ -67,6 +71,9 @@ Figure 1. shows the relationships between these objects. PDFMiner performs a basic layout analysis.
+from pdfminer.layout import LAParams
+from pdfminer.converter import PDFPageAggregator
+
 # Set parameters for analysis.
 laparams = LAParams()
 # Create a PDF page aggregator object.