Hi. What i am looking for is close to what your assume. I need to be able to fit an image within a particular sized frame where i know how many pixels this frame required in order to be filled out. The problem is that if my images are smaller than required to fit the frame I have do either do the pixelation and create a new image, or i have to set the size. Knowing i do not have enough pixels i wonder what batik does in this respect. Will the image be drawn with less dpi to fit the frame or will it output 300 dpi for the image , thus making the visible image on the paper smaller..
Thanks. On Mon, Sep 15, 2008 at 12:21 PM, <[EMAIL PROTECTED]> wrote: > > Hi Lars, > > "Lars Eirik Rønning" <[EMAIL PROTECTED]> wrote on 09/12/2008 07:45:19 > AM: > > > I need to be able to produce high res images (300dpi) for my pdf. > > This works beautifully when working with large images. > > > > However there is a requirement that all images have to fit a > > particular rectanglular size (i use preserveSetting="xMidYMid > > slice") for this. Basically all images have to fit a frame. > > > > If i add the PDFTranscoderHint Key_resoution(300)) will this try to > > get the best possible image quality or am I suppose to handle this > > my self? > > > KEY_RESOLUTION tells Batik what resolution it should render > elements that it needs to flatten (for example filters). I believe > when you draw an image there are two cases. One is that for at > least JPEG it will embed the JPEG in the PDF document 'as is' (and > provide a scale as needed). The other is that Batik will flatten > the image at 300dpi. > > > The latter would require me to calcuate for each image how > > to find the best quality and set the dpi for each image > > individually.(that means i would have to do the scaling myself.. > > The problem is whenever i have a low res image and need to display > > this in the big rectangle the image will be small if i do this manually. > > So if you have a low res image that is being displayed in a > large rectangle then it will look bad regardless of who scales > the image. > > This paragraph makes me think that what you want is for > Batik to calculate how large the frame should be for an image > based on it's physical image size. This is a pretty simple > calculation: > <width in inches> = <image width pixels>/300; // similar for > height. > > Then you can just set the width/height of the image to that and > Batik will scale appropriately. > > To be honest I'm not sure I really understand what it is you > are looking for. > > > I was hoping i would not have to do a lot of calculation to get the > > best results. > > > > Thanks guys. >
