public class

URLDownloadSource

extends Object
implements DownloadSource
java.lang.Object
   ↳ com.pspdfkit.document.download.source.URLDownloadSource

Class Overview

Download using a URL (usually from the web). This source uses openConnection() to access the PDF resource.

Summary

[Expand]
Inherited Constants
From interface com.pspdfkit.document.download.source.DownloadSource
Public Constructors
URLDownloadSource(URL documentURL)
Constructs the download source based on a URL.
Public Methods
long getLength()
Returns the total length of the download.
InputStream open()
Opens an InputStream for downloading the document.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pspdfkit.document.download.source.DownloadSource

Public Constructors

public URLDownloadSource (URL documentURL)

Constructs the download source based on a URL.

Parameters
documentURL The URL pointing to the PDF document.

Public Methods

public long getLength ()

Returns the total length of the download. This is optional and only used for calculating the Progress during download.

Returns

public InputStream open ()

Opens an InputStream for downloading the document.

Returns
  • A fresh input stream for downloading the PDF document.
Throws
IOException

public String toString ()