• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking whether a file is a genuine PDF file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking whether a file is a genuine PDF file


  • Subject: Re: Checking whether a file is a genuine PDF file
  • From: Paul M <email@hidden>
  • Date: Mon, 5 Oct 2009 10:38:53 +1300


On 5/10/2009, at 4:12 AM, Sherm Pendley wrote:

On Sun, Oct 4, 2009 at 8:07 AM, Squ Aire <email@hidden> wrote:

How can I check whether a file is indeed a true PDF file (that can be, for example, opened in Preview)? Would I be able to filter true PDFs file in an open dialog, or would I just have to stick to filtering with only the pdf extension in open dialogs, and later ignore the non-valid PDF files?

I would take the second approach. First, it's going to perform better; to filter the list in an open dialog, you'd have to open and verify every .pdf file in the directory being shown. You'd also need to inform the user somehow why some supposedly-pdf files are not selectable. Also, note that Preview's open dialog will allow you to select any file with a .pdf extension, then alerts the user if the file's contents aren't actually PDF data.


You might also want to concider the oposite case - where a valid pdf does not
have a valid extension.



paulm

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Checking whether a file is a genuine PDF file (From: Squ Aire <email@hidden>)
 >Re: Checking whether a file is a genuine PDF file (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: rangeOfString & UTF8
  • Next by Date: Re: rangeOfString & UTF8 - SOLVED
  • Previous by thread: Re: Checking whether a file is a genuine PDF file
  • Next by thread: RE: Checking whether a file is a genuine PDF file
  • Index(es):
    • Date
    • Thread