I am trying to use the scripting-bridge to tell Safari to save the current page as PDF
In the "Safari.h" header file exists a saving method of SafariItem class:
- (void) saveAs:(NSString *)as in:(NSURL *)in_;
So I used this but it doesn't work:
[safariCurrentTab saveAs:@".PDF" in:filePath];
Later I noticed that saving as PDF is in the print option in Safari.app, so I tried to use this function
- (void) print:(NSURL *)x printDialog:(BOOL)printDialog withProperties:(SafariPrintSettings *)withProperties;
However when I tried to init a SafariPrintSettings object, it caused compile error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SafariPrintSettings", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Seems that the compiler doesn't find that class, but I did include the header file and add the ScriptingBridge framework
Anyone can help?
Thanks in advance.