# How can I detect a PDF file with PDF 1.5 cross reference stream?

Q: My application needs to be able to detect if a file contains PDF
1.5 cross reference stream. Is there a possibility for us to detect
with the current pdfnet sdk (4.8 or 5.0) if the document is using
''pure' compressed xref streams?
----------------
A: You can use the following snippet to detect if a PDF document is
based on PDF 1.5 cross reference streams.

Obj xref = pdfdoc.GetSDFDoc().GetTrailer().FindObj("Type");
if (xref.GetName() == "XRef") {
... this document has a compressed stream
}