📄 pstotext.hlp
字号:
1 PSTOTEXT PSTOTEXT - extract ASCII text from a PostScript or PDF file Syntax: pstotext [option|pathname]... where option includes: -cork -landscape -landscapeother -portrait - -gs command -debug -bboxes -output file2 DescriptionPSTOTEXT reads one or more PostScript or PDF files, and writes tostandard output a representation of the plain text that would bedisplayed if the PostScript file were printed. As is describedin the DETAILS section, this representation is only anapproximation. Nevertheless, it is often useful for informationretrieval (e.g., running grep(1) or building a full-text index)or to recover the text from a PostScript file whose source youhave lost.PSTOTEXT calls Ghostscript, and requires Aladdin Ghostscriptversion 3.51 or newer. Ghostscript must be invokable on thecurrent search path as gs. Alternatively, you can use the "-gs"option to specify the command (pathname and options) to runGhostscript.PSTOTEXT reads and processes its command line from left to right,ignoring the case of options. When it encounters a pathname, itopens the file and expects to find a PostScript job or PDFdocument to process. The option "-" means to read and process aPostScript job from standard input. If no - or pathnamearguments are encountered, PSTOTEXT reads a PostScript job fromstandard input. (PDF documents require random access, hencecannot be read from standard input.)The option -cork is only relevant for PostScript files producedby dvips from TeX or LaTeX documents; it tells PSTOTEXT to usethe Cork encoding (known as T1 in LaTeX) rather than the old TeXtext encoding (known as OT1 in LaTeX). Unfortunately filesproduced by dvips don't distinguish which font encodings wereused.The options -landscape and -landscapeother should be used fordocuments that must be rotated 90 degrees clockwise orcounterclockwise, respectively, in order to be readable.The options -debug and -bboxes are mostly of use for themaintainers of PSTOTEXT. -debug shows Ghostscript output anderror messages. -bboxes outputs one word per line with boundingbox information.2 DetailsPSTOTEXT does its work by telling Ghostscript to load aPostScript library that causes it to write to its standard outputinformation about each string rendered by a PostScript job or PDFdocument. This information includes the characters of thestring, and enough additional information to approximate thestring's bounding rectangle. PSTOTEXT post-processes thisinformation and outputs a sequence of words delimited by space,newline, and formfeed.PSTOTEXT outputs words in the same sequence as they are renderedby the document. This usually, but not always, follows the orderthat a human would read the words on a page. Within thissequence, words are separated by either space or newlinedepending on whether or not they fall on the same line. Eachpage is terminated with a formfeed. If you use the incorrectoption from the set {-portrait, -landscape, -landscapeother},PSTOTEXT is likely to substitute newline for space.A PostScript job or PDF document often renders one word asseveral strings in order to get correct spacing betweenparticular pairs of characters. PSTOTEXT does its best toassemble these strings back into words, using a simple heuristic:strings separated by a distance of less than 0.3 times theminimum of the average character widths in the two strings areconsidered to be part of the same word. Note that this typicallycauses leading and trailing punctuation characters to be includedwith a word.The PostScript language provides a flexible encoding scheme bywhich character codes in strings select specific characters(symbols), so a PostScript job is free to use any character code. On the other hand, PSTOTEXT always translates to the ISO 8859-1(Latin-1) character code, which is an extension to ASCII coveringmost of the Western European languages. When a character isn'tpresent in ISO 8859-1, PSTOTEXT uses a sequence of characters,e.g., "---" for em dash or "A\\226" for Abreve. PSTOTEXT can befooled by a font whose Encoding vector doesn't follow Adobe'sconventions, but it contains heuristics allowing it to handle awide variety of misbehaving fonts.(PSTOTEXT no longer translates hyphen (\\255) to minus (\\055).)2 Options -cork assume Cork encoding for dvips output -landscape rotate 270 degrees -landscapeother rotate 90 degrees -portrait don't rotate (default) -bboxes output one word per line with bounding box -debug show Ghostscript output and error messages -gs "command" Ghostscript command -output file output results to "file" (default is stdout) - read from stdin (default if no files specified)2 AuthorsAndrew Birrell (PostScript libraries), Paul McJones (application),and Russell Lang (Windows and OS/2 adaptation).VMS port by Hunter Goatley.2 See_AlsoPSTOTEXT incorporates technology originally developed for theVirtual Paper project at SRC; seehttp://www.research.digital.com/SRC/virtualpaper/As mentioned above, PSTOTEXT invokes Ghostscript. See gs(1) orhttp://www.cs.wisc.edu/~ghost/.2 CopyrightCopyright 1995 Digital Equipment Corporation.Distributed only by permission.See file pstotext.txt for details.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -