File formats for Drawing Files

Using the Crystal Reports viewer ManuSoft has the ability to print out drawings on your Job Tickets. (And potentially you could add drawings or images to other documents, like Delivery Notes, or a custom Goods Received Note.) This begs the question what sorts of image file does ManuSoft/Crystal reports support, and how do I best create them to get the best print outs?

The image formats supported by Crystal are BMP, TIFF/TIF, JPEG/JPG, PNG, and WMF (Windows Metafile). Of these, JPEG is probably the worst for reproducing drawings, since its “lossy” compression techniques are meant for photos, not drawings, which results in the fine details getting all fuzzy when they are saved in JPEG format. BMP, TIFF and PNG will all give very similar output. BMP has no compression, so results in large file sizes. TIFF has compression, but there are actually many different sub-versions of TIFF and Crystal does not explicity list which it supports, so users should always test their particular graphic software to make sure the TIFFs that it produces are ones which Crystal understands. PNG has the best compression, but is also a relatively new standard, so not all software supports it.

Now, almost everybody knows that a computer image has a size measured in pixels; an image file is x pixels wide and y pixels tall. And when displayed on a computer screen it will typically be displayed at its “native” resolution, with one pixel in the image using one pixel on the screen (unless it is so large that the image is bigger than the screen, in which case it will often get automatically shrunken.) A typical screen resolution is around 75 to 100 dpi (dots per inch), so an image that is 400×600 will be very approximately 4 by 6 inches on the screen.  What about printing the image out on a printer though? Now we have a device that might be printing at anywhere from 180 to 1200 dpi. Somehow the software has to work out how big to make the image on the paper, and certainly with no further information being available, there is no correct answer to the question. The image needs to have some additional information stored with it before the software can make a sensible decision.

The problem is, a lot of image formats only care about being displayed on screen. What we need is for the image to have stored with it some information about what the DPI was when the image was taken. So, for example, I scan in a 4in x 6in drawing at 150 DPI, which results in a 600×900 pixel image. So long as the “I’m a 150dpi image” information is also stored with the file then Crystal (and other software) knows it’s a 4in x 6in image, and when it prints that image on a 600dpi laser printer it can use a 4×4 pixel block for each of the original pixels, so the image comes out at the correct size. So, what image types support this information? TIFF images have a DPI stored in their format. A JPG file may have a DPI stored in them. BMP and PNG do not store any DPI information. This usually means that I recommend TIFF as a good format to start off with.

And if you are scanning your drawings yourself, with a typical flat-bed scanner, you can be pretty sure that the TIFF file will have the correct DPI stored with it. Thus, if you have a drawing printed out on an A4 page, and you scan that A4 page in, then it should come out neatly on an A4 page when attached to the job ticket. In reality I’ve found you should scan in slightly less than the full A4 page, to allow for the non-printable margin that the printers normally allow for, plus the small header and footer that is part of the Job Ticket report. But what if you are using some sort of “Export to TIFF” function directly in your CAD software, rather than scanning in a paper document? What DPI will be stored with the file in that situation? The answer is “I don’t know”, because of course every bit of software is different. It is, unfortunately, a case of “suck it and see”.

Let’s talk a bit more about what size of image you should scan. The default Job Ticket in ManuSoft has a small default image in it which is a graphic consiting of the words “Drawing Not Available – Click here to view Hyperlink.” Thus if the Crystal Reports Viewer cannot interpret your image file correctly, this is what you’ll see instead. If you click on the graphic then it’ll try to launch the file in whatever your default viewer for that file type is. So, for example, if you attach a PDF file to a ManuSoft part, then when you display the Job Ticket on screen you’ll see the “Drawing Not Available” image, but you can click on it to automatically open the PDF in your installed version of Acrobat Reader.

Anyway, the default image is quite small, but it is set to “can grow”, thus when you scan a larger image then the Crystal Viewer will try to display the image at it’s “natural size”. There is no way to set an upper limit to this natural size, so if you attach an A3 sized graphic, then it will get spread over two (or more likely four, because of the margins) A4 pages in the print out. Unfortunately also the images cannot be automatically rotated, so if you scan in your A4 drawing in landscape mode, then when the Crystal Report puts that image on the portrait mode Job Ticket you’ll find the image split over two pages as it has ended up too wide for the page. The only way to stop this “multiple page” behaviour is to create a custom MyTicketMOB.rpt report where you turn the “can grow” option off, but size the default graphic to something suitable for the images you will be using. All the image files you link to will now be stretched or shrunk to the default size you have set, so you obviously need to be fairly consistent in the scanning of your drawings in order to get a consistent output.

So, as you can see, there are a lot of factors in place that usually means you have to experiment a little to get the best results. It’s worth you having a decent image viewing program installed on your PC while doing all this, something which will give you information like the DPI setting inside the files being created. The copy of Microsoft Paint that comes with Windows XP is not enough! I recommend IrfanView (http://www.irfanview.com/) as a good bit of Freeware for viewing images of all types.

Way back at the start of this post I mentioned a final format of “Windows Metafile”, or WMF. Unlike all the other formats, WMF is a vector format, not a bitmap format. This means that WMF is a lot more like DXF or other CAD files. WMF is most commonly used by Microsoft for their clipart files, so you’ll find a heap of WMF files somewhere in your Microsoft Office program folders. Because it is a vector format this means that it can be resized to any size and still look good, instead of going “blocky”. This would obviously be great for drawing files. But as a vector format it doesn’t have a DPI setting, but there’s some sort of “default size” in there somewhere. But it is also a pretty obscure format in a way, so unless the CAD software that you use specifically supports WMF as an export format, you should probably ignore it. But if it is supported then you may want to try it out and with some small modifications to the TicketMOB.rpt report you might get some very good results.

Share