# createPdf static method

1. @Deprecated('Use ScanbotDocument.createPDFForDocument instead.')

Future<Uri> createPdf(

1. List<Page> pages,
2. PdfConfiguration pdfConfiguration, [
3. OcrOptions? ocrConfiguration = null

])

Creates a multi-page PDF document from the given `pages` and stores it as a file.

All pages must contain DOCUMENT images. Returns the file Uri of the created PDF.

Deprecated: Use ScanbotDocument.createPDFForDocument instead.

## Implementation

    @Deprecated('Use ScanbotDocument.createPDFForDocument instead.')
    static Future<Uri> createPdf(
        List<Page> pages, PdfConfiguration pdfConfiguration,
        [OcrOptions? ocrConfiguration = null]) async {
      try {
        var pagesList = pages.map((page) => page.toJson()).toList();
        var arguments = {
          'pages': pagesList,
          'pdfConfiguration': pdfConfiguration.toJson()
        };

        if (ocrConfiguration != null) {
          arguments['ocrConfiguration'] = ocrConfiguration.toJson();
        }

        final uri = await channel.invokeMethod('createPdf', arguments);
        return Uri.parse(uri);
      } catch (e) {
        Logger.root.severe(e);
        rethrow;
      }
    }