Re: Problem with NSData to NSString to NSData

2008-10-31 Thread Joel Norvell
Dear Cocoa-dev People, I wanted to thank everyone for their helpful replies to my question: How to save metadata for a PDF file? Graham, thank you for confirming and clarifying "the Cocoa way." Your caveat (problem with other pdf readers) was also well taken! Ricky, thank you for your trencha

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Jeff Dutky
On Wed, Oct 29, 2008 at 4:46 PM, Joel Norvell <[EMAIL PROTECTED]> wrote: > Dear Cocoa-dev People, > > First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the > problem with my NSData->NSString->NSData approach. > > As an alternative, would it be fruitful to use a Directory Wrapper

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Dave Geering
> From your original implementation of putting the metadata directly into the > PDF file, you'll now end up with obviously a proprietary file. i.e. No > application that works with PDF will be able to work with that file. That is not at all true. You can embed the data into a PDF stream but nev

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Marcel Weiher
On Oct 29, 2008, at 1:46 PM, Joel Norvell wrote: First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the problem with my NSData->NSString->NSData approach. As an alternative, would it be fruitful to use a Directory Wrapper to represent the data as two files; one the metada

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Michael Ash
On Wed, Oct 29, 2008 at 4:46 PM, Joel Norvell <[EMAIL PROTECTED]> wrote: > Dear Cocoa-dev People, > > First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the > problem with my NSData->NSString->NSData approach. > > As an alternative, would it be fruitful to use a Directory Wrapper

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Ricky Sharp
On Oct 29, 2008, at 3:46 PM, Joel Norvell wrote: Dear Cocoa-dev People, First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the problem with my NSData->NSString->NSData approach. As an alternative, would it be fruitful to use a Directory Wrapper to represent the data as t

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Graham Cox
On 30 Oct 2008, at 7:46 am, Joel Norvell wrote: As an alternative, would it be fruitful to use a Directory Wrapper to represent the data as two files; one the metadata and the other the pdf? Then I could work with the metadata file, but just display the pdf file. In the "What could go w

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Joel Norvell
Dear Cocoa-dev People, First, I wanted to thank Aki Inoue and Rob Keniger for pointing out the problem with my NSData->NSString->NSData approach. As an alternative, would it be fruitful to use a Directory Wrapper to represent the data as two files; one the metadata and the other the pdf? Then

Re: Problem with NSData to NSString to NSData

2008-10-28 Thread Rob Keniger
On 29/10/2008, at 2:43 PM, Joel Norvell wrote: I have a file with some metadata prepended to a pdf. I want to strip the metadata off and display the pdf. I was trying to do this: - (void) loadFromPath: (NSString *) path { NSData *myData = [NSData dataWithContentsOfFile:path]; NSString *myS

Re: Problem with NSData to NSString to NSData

2008-10-28 Thread Aki Inoue
Joel, The PDF is a binary data format. So, trying to decode with an ASCII encoding vonverter would result in data loss. I recommend processing it as mere bytes without mapping to a string. Aki from iPhone On 2008/10/28, at 21:43, Joel Norvell <[EMAIL PROTECTED]> wrote: Dear Cocoa-dev Peop

Problem with NSData to NSString to NSData

2008-10-28 Thread Joel Norvell
Dear Cocoa-dev People, I have a file with some metadata prepended to a pdf. I want to strip the metadata off and display the pdf. I was trying to do this: - (void) loadFromPath: (NSString *) path { NSData *myData = [NSData dataWithContentsOfFile:path]; NSString *myStr = [[NSString alloc] i