-1

Last year there was a bug found in Ghostscript. It is documented here: http://bugs.ghostscript.com/show_bug.cgi?id=696116

It is marked Status: RESOLVED WONTFIX

In the end the assignee, Ken Sharp, writes: "Unfortunately I don't see any prospect for resolving this in Ghostscript."

My question to anyone are two:

  1. Is there really no way to make Ghostscript resolve this problem (with added spaces between characters)?
  2. Is there an open source alternative to Ghostscript that could batch convert scanned PDF to PDF/A-1b without messing up OCR?

Many thanks in advance!

/Paul

2
  • Unless your willing to fix the programming bug, yes, it's not likely to be fixed. I am sure there are alternatives, I suggest, you find one.
    – Ramhound
    Jul 25, 2016 at 12:36
  • Yes, I know there are alternatives, but non is open source as far as I know. Therefore I assume, since the open source OCR-recognition software Tesseract does the OCR-reading, and the accuracy is fully kept by other (proprietary) softwares when converting to PDF/A-1b, it should be a resolvable problem in Ghostscript since all specifications are open and known. However, I do not have these skills to make changes in the Ghostscript code, but the circumstances are for that it should be possible to fix it for someone with sufficient knowledge. Jul 25, 2016 at 14:18

1 Answer 1

1

Is there really no way to make Ghostscript resolve this problem (with added spaces between characters)?

Ken Sharp says

what you appear to be facing is a limitation in the Acrobat search facility, which is exposed by the way we emit the text.

I think he is saying it is not Ghostscript that is adding the spaces between characters.

And I believe his explanation. The PDFWrite device driver is subject to the limitations of a device driver in Ghostscript. I imagine the API was designed for making marks on visible surfaces, not for anything else that has been subsequently shoehorned in.

In particular, the notion that a sequence of marks constitute a word is of no importance when making marks at specified positions. The mark making device doesn't need to know the difference between a space and spacing (kerning etc).

A kind of corollary to this is that, so far as I know, words are not a thing in PDF or in it's ancestor Postscript. They don't have any need to keep track of words and don't provide any specific way of identifying them within PDF or PS file contents.


Is there an open source alternative to Ghostscript that could batch convert scanned PDF to PDF/A-1b without messing up OCR

So far as I know, The PDF specifications don't define "scanned PDF" or "OCR". Some PDF authoring tools presumably make clever use of PDF features when they are creating PDF files from scanned images and when invisibly including text that they created using OCR. This allows text searches and cut&paste operations to be performed on the PDF produced - which would not be possible if only the bitmap image were present.

Such PDFs may be useful, but they are really a bit of an abomination. It is always better to produce a PDF from a non-scanned sources where available.

PDF was originally intended to be a "final" document format. Not one intended to have further manipulations performed on it.

However it must be possible that other programs supporting PDF manipulation do so without forcing the conversion to be done through a printing API. In which case they can do it in a way that produces a result that better suits the quirks of Acrobat and other PDF-reading software.

1
  • Ken Sharp says: "what you appear to be facing is a limitation in the Acrobat search facility, which is exposed by the way we emit the text." However, this possible limitation, does not affect other softwares, only Ghostscript. Therefore, logically, there should be a way to find a work-around or fix for this. Unfortunately I don't hade the necessary skills to try to fix it:-). Btw thanks for your interesting answer:-) Jul 25, 2016 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .