Fill page with Image

Fill page with Image

Forum member · Mar 14, 2007
Our current application converts jpg, bmp, gif etc... files into tiffs using the JAI libraries, then uses the cete tiffFile.getDocument() and creates a multipage PDF from multiple files that a client uploads. The problem is that when the jpg (and others) is converted into tiff by JAI, it gets really big (132K will turn into 1021K). The following code produces a small image on a page, I wish there was a jpeg.getDocument(): Document document = new Document(); Page page = new Page(); document.getPages().add(page); Image testImage = new Image ("d:/temp/TestGIF.gif", 0, 0); page.getElements().add(testImage); document.draw("d:/temp/DEBUG3A.pdf"); How can I get images types other than TIF (they are all basically scanned pages 8x11 or 11x14 in size) into what looks like a full page image? One image per page. One thing I don't have control over is what format they will save into, as the company accepts jpg, gif, tif, bmp, pdf etc... And I can't changed that policy. Thanks in advance.

Re: Fill page with Image

Support · Mar 15, 2007
Hello, We do have support for adding Gif, Tif, PNG, Jpeg etc image formats to add to a PDF document. You can refer to the Supported Image Formates topic on help documentation to see the supported image formats. You can convert the Tif images into PDF document directly but it is not possible to convert the Jpeg images into PDF document. However you can add these images to the PDF using the Image page element. Our product will not resample or change the pixels of an image when adding to a PDF. If an image is 300 pixels wide and 300 pixels tall, it will be the same when it is output to the PDF. The size of the image in points, inches or centimeters will depend on its scale. If the scale is set to 1, it will have 1 pixel per point and output at 72 pixels per inch (also known as dots per inch or dpi). If the scale is set to 0.24, then the image will have 1 pixel for every 0.24 points and output at 300 dpi. Many image formats contain a target resolution within the file. If this information is present it is read from the file and used as the default resolution when a scale is not specified. If this information is not present, the default scale is 0.24 or 300 dpi. You will have to set this scale inorder to change the size of the image. You can use setDpi method to change the Dpi. You can refer to the Image Resolution topic on our help documentaion. Thanks, ceTe Software Support Team.