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

Tilman Hausherr commented on PDFBOX-5265:
-----------------------------------------

{{PDDocument.setVersion()}} updates the document catalog, but 
{{COSWriter.doWriteHeader()}} doesn't :-(

Maybe add this below {{doc.setVersion in {{doWriteHeader}}
{code}
pdDocument.setVersion(Math.max(pdDocument.getVersion(), 
COSWriterCompressionPool.MINIMUM_SUPPORTED_VERSION));
{code}


> /Version /1.4 in newly generated PDFBox PDF
> -------------------------------------------
>
>                 Key: PDFBOX-5265
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5265
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Michael Klink
>            Priority: Trivial
>         Attachments: HelloWorld.pdf
>
>
> Strictly speaking not even a bug, merely a nuisance, but it might indicate an 
> underlying issue in version handling.
> When generating a  [^HelloWorld.pdf] as in [this stack overflow 
> question|https://stackoverflow.com/q/68904812/1729265], the resulting PDF 
> starts like this:
> {noformat}
> %PDF-1.6
> %öäüß
> 1 0 obj
> <<
> /Type /Catalog
> /Version /1.4
> /Pages 2 0 R
> >> 
> {noformat}
> This *Version* value *1.4* makes no sense in a freshly created PDF with a 
> {{%PDF-1.6}} header and will be ignored by a standard conform PDF processor.
> So it should not be there to start with.
> Its presence might indicate, though, that internally PDFBox has a 
> non-appropriate idea which PDF version it is wanting to communicate to a 
> processor. If so, that should also be cleared up.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to