Package org.apache.xmlgraphics.image.writer

Examples of org.apache.xmlgraphics.image.writer.ImageWriter.writeImage()


            eventProducer.noImageWriterFound(this, getMimeType());
        }
        if (log.isDebugEnabled()) {
            log.debug("Writing image using " + writer.getClass().getName());
        }
        writer.writeImage(image, os, params);
    }

    /**
     * Returns the OutputStream corresponding to this page
     * @param pageNumber 0-based page number
View Full Code Here


                }
            } finally {
                multiWriter.close();
            }
        } else {
            writer.writeImage((RenderedImage) pageImagesItr.next(), outputStream, writerParams);
            if (pageImagesItr.hasNext()) {
                BitmapRendererEventProducer eventProducer
                    = BitmapRendererEventProducer.Provider.get(
                            getUserAgent().getEventBroadcaster());
                eventProducer.stoppingAfterFirstPageNoFilename(this);
View Full Code Here

            eventProducer.noImageWriterFound(this, getMimeType());
        }
        if (log.isDebugEnabled()) {
            log.debug("Writing image using " + writer.getClass().getName());
        }
        writer.writeImage(image, os, params);
    }

    /**
     * Returns the OutputStream corresponding to this page
     * @param pageNumber 0-based page number
View Full Code Here

        } else {
            RenderedImage renderedImage = null;
            if (pageImagesItr.hasNext()) {
                renderedImage = (RenderedImage) pageImagesItr.next();
            }
            writer.writeImage(renderedImage, outputStream, writerParams);
            if (pageImagesItr.hasNext()) {
                BitmapRendererEventProducer eventProducer
                    = BitmapRendererEventProducer.Provider.get(
                            getUserAgent().getEventBroadcaster());
                eventProducer.stoppingAfterFirstPageNoFilename(this);
View Full Code Here

                float quality, int resolution, OutputStream out) throws IOException {
            ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor("image/jpeg");
            ImageWriterParams params = new ImageWriterParams();
            params.setJPEGQuality(quality, true);
            params.setResolution(resolution);
            writer.writeImage(image, out, params);
        }

    }
}
View Full Code Here

                    throw new IOException("Could not get an ImageWriter to produce "
                            + getMimeType() + ". The most likely explanation for this is a class"
                            + " loading problem.");
                }
                log.debug("Writing image using " + writer.getClass().getName());
                writer.writeImage(image, os, params);
            } finally {
                //Only close self-created OutputStreams
                if (os != firstOutputStream) {
                    IOUtils.closeQuietly(os);
                }
View Full Code Here

                }
            } finally {
                multiWriter.close();
            }
        } else {
            writer.writeImage((RenderedImage) pageImagesItr.next(), outputStream, writerParams);
            if (pageImagesItr.hasNext()) {
                log.error("Image encoder does not support multiple images. Only the first page"
                        + " has been produced.");
            }
        }
View Full Code Here

                }
            } finally {
                multiWriter.close();
            }
        } else {
            writer.writeImage((RenderedImage) pageImagesItr.next(), outputStream, writerParams);
            if (pageImagesItr.hasNext()) {
                log.error("Image encoder does not support multiple images. Only the first page"
                        + " has been produced.");
            }
        }
View Full Code Here

                params.setResolution(Math.round(userAgent.getTargetResolution()));
               
                // Encode PNG image
                ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
                log.debug("Writing image using " + writer.getClass().getName());
                writer.writeImage(image, os, params);
            } finally {
                //Only close self-created OutputStreams
                if (os != firstOutputStream) {
                    IOUtils.closeQuietly(os);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.