title: CoreGraphics PDF has logged an error. Set environment variabe "CG_PDF_VERBOSE" to learn more
body: <p>I am trying to embed iOS PDFKit in my Flutter App.
  Following is my code</p>
  
  <pre><code>public class PDFCustomView: NSObject, FlutterPlatformView {
  
      let frame: CGRect
      let viewId: Int64
  
      init(_ frame: CGRect,viewId: Int64, args: Any?){
          self.frame = frame
          self.viewId = viewId
      }
  
      public func view() -&gt; UIView {
          let pdfView = PDFView(frame: frame)
          if let path = Bundle.main.path(forResource: "studenthandbook2018", ofType: "pdf") {
              let url = URL(fileURLWithPath: path)
              if let pdfDocument = PDFDocument(url: url) {
                  pdfView.displayMode = .singlePageContinuous
                  pdfView.autoScales = true
                  pdfView.document = pdfDocument
              }
          }
          return PDFView()
      }
  
  }
  
  public class PdfViewFactory: NSObject, FlutterPlatformViewFactory {
      public func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?)
          -&gt; FlutterPlatformView {
          return PDFCustomView(frame,viewId: viewId,args: args)
      }
  }
  
  @UIApplicationMain
  @objc class AppDelegate: FlutterAppDelegate {
    override func application(
      _ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
    ) -&gt; Bool {
      GeneratedPluginRegistrant.register(with: self)
  
      let viewFactory = PdfViewFactory()
      registrar(forPlugin: "iospdf").register(viewFactory, withId: "PDFIOSView")
  
      return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
  }
  </code></pre>
  
  <p>I also included </p>
  
  <pre><code>&lt;key&gt;io.flutter.embedded_views_preview&lt;/key&gt;
      &lt;true/&gt;
  </code></pre>
  
  <p>in <code>info.plist</code></p>
  
  <p>Instead of returning <code>PDFView</code>, I tried returning <code>UISLider</code> and it works properly in my app but PDFkit gives error saying <code>CoreGraphics PDF has logged an error. Set environment variabe "CG_PDF_VERBOSE" to learn more.</code></p>
  
  <p>Is this a Flutter bug or am I doing something wrong on my part?</p>