Can OpenUrlAsync resume download after network disconnection?


It appears that there is no way to resume viewing a PDF if network disconnection, or poor network connectivity, occurs halfway through the download process


When you call openUrlAsync there is an optional parameter to pass in file path location for caching. PDFNet will cache the downloads here.

If you always use the same cache location, then PDFNet will “remember” the last PDF viewed in OpenUrlAsync, and only download what has not already been downloaded.

You could also create a hash from the url, and keep the last n hashes, to keep track of additional files, though there should be a cap so you don’t potentially use all the users space.

The above assumes that the PDF is linearized (fast web view), and the server support byte range headers. If either one of these is not true, then yes the entire file would need to be restarted.

Note that there is a download finished event, which you could then save to a temp location, or even prompt the user if they want to save (or just enable SaveAs button)