Thank you for your reply.
#2 is the extremely important part I'm focusing upon for the windows platform.
The flash (#1) although it is not ideal, it still is functional for most customers (unless for some reason they batch many print requests in a row).
So far, I'm at a dead end for using the correct PrintToPdf content and sending it to the print spooler instead of a file.
I'm looking now at the "Printing_Worker" Thread, specifically PrintJobWorker::OnNewPage().
If the print_preview_handler starts the print job quickly (via PrintPreviewHandler::HandlePrint(const base::ListValue* args)), then print_job_worker (via PrintJobWorker::OnNewPage()) is already working with a document that has the missing pages on the end.
In that method, int page_count = document_->page_count(); is correct, but
Scoped_refptr<PrintedPage> page = document_->GetPage(page_number_.ToInt())
and
// The page is there, print it.
SpoolPage(page.get());
spools the blank pages at the end.
I'm hoping if we can delay this being called, that also would correct the problem:
PrintJobWorker::OnDocumentChanged(PrintedDocument* new_document)
{
...
document_ = new_document;
}
I can see why this bug has been out in the field so long. Conceptually, it sounds easy, just a timing bug. However, in practice, finding the place where to delay the print process until the rendering is complete has been very hard.
Regards,
Jon