Use this field in your CAML query: File_x0020_Type. Compare it to pdf as a fixed value. For folders you can try ContentTypeId eq 0x0120.
It should look something like this (don't quote me because I haven't tested this):
<Where> <Or> <Eq> <FieldRef Name="File_x0020_Type" /> <ValueType="Text">pdf</ValueType> </Eq> <Eq> <FieldRef Name="ContentTypeId" /> <ValueType="Text">0x0120</ValueType> </Eq> </Or> </Where>
I recommend downloading a program like SPCamlQueryHelper to work with this stuff, as it's pretty strict about the syntax.