• 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
Converting RTFD to Word with embedded images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Converting RTFD to Word with embedded images
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Advanced Techniques
  • Next by Date: Re: seamlessly saving to a different file
  • Previous by thread: Re: seamlessly saving to a different file
  • Next by thread: Re: Converting RTFD to Word with embedded images
  • Index(es):
    • Date
    • Thread