tags:

views:

76

answers:

2

I'm creating an image using the JpegBitmapEncoder.. it's a big image (70k px X 600px). When I try to save it I'm getting a "The image dimensions are out of the range supported by this codec". Is there another encoder i can use that will generate an image that size?

Format isn't an issue... i'd prefer a format with compression, but it really doesn't matter for this application. It's eventually going to be converted to a PDF...

A: 

I suspect that the width of the image is encoded as a 16-bit integer (0 - 65536). This would be out of range for a bitmap too. Interestingly Paint.NET won't let you create a bitmap with a width bigger than 65536.

That sounds like a pretty large image with an odd image ratio - is there anyway you can output it as a JPEG for each page and form the PDF from a number of separate images?

Matt Breckon
It's a family tree that I'm gonna send to a plotter.. so.. it's really wide and just a little tall.. There's no real "page" to output..
Rob
+1  A: 

Consider whether a bitmap is the correct way to render this information.

Most documents of this size would be stored as a series of lines (vector graphics) in order to reduce memory use and the size problems you have come across. This also allows it to be scaled more accurately to different print sizes. The "rendering" of this then becomes the problem of the plotter or print driver.

This is the way that PDFs work in general - although obviously it is possible to store a bitmap in it.

Matt Breckon
okay... I'd actually prefer that, is there a decent API for creating a vector based pdf?
Rob
iTextSharp (http://itextsharp.sourceforge.net/) is going to do exactly what i need.. thanks for the help.
Rob