Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
368252a243 | ||
|
|
ccefda1bee | ||
|
|
3d0e8c9629 | ||
|
|
313bbbb94c | ||
|
|
0360f078de | ||
|
|
c8901666c4 | ||
|
|
7430006596 | ||
|
|
f3e06b2dbd | ||
|
|
e97df307ff | ||
|
|
1443354aa2 |
@@ -0,0 +1 @@
|
|||||||
|
ref-names: $Format:%D$
|
||||||
+3
-1
@@ -5,4 +5,6 @@
|
|||||||
# (binary is a macro for -text -diff)
|
# (binary is a macro for -text -diff)
|
||||||
*.jar binary
|
*.jar binary
|
||||||
*.pdf binary
|
*.pdf binary
|
||||||
*.PDF binary
|
*.PDF binary
|
||||||
|
|
||||||
|
.git_archival.txt export-subst
|
||||||
|
|||||||
+4
-4
@@ -116,8 +116,8 @@ Install or upgrade the required Homebrew packages, if any are missing::
|
|||||||
brew install qpdf
|
brew install qpdf
|
||||||
brew install ghostscript
|
brew install ghostscript
|
||||||
brew install python3
|
brew install python3
|
||||||
brew install libxml2
|
brew install libxml2 libffi leptonica
|
||||||
brew install leptonica
|
brew install unpaper # optional
|
||||||
brew install tesseract
|
brew install tesseract
|
||||||
|
|
||||||
Update the homebrew pip and install Pillow::
|
Update the homebrew pip and install Pillow::
|
||||||
@@ -252,11 +252,11 @@ In case you detect an issue, please:
|
|||||||
Press & Media
|
Press & Media
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- `c't 1-2014, page 59 <http://www.heise.de/ct/inhalt/2014/1/58/>`__:
|
- `c't 1-2014, page 59 <http://heise.de/-2279695>`__:
|
||||||
Detailed presentation of OCRmyPDF v1.0 in the leading German IT
|
Detailed presentation of OCRmyPDF v1.0 in the leading German IT
|
||||||
magazine c't
|
magazine c't
|
||||||
- `heise Open Source, 09/2014: Texterkennung mit
|
- `heise Open Source, 09/2014: Texterkennung mit
|
||||||
OCRmyPDF <http://www.heise.de/-2356670>`__
|
OCRmyPDF <http://heise.de/-2356670>`__
|
||||||
|
|
||||||
Disclaimer
|
Disclaimer
|
||||||
----------
|
----------
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ Please always read this file before installing the package
|
|||||||
Download software here: https://github.com/jbarlow83/OCRmyPDF/tags
|
Download software here: https://github.com/jbarlow83/OCRmyPDF/tags
|
||||||
|
|
||||||
|
|
||||||
|
v4.0.6:
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Update install instructions
|
||||||
|
- Provide a sRGB profile instead of using Ghostscript's
|
||||||
|
|
||||||
|
|
||||||
v4.0.5:
|
v4.0.5:
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -5,6 +5,7 @@ from tempfile import NamedTemporaryFile
|
|||||||
from subprocess import Popen, PIPE, check_call
|
from subprocess import Popen, PIPE, check_call
|
||||||
from shutil import copy
|
from shutil import copy
|
||||||
from . import get_program
|
from . import get_program
|
||||||
|
from .pdfa import SRGB_ICC_PROFILE
|
||||||
|
|
||||||
|
|
||||||
def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log,
|
def rasterize_pdf(input_file, output_file, xres, yres, raster_device, log,
|
||||||
@@ -52,7 +53,7 @@ def generate_pdfa(pdf_pages, output_file, threads=1):
|
|||||||
"-dJPEGQ=95",
|
"-dJPEGQ=95",
|
||||||
"-dPDFA=2",
|
"-dPDFA=2",
|
||||||
"-sPDFACompatibilityPolicy=2",
|
"-sPDFACompatibilityPolicy=2",
|
||||||
"-sOutputICCProfile=srgb.icc",
|
"-sOutputICCProfile=" + SRGB_ICC_PROFILE,
|
||||||
"-sOutputFile=" + gs_pdf.name,
|
"-sOutputFile=" + gs_pdf.name,
|
||||||
]
|
]
|
||||||
args_gs.extend(pdf_pages)
|
args_gs.extend(pdf_pages)
|
||||||
|
|||||||
+7
-33
@@ -5,10 +5,13 @@
|
|||||||
|
|
||||||
from __future__ import print_function, absolute_import, division
|
from __future__ import print_function, absolute_import, division
|
||||||
from string import Template
|
from string import Template
|
||||||
from subprocess import Popen, PIPE
|
|
||||||
import os
|
|
||||||
import codecs
|
import codecs
|
||||||
from . import get_program
|
import pkg_resources
|
||||||
|
|
||||||
|
ICC_PROFILE_RELPATH = 'data/sRGB_IEC61966-2-1_black_scaled.icc'
|
||||||
|
|
||||||
|
SRGB_ICC_PROFILE = pkg_resources.resource_filename(
|
||||||
|
'ocrmypdf', ICC_PROFILE_RELPATH)
|
||||||
|
|
||||||
|
|
||||||
# This is a template written in PostScript which is needed to create PDF/A
|
# This is a template written in PostScript which is needed to create PDF/A
|
||||||
@@ -93,38 +96,9 @@ def _get_pdfa_def(icc_profile, icc_identifier, pdfmark):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def _get_postscript_icc_path():
|
|
||||||
"Parse Ghostscript's help message to find where iccprofiles are stored"
|
|
||||||
|
|
||||||
p_gs = Popen([get_program('gs'), '--help'], close_fds=True,
|
|
||||||
universal_newlines=True,
|
|
||||||
stdout=PIPE, stderr=PIPE)
|
|
||||||
out, _ = p_gs.communicate()
|
|
||||||
lines = out.splitlines()
|
|
||||||
|
|
||||||
def search_paths(lines):
|
|
||||||
seeking = True
|
|
||||||
for line in lines:
|
|
||||||
if seeking:
|
|
||||||
if line.startswith('Search path'):
|
|
||||||
seeking = False
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
if line.strip().startswith('/'):
|
|
||||||
yield from (
|
|
||||||
path.strip() for path in line.split(':')
|
|
||||||
if path.strip() != '')
|
|
||||||
for root in search_paths(lines):
|
|
||||||
path = os.path.realpath(os.path.join(root, '../iccprofiles'))
|
|
||||||
if os.path.exists(path):
|
|
||||||
return path
|
|
||||||
|
|
||||||
raise FileNotFoundError("Could not find Ghostscript's iccprofiles")
|
|
||||||
|
|
||||||
|
|
||||||
def generate_pdfa_def(target_filename, pdfmark, icc='sRGB'):
|
def generate_pdfa_def(target_filename, pdfmark, icc='sRGB'):
|
||||||
if icc == 'sRGB':
|
if icc == 'sRGB':
|
||||||
icc_profile = os.path.join(_get_postscript_icc_path(), 'srgb.icc')
|
icc_profile = SRGB_ICC_PROFILE
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("Only supporting sRGB")
|
raise NotImplementedError("Only supporting sRGB")
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ setup(
|
|||||||
],
|
],
|
||||||
setup_requires=[
|
setup_requires=[
|
||||||
'setuptools_scm',
|
'setuptools_scm',
|
||||||
'setuptools_scm_git_archive',
|
|
||||||
'cffi>=1.5.0',
|
'cffi>=1.5.0',
|
||||||
'pytest-runner'
|
'pytest-runner'
|
||||||
],
|
],
|
||||||
@@ -231,5 +230,6 @@ setup(
|
|||||||
'ocrmypdf = ocrmypdf.main:run_pipeline'
|
'ocrmypdf = ocrmypdf.main:run_pipeline'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
package_data={'ocrmypdf': ['data/sRGB_IEC61966-2-1_black_scaled.icc']},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False)
|
zip_safe=False)
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user