From 97adc2e2b818ec5a661546f8f702e4b379972a9b Mon Sep 17 00:00:00 2001 From: PSPDFKit Date: Fri, 18 Nov 2022 16:00:46 +0300 Subject: [PATCH] Release 3.4.1 --- CHANGELOG.md | 8 ++++- README.md | 8 ++--- example/ios/Podfile | 2 +- example/pubspec.yaml | 2 +- ios/Classes/PspdfkitFlutterHelper.m | 2 +- ios/Classes/PspdfkitHtmlPdfConvertor.swift | 39 +++++++++++----------- ios/Classes/PspdfkitPdfGenerator.swift | 3 +- ios/pspdfkit_flutter.podspec | 2 +- pubspec.yaml | 2 +- 9 files changed, 38 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc674f3..011d5525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## Newest Release +### 3.4.1 - 18 Nov 2022 + +- Updates for PSPDFKit 12.0 for iOS. (#37508) +- Fixes missing header file issue. (#37283) + +## Previous Releases + ### 3.4.0 - 26 Oct 2022 - Adds generating PDF from images, templates and HTML. (#36736) @@ -7,7 +14,6 @@ - Updates for PSPDFKit 12.0 for iOS. (#37192) - Fixes keyboard cutting off search results when inline search is disabled. (#35418) - Fixes an issue where the `PspdfkitView` widget is not rendered in Flutter versions 3.3.0 and above on Android. (#37044) -## Previous Releases ### 3.3.0 - 19 Jul 2022 diff --git a/README.md b/README.md index e5191892..d056aeeb 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# PSPDFKit Flutter +# Flutter PDF Library by PSPDFKit ![Flutter Intro](screenshots/flutter-intro.png) -PSPDFKit for Flutter is available at [pub.dev](https://pub.dev/packages/pspdfkit_flutter) and [GitHub](https://github.com/PSPDFKit/pspdfkit-flutter). +PSPDFKit for Flutter is an SDK for viewing, annotating, and editing PDFs. It offers developers the ability to quickly add PDF functionality to any Flutter application. It is available at [pub.dev](https://pub.dev/packages/pspdfkit_flutter) and [GitHub](https://github.com/PSPDFKit/pspdfkit-flutter). If you are new to Flutter, make sure to check our Flutter blog posts: - [How I Got Started With Flutter](https://pspdfkit.com/blog/2018/starting-with-flutter/). -- [Getting Started with PSPDFKit Flutter](https://pspdfkit.com/blog/2019/getting-started-with-pspdfkit-flutter/). +- [Getting Started with Flutter PDF Library by PSPDFKit](https://pspdfkit.com/blog/2019/getting-started-with-pspdfkit-flutter/). - [Opening a PDF in Flutter](https://pspdfkit.com/blog/2019/opening-a-pdf-in-flutter/). - [How to Bridge Native iOS Code to Flutter](https://pspdfkit.com/blog/2021/how-to-bridge-native-ios-code-to-flutter/). - [How to Customize Our Flutter PDF SDK for Android](https://pspdfkit.com/blog/2021/how-to-customize-our-flutter-pdf-sdk/). @@ -275,7 +275,7 @@ Platform specific README exists for [Android](android/) and [iOS](ios/). # Example App -To see PSPDFKit Flutter in action check out our [Flutter example app](example/). +To see PSPDFKit for Flutter in action check out our [Flutter example app](example/). Showing a PDF document inside your Flutter app is as simple as this: diff --git a/example/ios/Podfile b/example/ios/Podfile index 2aadf9d0..4725320a 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -31,7 +31,7 @@ flutter_ios_podfile_setup target "Runner" do flutter_install_all_ios_pods __dir__ - pod "PSPDFKit", "~> 12.0.0" + pod "PSPDFKit", "~> 12.0.1" end post_install do |installer| diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f19c4ae0..74503877 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: pspdfkit_example description: Demonstrates how to use the pspdfkit plugin. -version: 3.4.0 +version: 3.4.1 homepage: https://pspdfkit.com/ environment: sdk: '>=2.12.0 <3.0.0' diff --git a/ios/Classes/PspdfkitFlutterHelper.m b/ios/Classes/PspdfkitFlutterHelper.m index 5a608e6a..a6079f59 100644 --- a/ios/Classes/PspdfkitFlutterHelper.m +++ b/ios/Classes/PspdfkitFlutterHelper.m @@ -107,7 +107,7 @@ + (void)processMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result NSString *outputPath = call.arguments[@"outputFilePath"]; NSArray *> *pages = call.arguments[@"pages"]; NSURL *processedDocumentURL = [PspdfkitFlutterHelper writableFileURLWithPath:outputPath override:YES copyIfNeeded:NO]; - [PspdfkitPdfGenrator generatePdfWithPages:pages outputUrl:processedDocumentURL results:result]; + [PspdfkitPdfGenerator generatePdfWithPages:pages outputUrl:processedDocumentURL results:result]; } else { result(FlutterMethodNotImplemented); } diff --git a/ios/Classes/PspdfkitHtmlPdfConvertor.swift b/ios/Classes/PspdfkitHtmlPdfConvertor.swift index c0d47b1c..39b925f7 100644 --- a/ios/Classes/PspdfkitHtmlPdfConvertor.swift +++ b/ios/Classes/PspdfkitHtmlPdfConvertor.swift @@ -10,9 +10,10 @@ import Foundation import PSPDFKit.PSPDFProcessor +@objc(PspdfkitHtmlPdfConvertor) public class PspdfkitHtmlPdfConvertor: NSObject { - - @objc public static func generateFromHtmlString(html: String, outputFileURL: URL, convertionOptions: Dictionary? , results:@escaping FlutterResult) { + + @objc public static func generateFromHtmlString(html: String, outputFileURL: URL, convertionOptions: Dictionary?, results:@escaping FlutterResult) { var options:[String: Any] = [:] @@ -23,27 +24,27 @@ public class PspdfkitHtmlPdfConvertor: NSObject { if(convertionOptions?["numberOfPages"] != nil){ options[PSPDFProcessorNumberOfPagesKey] = convertionOptions?["numberOfPages"] } - + options = options as [String: Any] - + Processor.generatePDF(fromHTMLString: html,outputFileURL: outputFileURL, options: options) { outputURL, error in - if let outputURL = outputURL { - results(outputURL.relativePath); - } else if let error = error { - results(FlutterError(code: "PspdfkitError", message: error.localizedDescription,details: nil)) - } - } + if let outputURL = outputURL { + results(outputURL.relativePath); + } else if let error = error { + results(FlutterError(code: "PspdfkitError", message: error.localizedDescription,details: nil)) + } + } } - - @objc public static func generateFromHtmlURL(htmlURL: URL, outputFileURL: URL, convertionOptions: Dictionary? , results:@escaping FlutterResult) { - + + @objc public static func generateFromHtmlURL(htmlURL: URL, outputFileURL: URL, convertionOptions: Dictionary?, results:@escaping FlutterResult) { + let options = [PSPDFProcessorNumberOfPagesKey: 1, PSPDFProcessorDocumentTitleKey: "Generated PDF"] as [String: Any] Processor.generatePDF(from:htmlURL,outputFileURL: outputFileURL, options: options) { outputURL, error in - if let outputURL = outputURL { - results(outputURL.relativePath); - } else if let error = error { - results(FlutterError(code: "PspdfkitError", message: error.localizedDescription,details: nil)) - } - } + if let outputURL = outputURL { + results(outputURL.relativePath); + } else if let error = error { + results(FlutterError(code: "PspdfkitError", message: error.localizedDescription,details: nil)) + } + } } } diff --git a/ios/Classes/PspdfkitPdfGenerator.swift b/ios/Classes/PspdfkitPdfGenerator.swift index bf8fd1aa..b8825688 100644 --- a/ios/Classes/PspdfkitPdfGenerator.swift +++ b/ios/Classes/PspdfkitPdfGenerator.swift @@ -10,7 +10,8 @@ import Foundation import PSPDFKit.PSPDFProcessor -public class PspdfkitPdfGenrator: NSObject { +@objc(PspdfkitPdfGenerator) +public class PspdfkitPdfGenerator: NSObject { static let pageAdaptor: PspdfkitPageConvertor = PspdfkitPageConvertor() diff --git a/ios/pspdfkit_flutter.podspec b/ios/pspdfkit_flutter.podspec index 610f19dc..9c2a52bc 100644 --- a/ios/pspdfkit_flutter.podspec +++ b/ios/pspdfkit_flutter.podspec @@ -21,5 +21,5 @@ Pod::Spec.new do |s| s.dependency("PSPDFKit") s.swift_version = "5.0" s.platform = :ios, "14.0" - s.ios.deployment_target = "14.0" + s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "GENERATE_INFOPLIST_FILE" => "YES", "SWIFT_INSTALL_OBJC_HEADER" => "NO" } end diff --git a/pubspec.yaml b/pubspec.yaml index 1b51a93b..372bd578 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pspdfkit_flutter description: A Flutter plugin providing a feature-rich PDF viewing and editing experience to your users with the powerful PSPDFKit PDF SDK. -version: 3.4.0 +version: 3.4.1 homepage: https://pspdfkit.com/ repository: https://github.com/PSPDFKit/pspdfkit-flutter issue_tracker: https://support.pspdfkit.com/hc/en-us/requests/new