Re: Checking whether a file is a genuine PDF file
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