I don't know how "valid" you want the file to be when you say "is actually 
PDF".  But AFAIK, you can just check the first few bytes of the content for the 
PDF- (version) header, if you're just trying to differentiate the content from 
other formats or something.

  ----- Original Message ----- 
  From: Subhrajyoti Moitra 
  To: Post all your questions about iText here 
  Sent: Monday, February 09, 2009 12:24 PM
  Subject: [iText-questions] Quickest/Fastest way to tell if contents are PDFor 
not.


  Hi,

  What is the quickest/fastest way to test whether a particular contents sent 
by some "user" is actually PDF or not?
  I now do 

  PdfReader=new PdfReader(new FileInputStream("c:\\temp\\somecontent.tmp"));

  Is there any other quick way to do this?

  Thanks a lot in advance.

  Subhro.



------------------------------------------------------------------------------


  ------------------------------------------------------------------------------
  Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
  software. With Adobe AIR, Ajax developers can use existing skills and code to
  build responsive, highly engaging applications that combine the power of local
  resources and data with the reach of the web. Download the Adobe AIR SDK and
  Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com


------------------------------------------------------------------------------


  _______________________________________________
  iText-questions mailing list
  [email protected]
  https://lists.sourceforge.net/lists/listinfo/itext-questions

  Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to