2013-07-11 96 views
1

我現在使用pspdfkit for ios,現在我可以從本地目錄註釋pdf。問題是註釋是自動保存的。我已經打開這樣的pdf。只有當我按下保存按鈕時,我怎樣才能保存pdf?我可以像下面的代碼一樣自定義保存按鈕。pspdfkit自定義保存iOS

PSPDFDocument *document = [PSPDFDocument documentWithURL:documentURL]; 
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document]; 

pdfController.openInButtonItem.openOptions = PSPDFOpenInOptionsOriginal; 
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(backFromDocument)] ; 
pdfController.leftBarButtonItems = @[backButton]; 

pdfController.rightBarButtonItems = @[pdfController.annotationButtonItem, pdfController.searchButtonItem, pdfController.outlineButtonItem, pdfController.viewModeButtonItem]; 

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pdfController]; 
[self presentViewController:navController animated:YES completion:NULL]; 

回答

2

要禁用的PSPDFDocument自動保存功能調用document.annotationSaveMode = PSPDFAnnotationSaveModeDisabled

要通過單擊特定按鈕保存註釋,您可以在PSPDFAnnotationParser中調用saveAnnotationsWithError