PDReaderPage.mesa
Last edited by Ken Pier, July 8, 1985 3:50:28 pm PDT
DIRECTORY PDFileFormat, PDFileReader, ImagerPixelMap, ViewerClasses;
PDReaderPage: CEDAR DEFINITIONS = BEGIN
Handle: TYPE=REF Rep;
Rep: TYPE=RECORD [
pixelMap: ImagerPixelMap.PixelMap
];
InterpretPage: PROC [handle: PDFileReader.Handle, viewer: ViewerClasses.Viewer, pages: PageRecRef] RETURNS [ok: BOOLEAN];
Interprets one page (may be multiple passes), and ships it out.
May raise PDFileReader.Warning or PDFileReader.Error or PDReaderOutput.Error or PDReaderOutput.Abort
Returns FALSE upon document end.
PageRecRef: TYPE=REF PageRec;
PageRec: TYPE=RECORD [
link: PageRecRef, --NIL => end of list
type: PDFileReader.WhatChanged, --imageStart or loadChange
pageNumber: INT, -- -1 if loadChange
index: INT --index in PD file of the startImage or storeLoad command
];
GetPageStructure: PROCEDURE [handle: PDFileReader.Handle] RETURNS [PageRecRef, INT];
assumes filestream is available from Handle and Gets can be executed safely
scans the PD file and returns a linked list of records which contain the indexes
in the file of imageStart or loadChange commands. Allows a client to skip thru the file
to a particular page, building the load for that page as needed. The total number of pages is also returned.
ResetToPage: PROCEDURE [data: REF ANY] RETURNS [PageRecRef];
a DUMB routine to reconstruct the load for the given page "pageNumber".
requires that a page structure has already been built using GetPageStructure
and passed in as parameter "pages". Returns a PageRecRef for the page that has been
successfully reset to. Returns NIL if pageNumber is not in the pages list.
END.