[
https://issues.apache.org/jira/browse/TIKA-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13581331#comment-13581331
]
Marco Quaranta commented on TIKA-1085:
--------------------------------------
Hello Nick, looking inside these files I discovered that are generated with
Crystal Report (It should be .NET-Microsoft stuff), bytes preceeding %PDF have
no meaning about me. I have tested them with evince, everything ok. Googling
around (https://www.google.com/#q=pdf+header+1024+bytes) it seems that this
issue is already been reported in different projects
(http://bugs.ghostscript.com/show_bug.cgi?id=687125,
http://sourceforge.net/projects/jhove/files/jhove/JHOVE%201.6/). Asap I will
give you an example. Thank you (and sorry for my bad english)..
> PDF header and mime detection
> -----------------------------
>
> Key: TIKA-1085
> URL: https://issues.apache.org/jira/browse/TIKA-1085
> Project: Tika
> Issue Type: Improvement
> Components: mime
> Affects Versions: 1.3
> Reporter: Marco Quaranta
> Priority: Minor
> Labels: detection, header, mime, pdf
>
> I've found some PDF files Tika recognizes as application/octet-stream.
> These files differs from regularly identified PDF having a different header:
> the %PDF-N.n string isn't at the beginning (zero offset) of the file but in
> the first 1024 bytes.
> PDF reference states that "The first line of a PDF file shall be a header
> consisting of the 5 characters %PDF– followed by a version
> number of the form 1.N, where N is a digit between 0 and 7"
> (http://tinyurl.com/8vnzm3c "p. 7.5.2 File Header").
> Looking further at implementation notes by Adobe (http://tinyurl.com/cbqpb24
> p. 3.4.1 File Header) I've discover that: "Acrobat viewers require only that
> the header appear somewhere within the first 1024 bytes of the file"
> What do you think about a PDF magic match with an offset 0:1024?
> <match value="%PDF-" type="string" offset="0:1024"/>
> Thank you,
> Marco
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira