To see Kin's Image Server code, cd /afs/d/projects/imageservers/patent/V4 Under there, you'll see individual directories for the different components, e.g. patio, patnfy, patdlv, patreq, etc. On 5/21/2001, I was looking to see how patdlv created the header page and calls enq to print documents. I noticed in the image server's /ips/logs/patdlv10522.log file, was the message, : PDL4229I Making header PostScript file with template [/ips/etc/japioprint.ps]... in patdlv/lib/pdlusen.min, you'll find 4229 I PATDLV_MSG_show_make_ps_head "Making header PostScript file with template [@1%s]...\n" If you look for that text "PATDLV_MSG_show_make_ps_head" in the c files, e.g. find . -type f -name '*.c' -exec grep 'PATDLV_MSG_show_make_ps_head' {} 2>/dev/null \; -ls you'll find all the C files that spit out this message. In my case, it was just the one, patdlv/lib/patdlv.c. ------------------------------------------------------------------------------------------------------------ Some defaults (e.g. #define PAT_DEFAULT_PRINT_COVER_PAGE PAT_DEFAULT_ETC_DIR##"/Print_Cover.ps") are in patdlv/include/patdlv.h ------------------------------------------------------------------------------------------------------------ Other interesting directories are patdisc/lib, which has all the shell scripts, e.g. s40totif.sh, which I had modified in JAPIO and those changes have not made it to this source. I.E. /ips/arcpat/ver04/bin/s40totif.sh on JAPIO's image servers are newer than Delphion's /afs/d/projects/imageservers/patent/V4/patdisc/lib/s40totif.sh. That s40totif.sh file is pointed to by patdisc/lib/irm_mtif.c as part of its RetrieveMultiTiffFiles subroutine. Scanning for RetrieveMultiTiffFiles, shows that this is only used from patdisc/lib/patdiscs.c. ------------------------------------------------------------------------------------------------------------ Another such this-to-that.sh script, is also in /ips/arcpat/ver04/bin, and is called pdftotif.sh. This script uses the pdftops binary, which is part of the xpdf package off the Internet (see httpd://www.opengroup.org/infosrv/PDF/xpdf) On 3-12-2002, I had to replace pdftops in order to fix bug # 147 because it was converting only the first 7 of 77 pages for EP00618926B1.pdf to postscript. You can find the latest version at /afs/d/software/base/xpdf-0.92/xpdf/pdftops -rwxr-xr-x 1 jasper staff 1568354 Mar 29 2001 /afs/d/software/base/xpdf-0.92/xpdf/pdftops To test this process (see /dfs/prod/ipn/bin/dl_common.pm for example code), /dfs/prod/ipn/bin/pdftops EP00618926B1.pdf EP00618926B1.ps Then any2any -i ps -o tiff EP00618926B1.ps EP00618926B1.tif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - On 5-7-2002, there were still problems with xpdf, so I got an even later version from http://ftp.foolabs.com/xpdf/download.html, specifically, ftp://ftp.foolabs.com/pub/xpdf/xpdf-1.00.tar.gz, which I put in /afs/d/software/base/xpdf-1.00 cd /afs/d/software/base gzip -d < /u/jasper/xpdf-1.00.tar.gz | tar xf - cd xpdf-1.00 To circumvent problems configure had with finding a good compiler, I had to export CCC=xlC (Not cc like I first tried, getting a bunch of ld: 0711-317 ERROR: Undefined symbol: __dl__FPv ld: 0711-317 ERROR: Undefined symbol: .__nw__FUl ld: 0711-317 ERROR: Undefined symbol: .__vd__FPv ld: 0711-317 ERROR: Undefined symbol: .__dl__FPv ld: 0711-317 ERROR: Undefined symbol: .__vn__FUl ld: 0711-317 ERROR: Undefined symbol: __PureVirtualCalled ld: 0711-317 ERROR: Undefined symbol: .__vec__new errors) ./configure Then to avoid make: 1254-055 Dependency line needs colon or double colon operator. errors, I had to manually edit all the Makefiles in the different directories and add a tab character to the last line, which in each case was -include Makefile.dep Then a make ran correctly. The resulting xpdf/pdftops file was -rwxr-xr-x 1 jasper staff 2127728 May 07 15:26 /afs/d/software/base/xpdf-1.00/xpdf/pdftops which fixed the problem with the EP01126738A2 image (see bugzilla bug # 173). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Wouldn't you know? Just my luck. On 5-20-2002, foolabs came out with version 1.01. I just missed it by 2 weeks. Now (10-1-2002) I need to see if this fixes some problems I have, namely - In Patolis, viewing EP01033834A2 on mepa2000044. The pdftotif.sh script fails. (Bug #190) Viewing this patent in Southbury fails also. - In Southbury, EP00717480B1 only displays 32 pages, not the 45 that the imag table says it has. - In Southbury, EP00846614B1 only displays 55 pages, not the 60 that the imag table says it has. ftp://ftp.foolabs.com/pub/xpdf/xpdf-1.01.tar.gz gzip -d < xpdf-1.01.tar.gz | tar xf - cd xpdf-1.01 ./configure vi goo/Makefile ltk/Makefile xpdf/Makefile Insert a tab in front of the last line, which in each file, was -include Makefile.dep. Now I find out that my C compiler on jasper is screwed up or at least, incomplete. I get xlC: 1501-265 C++ compiler is not installed or cppcomp attribute ( = /usr/vacpp/exe/xlCentry ) in the config file is incorrect. Recently (July 1, 2002 -- see my aixnotes/c file) I replaced ibmcxx with vacpp and there was no /usr/vacpp/exe/xlCentry. This file was on grumpy and is part of the vacpp.cmp.batch fileset which I did not have installed. Over to /afs/d/software/base/VisualAge.C++.V5 and I see that Carol put out a nice little README which warned to first install X11.compat.adt.Motif12. So, su cd /afs/d/software/base/AIX.4.3.3 smitty installp To install X11.compat.adt.Motif12, then cd /afs/d/software/base/VisualAge.C++.V5/vac1/usr/sys/inst.images smitty installp To install vacpp.cmp.batch Now make complains with "GString.h", line 85.34: 1540-0274 (S) The name lookup for "__strcmp" did not find a declaration. I also needed to add to my nodelock file. I was also missing the vacpp.cmp.include fileset. Now make "only" complains about "LTKApp.cc", line 279.23: 1540-0256 (S) A parameter of type "fd_set *" cannot be initialized with an expression of type "int *". "LTKApp.cc", line 279.23: 1540-1205 (I) The error occurred while converting to parameter 2 of "select (int, fd_set *, fd_set *, fd_set *, timeval *)". Ok, ok. Let's start all over. cd rm -rf xpdf-1.01 gzip -d < xpdf-1.01.tar.gz | tar xf - cd xpdf-1.01 ./configure vi goo/Makefile ltk/Makefile xpdf/Makefile Insert a tab in front of the last line, which in each file, was -include Makefile.dep. make Which works, if you ignore the hundreds of the following warning messages, ... 1540-1608 (W) An anonymous union should only define non-static data members. ld: 0711-224 WARNING: Duplicate symbol: OutputDev::... This version fixed the problems I was having with EP00717480B1 showing 32 pages, not 45, and with EP01033834A2 not showing any at all, but it did not fix EP00846614B1 which is still broken. The 1.00 version showed 55 pages and the 1.01 version, only 54 pages, but Adobe & counting the number of "/Type /Page" lines shows it really has 60 pages. I sent a note to the author, derekn@foolabs.com on 10-1-2002, but it wasn't his problem. The problem is due to a bug in arcps, an old C program written by Almaden folks including Carol. It was a bug in their file handling routines, where a file wasn't getting closed and they were running out of their internal file handles (max=100). After a few days, Carol got this fixed. The latest version is at /dfs/prod/ipn/arcps/current/arcps. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - By the way, you can use this Perl snippet to count the number of pages in a PDF file, #!/usr/bin/perl $pattern="/Type /Page"; $count=0; while ( <> ) { tr/\r\n//d; if (/$pattern$/) { $count++ }; }; print "$count\n"; to use, feed your pdf file to this program, e.g. a=/dfs/images/EP/14/66/EP00846614B1.pdf perlgrep-c < $a or if you like one-liners, p=EP01138745A1 d=/dfs/images/EP/45/87 perl -e 'while (<>) {tr/\r\n//d;if (m=^/Type /Page$=) { $c++ }};print "$c\n";' < $d/$p.pdf Then to convert to Postscript and count the number of pages, /dfs/prod/ipn/bin/pdftops $d/$p.pdf /tmp/$p.ps grep -c '^showpage$' /tmp/$p.ps To convert to tiff and count the number of pages, cd /dfs/prod/ipn/bin ./any2any -i ps -o tiff /tmp/$p.ps /tmp/$p.tif ./anyinfo /tmp/$p.tif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - When any2any converts a postscript file to tif, it calls aps2ras, which calls arcps for a FAX device and A4 paper. aps2ras is just a shell wrapper script for arcps. There are others you'll find in /u/cht/Rasterizers/arcps/ver10, e.g. ps2tiff, On 12-4-2002, Carol and I were running one to convert a page in different ways, trying to get the scaling correct. See other files in that directory, like superdev.devices, devices.ps, and printers.ps. cd /u/cht/Rasterizers/arcps/ver10 ps2tiff /u/jasper/public_html/US04215800.page1.ps /u/jasper/public_html/US04215800.page1.tif.4 ------------------------------------------------------------------------------------------------------------ Important config file is at /ips/etc/arcpat.cfg. ------------------------------------------------------------------------------------------------------------ Another this-to-that conversion is done in cgi-bin/download.cmd when we convert tif files to PDF format. Essentially what is done is export PDF_CREATOR=JAPIO /dfs/prod/ips/bin/any2any -i tif -o pdf /ips/images/WO/79/49/WO02074979A2.miwo2002042.tif \ /dfs/dlcache/WO02074979A2.miwo2002042.773002 2>/ips/tmp/download.WO02074979A2.77300.err and then renaming it to /dfs/dlcache/WO02074979A2.miwo2002042.pdf A tail -1 /dfs/dlcache/WO02074979A2.miwo2002042.pdf should show %%EOF as its last line. ------------------------------------------------------------------------------------------------------------ Tom keeps his latest any2any binary at /afs/d/projects/anyimage/working/any/anyimage/opt32/any2any I looked at /afs/d/projects/anyimage/dmb_51/any/anyimage/irdctl.c & irdctl.h to learn that Tom could handle page numbers in a control file. (irdctl = "Image ReaD ConTRol File") ------------------------------------------------------------------------------------------------------------ In getimage, I have this ugly hack # Strangely enough, ipsrun's PATH does not include the current directory, so would get # sh: aps2ras: not found # sh: aps2ras: not found # Cannot open input file /ips/images/cache/87/56/US04965687__.ps or unsupported format # when converting postscript files. (So how did this EVER work??) Fix path here. system("cd $any2anyDir;export PATH=\$PATH:;./any2any $numParm $inputfilename $tempfilePrefix.$type 2>&1 | /us r/bin/egrep -v '^Opened:|^Execution of PostScript Interpreter is complete|pages? written OK|hscale|Decompressio n failed' > $tempfilePrefix.err"); On 1-27-2005, Tom commented that I can better handle the setting of the PATH with an any2any's -e parm, system("cd $any2anyDir;./any2any -e PS_FILT=../bin/aps2ras ... or maybe =/dfs/prod/ipn/bin/aps2ras ... I didn't change it 'cause I'd have to test from the command line (where one may be cd'd anywhere) as well as the cgi-bin, fcgi-bin, and Tomcat environments.