Is there a way to export (say, from an NSAttributedString representation) directly to an iWork Pages format?

StackOverflow https://stackoverflow.com/questions/9457630

  •  13-11-2019
  •  | 
  •  

Pregunta

Looking at https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/Reference/Reference.html, there are quite a few document formats that AppKit makes it easy to export to, including even MS Word. It seems strange that Apple wouldn't also provide easy export functionality like this for their own word processing software.

Am I missing something in the documentation? Or should this be done using some other set of tools? I know I could export to pretty much any of those other formats and Pages would import it, but it would be nice to export directly to that format.

Alternatively, if there's a specification out there that would help in developing an export method like the ones above, that would also be useful.

Or should I be looking into AppleScript hooks to do this sort of thing?

¿Fue útil?

Solución

No, you are not missing anything. There is no API to programmatically create Pages files and no public spec for the format. Unless there is specific reason you need Pages files, your best bet is to create RTF files. You can write code to create formatted RTF files, and Pages will open them and you'll see the correct formatting.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top