
lib.pdfpagecount.ps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tess4j Show documentation
Show all versions of tess4j Show documentation
# Tess4J
## Description:
A Java JNA wrapper for Tesseract OCR API.
Tess4J is released and distributed under the Apache License, v2.0.
## Features:
The library provides optical character recognition (OCR) support for:
TIFF, JPEG, GIF, PNG, and BMP image formats
Multi-page TIFF images
PDF document format
% pdfpagecount.ps
% read pdf file and output number of pages
% based on pdf2dsc.ps with one line taken from ps2ascii.ps
/PDFfile PDFname (r) file def
/PageCountString 255 string
def
systemdict /.setsafe known { .setsafe } if
/.show.stdout { (%stdout) (w) file } bind def
/puts { .show.stdout exch writestring } bind def
GS_PDF_ProcSet begin
pdfdict begin
PDFfile
pdfopen begin
/FirstPage where { pop } { /FirstPage 1 def } ifelse
/LastPage where { pop } { /LastPage pdfpagecount def } ifelse
(%%Pages: ) puts
LastPage FirstPage sub 1 add
PageCountString cvs puts
quit
© 2015 - 2025 Weber Informatics LLC | Privacy Policy