You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Oleksandr Dronyk (JIRA)" <ji...@apache.org> on 2014/09/18 16:56:33 UTC

[jira] [Updated] (PDFBOX-2361) Blank pages after conversion images to pdf

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

Oleksandr Dronyk updated PDFBOX-2361:
-------------------------------------
    Description: 
I am trying to convert images (png, jpg) to pdf and the issue is that after conversion document pages are blank.
Used code:
{code:title=Bar.java|borderStyle=solid}
        PDDocument doc = new PDDocument();
        for (BufferedImage buff : list) {
            PDPage page = new PDPage(new PDRectangle(buff.getWidth(), buff.getHeight()));
            doc.addPage(page);
            PDXObjectImage ximage = new PDJpeg(doc, buff);
            PDPageContentStream content = new PDPageContentStream(doc, page);
            content.drawImage(ximage, 0, 0);
            content.close();
        }
        doc.save(outStream);
        doc.close();
{code}

  was:
I am trying to convert images (png, jpg) to pdf and the issue is that after conversion document pages are blank.
Used code:
        PDDocument doc = new PDDocument();
        for (BufferedImage buff : list) {
            PDPage page = new PDPage(new PDRectangle(buff.getWidth(), buff.getHeight()));
            doc.addPage(page);
            PDXObjectImage ximage = new PDJpeg(doc, buff);
            PDPageContentStream content = new PDPageContentStream(doc, page);
            content.drawImage(ximage, 0, 0);
            content.close();
        }
        doc.save(outStream);
        doc.close();


> Blank pages after conversion images to pdf
> ------------------------------------------
>
>                 Key: PDFBOX-2361
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2361
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.4
>            Reporter: Oleksandr Dronyk
>
> I am trying to convert images (png, jpg) to pdf and the issue is that after conversion document pages are blank.
> Used code:
> {code:title=Bar.java|borderStyle=solid}
>         PDDocument doc = new PDDocument();
>         for (BufferedImage buff : list) {
>             PDPage page = new PDPage(new PDRectangle(buff.getWidth(), buff.getHeight()));
>             doc.addPage(page);
>             PDXObjectImage ximage = new PDJpeg(doc, buff);
>             PDPageContentStream content = new PDPageContentStream(doc, page);
>             content.drawImage(ximage, 0, 0);
>             content.close();
>         }
>         doc.save(outStream);
>         doc.close();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)