From 2ba7a313fd0dd3d5e61927e93be4ed71e2fbaee1 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 4 Dec 2011 13:53:04 +0100 Subject: "PDF" and not "pdf" --- FORMATS | 4 ++-- README | 14 +++++++------- mat/office.py | 10 +++++----- mat/strippers.py | 4 ++-- test/test.py | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/FORMATS b/FORMATS index 6061a79..51fdb26 100644 --- a/FORMATS +++ b/FORMATS @@ -39,11 +39,11 @@ .pdf full a lot - rendering of the pdf file on a cairo surface with the help of + rendering of the PDF file on a cairo surface with the help of poppler in order to remove all the internal metadata. For now, cairo create some metadata. They can be remove if you install either exiftool, or python-pdfrw. - The next version of python-cairo will support pdf metadata. + The next version of python-cairo will support PDF metadata. diff --git a/README b/README index 27c307a..3943ff2 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ METADATA: METADATA AND PRIVACY: Metadata within a file can tell a lot about you. Cameras record data about when a picture was taken and what - camera was used. Office documents like pdf or Office automatically adds + camera was used. Office documents like PDF or Office automatically adds author and company information to documents and spreadsheets. Maybe you don't want to disclose those information on the web. @@ -23,12 +23,12 @@ WARNING : DEPENDENCIES: python2.6 (at least) python-hachoir-core and python-hachoir-parser - python-pdfrw or exiftool for full pdf support + python-pdfrw or exiftool for full PDF support shred (should be already installed) OPTIONALS DEPENDENCIES: - python-poppler and python-cairo : for pdf support + python-poppler and python-cairo : for PDF support python-mutagen : for massive audio format support exiftool : for _massive_ image format support @@ -67,11 +67,11 @@ SUPPORTED FORMAT: Portable Document Fileformat (.pdf) support : full metadata : a lot - method : rendering of the pdf file on a cairo surface with the help of + method : rendering of the PDF file on a cairo surface with the help of poppler in order to remove all the internal metadata. For now, cairo create some metadata. They can be remove if you install either exiftool, or python-pdfrw. - The next version of python-cairo will support pdf metadata. + The next version of python-cairo will support PDF metadata. Tape ARchive (.tar, .tar.bz2, .tar.gz) @@ -139,8 +139,8 @@ for images: exiv2 (C++) : metadata manipulation graphicsmagick (a fork from imagemagick) : cli image manipulation -for pdf: - pdfminer (python) : pdf manipulation +for PDF: + pdfminer (python) : PDF manipulation other tools: an hexadecimal editor diff --git a/mat/office.py b/mat/office.py index d1e781e..d6ad367 100644 --- a/mat/office.py +++ b/mat/office.py @@ -112,7 +112,7 @@ class OpenDocumentStripper(archive.GenericArchiveStripper): class PdfStripper(parser.GenericParser): ''' - Represent a pdf file + Represent a PDF file ''' def __init__(self, filename, parser, mime, backup, add2archive): super(PdfStripper, self).__init__(filename, parser, mime, backup, @@ -143,7 +143,7 @@ class PdfStripper(parser.GenericParser): def remove_all_ugly(self): ''' - Opening the pdf with poppler, then doing a render + Opening the PDF with poppler, then doing a render on a cairo pdfsurface for each pages. Thanks to Lunar^for the idea. http://cairographics.org/documentation/pycairo/2/ @@ -153,7 +153,7 @@ class PdfStripper(parser.GenericParser): page_width, page_height = page.get_size() surface = cairo.PDFSurface(self.output, page_width, page_height) context = cairo.Context(surface) # context draws on the surface - logging.debug('Pdf rendering of %s' % self.filename) + logging.debug('PDF rendering of %s' % self.filename) for pagenum in xrange(self.document.get_n_pages()): page = self.document.get_page(pagenum) context.translate(0, 0) @@ -165,7 +165,7 @@ class PdfStripper(parser.GenericParser): def _remove_meta(self): ''' Remove superficial/external metadata - from a pdf file, using exiftool, + from a PDF file, using exiftool, of pdfrw if exiftool is not installed ''' processed = False @@ -203,7 +203,7 @@ class PdfStripper(parser.GenericParser): if processed is False: logging.error('Please install either pdfrw, or exiftool to\ - fully handle pdf files') + fully handle PDF files') return processed def get_meta(self): diff --git a/mat/strippers.py b/mat/strippers.py index 1cf2271..7d27874 100644 --- a/mat/strippers.py +++ b/mat/strippers.py @@ -20,13 +20,13 @@ STRIPPERS = { 'application/officeopenxml': office.OpenXmlStripper, } -try: # pdf support +try: # PDF support import poppler import cairo STRIPPERS['application/x-pdf'] = office.PdfStripper STRIPPERS['application/pdf'] = office.PdfStripper except ImportError: - print('Unable to import python-poppler and/or python-cairo: no pdf \ + print('Unable to import python-poppler and/or python-cairo: no PDF \ support') try: # mutangen-python : audio format support diff --git a/test/test.py b/test/test.py index 601f5ef..c414c77 100644 --- a/test/test.py +++ b/test/test.py @@ -21,7 +21,7 @@ dirty.sort() FILE_LIST = zip(clean, dirty) -try: # pdf render processing +try: # PDF render processing import poppler import cairo except: -- cgit v1.3