AlivePDF icon indicating copy to clipboard operation
AlivePDF copied to clipboard

RESIZE.FIT_TO_PAGE for bigger images

Open GoogleCodeExporter opened this issue 10 years ago • 0 comments

What steps will reproduce the problem?
1. create an image bigger than the page size and transform it to b:ByteArray
2. use pdf.addImageStream(b, ColorSpace.DEVICE_RGB, new 
Resize(Mode.FIT_TO_PAGE, Position.LEFT))
3. save file fileStream.writeBytes(this.pdf.save(Method.LOCAL));

What is the expected output? What do you see instead?
image to be downsized to fit to page

What version of the product are you using? On what operating system?
rc 0.1.5

Please provide any additional information below.

case ratio > 1 should be handled in the following snippet, in the placeImage 
function:

 if ( resizeMode.mode == Mode.FIT_TO_PAGE )
            {           
                var ratio:Number = Math.min ( realWidth/image.width, realHeight/image.height );

                if ( ratio < 1 )
                {
                    width *= ratio;
                    height *= ratio;
                }
            }

Original issue reported on code.google.com by [email protected] on 4 Feb 2011 at 1:08

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter