Printing gets partial results



Hi there,

I have a Java PrinterJob that is printing a printable object. The pages are a header with an image and two lines of text, plus a table header. The middle portion is data from the cells of a table. And there is a few lines of footer text. Originally I tried scaling the graphics object, and telling the table to print, but after a few pages, the table would stop printing. So I converted to code to manually get the data from the table and print it using DrawString commands on the graphics context. All of my layout code seems correct because most pages will print correctly (all pages are identically generated, they just print data from different portions of the table, on different pages)

The problem is that on any job larger than a page, one page will stop rendering often in the middle of a line, and the rest of that page will not render to the printer. It is actually kind of weird behaviour because if I run the same job again (regenerating it from scratch - not reusing the printer job). Then a different page will be the problematic page and cease rendering.

Usually this is only 1 or 2 pages. Even on a job of 170 pages. It is exactly enough to make the whole thing useless. Because every job, no matter how small will have one page that fails to render. (except a single page job. That works)

It is as though the page needs to be "flushed" and the engine is giving up on the page for some unknown reason.

It could be a threading issue, but I've tried running the whole shebang (getting the print service, popping the dialog, and printing) on the EDT. And I've tried running portions in a separate thread. (Ideally, this would ALL happen in a separate thread so that other portions of the app aren't blocked). None of those attempts made much difference. (Some attempts had worse results than others. But NOTHING will make the whole job print cleanly)

I've also tried using the PrintService method as well as the printerjob method. Both end up with the same results

I have no idea why this is happening. Does anyone out there have any suggestions at all?

Thanks for bearing with this long message,
John Schank

BTW, I'm testing this by printing to a PDF printer, so as not to waste paper. But I don't think that is a critical element.

.



Relevant Pages

  • Re: Printing header in Firefox -
    ... page (page size, dimensions, etc., that set the printing area. ... Page Setup under File allows me to adjust the distance from the top ... of the sheet to where the first line of text is printed. ... URL of the source and that prints nicely in the header. ...
    (Fedora)
  • Page printing - margin problems
    ... there have been some printing problems related to the ... the header and footers have now moved out of the printable ... Changing the top and bottom margins does not have an efffect upon where the ... header and footer are located. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • which print processor for best printing performance?
    ... Network ... Specifically, printing tables and large, complex images make the ... I feel it might be related to the older hardware rendering performance ... I also wonder what the "winprint" print processor is for as opposed to ...
    (microsoft.public.win2000.printing)
  • Re: lock 1 picture, 1 graphic and two text boxes in a template
    ... There is no difference in printing of the header and the document body. ... > lock the elements of the letterhead on the template foreground. ... > experience with color printing pictures and graphics from the header you ...
    (microsoft.public.word.docmanagement)
  • Re: Printouts NOT coming out in order they are sent???
    ... You using two COMPLETE different approaches to printing the repots. ... tell access to print the report, BUT DO NOT display it.. ... The display and graphics and rendering systems of windows is a highly ...
    (comp.databases.ms-access)

Loading