The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Printing

I've been having issues with printing in .NET (This applies to MFC, and Win32 in general as well).

Regular 'text' documentation is trivial to print. Graphics which are within the chosen printer's margin bounds are also trivial to print.

The issue comes from printing very large 'visio-like' documents. An exception is thrown if you populate data to be printed which is "outside" the bounds determined by the chosen page settings.

So there are two options as I see it:

Either there is standard methodology for printing large (wide and 'tall') visio-like documents, and I am just ignorant of these techniques, or there are algorithms to 'force fit' everything within the chosen margin bounds. I don't see how this is possible if the document is very very wide, for example.

The one thing I noticed with Visio and other similar programs is that they 'force' their perception of what is printable on the user by putting up an image of a page in the background, whereby, if your drawings are within the bounds of this background page, they will fit on the printed page. Otherwise, good luck. I've seen this in other similar applications as well...but it's not solving the problem, it's merely indicating to the user where the limitations are.
Andrey Butov Send private email
Thursday, November 17, 2005
 
 
I'm confused.

If you send the printer a document or image that is larger than the defined paper size, what do you expect to happen?  I'd would want to see the exception as opposed to the printer silently wasting lots of paper and ink printing a fraction of the image.

You could automatically shrink the image down porportionally, but you run the risk of making it illegible.  If you don't give the user some warning or some way of previewing just how much the image will be shrunk - again, that's wasting paper, ink and generally fustrating everyone involved.

Alternatively, you can do what Microsoft Excel does and allow for the image to be printed across multiple pages, and allow the user to tape or staple them together.  It's difficult to set that up properly and some sort of indication where the page breaks are, is going to be required.

No matter what you do, if the image is too big for the paper, you do want to warn the user and allow them to make adjustments.  I don't see what the problem is.
Anonymous Coward
Thursday, November 17, 2005
 
 
Are there any resources for techniques to implement multi-page printing in the way Excel does it?
Andrey Butov Send private email
Thursday, November 17, 2005
 
 
Hmm...

I don't know offhand of any libraries that do it.  I would think the only way you can accomplish something like that is to convert your "document" into an image and then associate so many pixels with square inches on the page - depending on the zoom level.

(I don't think there's any point in associating lines or characters with square inches because you'll rarely have a text document that's five feet wide and 11 inches high.)

It's an interesting mathematical problem I may have to tackle this weekend just to satisfy my own curiosity.
Anonymous Coward
Thursday, November 17, 2005
 
 
As a followup, once you have converted your image into an appropriate TIFF or PDF file, I think you can use Ghostscript to print it.
Anonymous Coward
Thursday, November 17, 2005
 
 
Interesting idea. I will take a stab at it this weekend as well.

Thanks.
Andrey Butov Send private email
Thursday, November 17, 2005
 
 
Convert to TIFF or PDF as A.C. suggested. Then use a program like Adobe Illustrator or Photoshop to tile and split your image into separate printable pages.
Nonymous
Friday, November 18, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz