Is there a way to export (say from an NSAttributedString view) directly to iWork page format?

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 exporting easy, including even MS Word. It seems strange that Apple will also not provide such convenient export functions as this for its own word processing software.

Am I missing something in the documentation? Or should it be done using a different set of tools? I know that I can export almost any of these other formats, and the pages will import it, but it would be nice to export directly to this format.

Alternatively, if there is a specification there that will help in developing an export method like the one above, it will also be useful.

Or should I look at AppleScript hooks to do such things?

+4
source share
1 answer

No, you did not miss anything. The API does not have software for creating Pages files and does not have public specifications for the format. If there is no specific reason, you need Pages files, it is best to create RTF files. You can write code to create formatted RTF files, and the pages will open them and you will see the correct formatting.

0
source

Source: https://habr.com/ru/post/1398503/


All Articles