pspdfkit自定义保存iOS
我现在正在使用用于ios的pspdfkit,我现在可以从本地目录为pdf添加注释。问题是注释是自动保存的。我已经像这样打开了pdf。如何仅在按下“保存”按钮时保存pdf?我可以做自定义保存按钮,如以下代码pspdfkit自定义保存iOS,ios,pdf,annotations,pspdfkit,Ios,Pdf,Annotations,Pspdfkit,我现在正在使用用于ios的pspdfkit,我现在可以从本地目录为pdf添加注释。问题是注释是自动保存的。我已经像这样打开了pdf。如何仅在按下“保存”按钮时保存pdf?我可以做自定义保存按钮,如以下代码 PSPDFDocument *document = [PSPDFDocument documentWithURL:documentURL]; PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDo
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];
要禁用自动保存功能,请对PSPDF文档调用
document.annotationSaveMode=PSPDFAnnotationSaveModeDisabled
要通过单击特定按钮保存批注,可以在PSPDAnnotationParser中调用saveAnnotationsWithError