diff --git a/headers/os/interface/PrintJob.h b/headers/os/interface/PrintJob.h index d9011bd9d3..06326590a3 100644 --- a/headers/os/interface/PrintJob.h +++ b/headers/os/interface/PrintJob.h @@ -101,7 +101,7 @@ virtual void _ReservedPrintJob4(); char * fPrintJobName; int32 fPageNumber; BFile * fSpoolFile; - print_file_header fCurrentHeader; + print_file_header fCurrentHeader; BRect fPaperSize; BRect fUsableSize; status_t fError; @@ -113,7 +113,7 @@ virtual void _ReservedPrintJob4(); int32 fLastPage; short fXResolution; short fYResolution; - _page_header_ * fCurrentPageHeader; + _page_header_ * fCurrentPageHeader; off_t fCurrentPageHeaderOffset; uint32 _reserved[2]; }; diff --git a/src/kits/interface/PrintJob.cpp b/src/kits/interface/PrintJob.cpp index 8fed40e2a5..6b8b779b15 100644 --- a/src/kits/interface/PrintJob.cpp +++ b/src/kits/interface/PrintJob.cpp @@ -38,9 +38,12 @@ static const char *kNoPagesToPrintText = "No Pages to print!"; // Summery of spool file format: // See articel "How to Write a BeOS R5 Printer Driver" for description -// of spool file format: http://haiku-os.org/node/82 +// of spool file format: +// http://haiku-os.org/documents/dev/how_to_write_a_printer_driver // print_file_header header +// On BeOS R5 header.version is 1 << 16 and +// header.first_page is -1. // BMessage job_settings // _page_header_ page_header // followed by number_of_pictures: @@ -397,6 +400,9 @@ BPrintJob::BeginJob() // page_count is updated in CommitJob() fCurrentHeader.version = 1 << 16; fCurrentHeader.page_count = 0; + // on BeOS R5 the offset to the first page + // was always -1. + fCurrentHeader.first_page = (off_t)-1; if (fSpoolFile->Write(&fCurrentHeader, sizeof(fCurrentHeader)) != sizeof(fCurrentHeader)) { CancelJob();