You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/06/09 00:01:04 UTC

[jira] [Closed] (PDFBOX-1291) Adding OutputStream functionality to PDFImageWriter

     [ https://issues.apache.org/jira/browse/PDFBOX-1291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-1291.
-----------------------------------

    Resolution: Implemented

PDFImageWriter is a bit of a dead end that will be removed in 2.0. The best is to use ImageIOUtil.writeImage() and it has what you need. To get the BufferedImage first, use ximage.getRGBImage().

> Adding OutputStream functionality to PDFImageWriter
> ---------------------------------------------------
>
>                 Key: PDFBOX-1291
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1291
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 1.6.0
>            Reporter: Patrick Lehmann
>            Priority: Minor
>              Labels: features
>
> I've got the problem that i don't want to write the created image data to a file because I use it for server side converstion of a pdf. 
> It would be convenient to have an overloaded version of writeImage. Instead of the outputPrefix parameter you could use an OutputStream as parameter. ImageIO can handle this correctly so i suggest to do something like the following:
> public boolean writeImage(PDDocument document, String imageFormat, String password,
>             int startPage, int endPage, OutputStream outStream, int imageType, int resolution)
> {
>      // stays the same
>      output = ImageIO.createImageOutputStream( outStream );
>      // stays the same
> }
> Without this change it is imposible to get the created image into RAM without reading it from the file again which is not the very best way to do so.
> It would be great if there is a way to extend this feature.



--
This message was sent by Atlassian JIRA
(v6.2#6252)