Class SessionPdfFileSaver

Object
org.mozilla.geckoview.SessionPdfFileSaver

@AnyThread public final class SessionPdfFileSaver extends Object
PdfFileSaver instances returned by GeckoSession.getPdfFileSaver() performs save operation.
  • Method Details

    • save

      @NonNull public GeckoResult<WebResponse> save()
      Save the current PDF.
      Returns:
      Result of the save operation as a GeckoResult object.
    • createResponse

      @Nullable public static GeckoResult<WebResponse> createResponse(@NonNull GeckoSession session, @NonNull String url, @NonNull String filename, @NonNull String originalUrl, boolean skipConfirmation, boolean requestExternalApp)
      Create a WebResponse from some binary data in order to use it to download a PDF file.
      Parameters:
      session - The session.
      url - The url for fetching the data.
      filename - The file name.
      originalUrl - The original url for the file.
      skipConfirmation - Whether to skip the confirmation dialog.
      requestExternalApp - Whether to request an external app to open the file.
      Returns:
      a response used to "download" the pdf.