createPdf method
- @SupportedPlatforms.new(platforms: [IOSPlatform(apiName: 'WKWebView.createPdf', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf', available: '14.0'), MacOSPlatform(apiName: 'WKWebView.createPdf', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf', available: '11.0'), WindowsPlatform(apiName: 'ICoreWebView2_16.PrintToPdfStream', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_16#printtopdfstream')])
- @Deprecated("Use pdfConfiguration instead") IOSWKPDFConfiguration? iosWKPdfConfiguration,
- PDFConfiguration? pdfConfiguration,
Generates PDF data from the web view’s contents asynchronously.
Returns null if a problem occurred.
pdfConfiguration represents the object that specifies the portion of the web view to capture as PDF data.
Officially Supported Platforms/Implementations:
- iOS WKWebView 14.0+ (Official API - WKWebView.createPdf)
- macOS WKWebView 11.0+ (Official API - WKWebView.createPdf)
- Windows WebView2 (Official API - ICoreWebView2_16.PrintToPdfStream)
Parameters - Officially Supported Platforms/Implementations:
pdfConfiguration: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
IOSPlatform(
apiName: 'WKWebView.createPdf',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf',
available: '14.0',
),
MacOSPlatform(
apiName: 'WKWebView.createPdf',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf',
available: '11.0',
),
WindowsPlatform(
apiName: 'ICoreWebView2_16.PrintToPdfStream',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_16#printtopdfstream',
),
],
)
Future<Uint8List?> createPdf({
@Deprecated("Use pdfConfiguration instead")
// ignore: deprecated_member_use_from_same_package
IOSWKPDFConfiguration? iosWKPdfConfiguration,
PDFConfiguration? pdfConfiguration,
}) {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.createPdf.name} is not implemented on the current platform',
);
}