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

Andreas Lehmkühler resolved PDFBOX-914.
---------------------------------------

    Resolution: Fixed
      Assignee: Andreas Lehmkühler

I added the improvement in 1044686 as proposed by Neil McErlean.

Thanks for the contribution

> Using TextToPDF to create a PDF from the empty string produces unreadble PDF 
> file (patch included)
> --------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-914
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-914
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 1.3.1
>         Environment: All
>            Reporter: Neil McErlean
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.4.0
>
>         Attachments: PDFBOX-914.patch
>
>
> If you create a PDF document from org.apache.pdfbox.TextToPDF like so:
>       TextToPDF pdfCreator = new TextToPDF();
>       PDDocument pdfDoc = pdfCreator.createPDFFromText(new StringReader("")); 
> // Note the empty String
> then it does produce a PDF file. But the file cannot be opened as it contains 
> no pages.
> Adobe Reader (I have 9.4.1), and Mac OSX's Preview/Quicklook cannot open the 
> document.
> I have attached (or will do in a minute) a patch that includes a test case 
> that reproduces the problem (no PDPages in a PDF with no text).
> And I've patched TextToPDF so that it inserts a single empty page for an 
> empty string input.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to