Converting RTFD to Word with embedded images
Converting RTFD to Word with embedded images
- Subject: Converting RTFD to Word with embedded images
- From: Buddy Kurz <email@hidden>
- Date: Mon, 15 Jul 2013 08:59:19 -0700
I am trying to find the magic incantation to take an .RTFD document with a jpg attachment and convert it to a .DOC document. (in code)
My first lazy thought was to use textutil -convert doc mydocument.rtfd
This does not work. (10.7.5)
It creates a perfect good Word document without the image.
Then I tried creating an instance of NSAttributedString using initWith RTFDFileWrapper.
The resulting string contains an NSFileAttachment for my jpg image as I would expect.
The next step is to save the NSAttributed string, with attachment, as a .doc document.
using -docFormatFromRange:documentAttributes: and saving the resulting NSData object created a perfectly good Word document without the attachment.
using -fileWrapperFromRange:documentAttributes:error and saving the result also creates a perfectly good Word document, again without the attachment.
BOOL written = [destWrapper writeToURL:destURL options:NSFileWrapperWritingWithNameUpdating originalContentsURL:sourceURL error:&writeError];
Am I missing something?
Pages can export to Word with the attachment. Why can't I?
_______________________________________________
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