[ 
https://issues.apache.org/jira/browse/PDFBOX-5897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896217#comment-17896217
 ] 

Tilman Hausherr commented on PDFBOX-5897:
-----------------------------------------

I'm reluctant because it's something really just for you. Some people might 
misunderstand the new constructor (e.g. because the final PDF might still have 
a higher version). So that's my offer at this time, and I think it isn't 
difficult to work with that one if you put it in the resources of your testing 
tool. I can create files with different version if you want. (What I did was to 
create a 1.4 file and then used NOTEPAD++).
{code}
try (PDDocument doc = new PDDocument())
{
    PDPage page = new PDPage();
    doc.addPage(page);
    doc.save("empty.pdf", CompressParameters.NO_COMPRESSION);
}
{code}


> Can't create an empty PDDocument with specific PDF version
> ----------------------------------------------------------
>
>                 Key: PDFBOX-5897
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5897
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 3.0.3 PDFBox
>            Reporter: Asger Hautop Drewsen
>            Priority: Major
>         Attachments: empty.pdf
>
>
> Currently `new PDDocument()` creates a version 1.4 PDF.
> Changing the version afterwards with `.setVersion(...)` only works if the 
> version is greater than or equal to 1.4.
> It would be nice if there was a constructor for `PDDocument` where you could 
> specify the PDF version especially since you can't downgrade it to a lower 
> version after it has been created.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to