%!PS % AN ACROBAT FLATE COMPRESSED OBJECT FILE VIEWER % ============================================== % by Don Lancaster % Copyright c 2002 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % Linking welcome. Reposting expressly forbidden. % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.3 % This is an interactive "bare matal" PostScript utility that allows you to inspect % and view the contents of PDF Acrobat Flate compressed stream objects. Only the % first 5000 recovered characters of a stream < 65K are returned in this version. % See GuruGram #8 http://www.tinaja.com/gurgrm01.asp for additional use details. % whose filename is http://www.tinaja.com/glib/flatevue.pdf %%%%%%%%%%%%%%%%%%%%%%%% THE VIEWER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (1) Make the PDF file to be viewed locally available. Define the file here. % Be sure to Use DOUBLE reverse slashes any time you mean a single slash.... /sourcefilename (C:\\WINDOWS\\Desktop\\gurugrams\\alphatrans\\threerects.pdf)def % (2) Make a file to read... sourcefilename (r) file /workfile exch def % make a file to read % (3) Read the file to be viewed to determine the Flate length of the stream. % If the /length appears as 29 0 R, go to object 29 to read the length. /flatelengthstr 349 string def % set length of compressed stream /reportstring 5000 string def % set length of max reported characters % (4) Read the end PDF xref table to find the offset into the desired object. Object % #28 will be on the twenty-eighth line. /fileposloc 97876 def % start of Flate encoded PDF object % (5) Count (or guess and retest) the header characters needed before the first % compressed character. This INCLUDES the last carriage return. /fileheaderoffset 81 def % first ACTUAL Flate character position % (6) Temporarily block the file read until you are sure you actually start on the % first flate character. Note there should NOT be a carriage return between the % opening paren and the start of the actual Flate characrers. /oktodecompress true def % set to true after position is correct % (7) Send this file to Acrobat Distiller. VIEW THE RESULTANT LOG FILE. Make sure % the file position is correct before setting /oktodecompress to true. workfile fileposloc fileheaderoffset add setfileposition % go to start of file workfile flatelengthstr readstring pop % read the file (\n\nFlate compression...\n) print dup == % verify correct position (\n\nReads as...\n\n) print % pretty print oktodecompress { /FlateDecode filter reportstring readstring % uncompress the stream file pop print (\n\n\n) print % and report to log file } if % conditional avoids errors % Note that a "WARNING: Empty Job. No PDF file produced" message is normal and % expected since the intended results appear in the log file. % Flate files in excess of 65,000 characters will require a somewhat fancier reader % and data recorder. Additional help per http://www.tinaja.com/info01.asp % EOF