Open from URL? #370
-
I am trying to use PdfPig in an NUnit project with Selenium to verify the existence of content in the PDF. Is there a way to open/load the PDF from the URL that the webdriver currently has? Still looking around for examples but everything references local files. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You'd want to download the file before passing to the library, you can do this using
I haven't checked this in the IDE so some of the methods may be named differently. |
Beta Was this translation helpful? Give feedback.
You'd want to download the file before passing to the library, you can do this using
HttpClient
on NET 4.5+ orWebClient
for earlier versions. You might be able to pass the content stream directly to PdfPig but I don't believe the stream supports seeking so you should download the bytes first, e.g. https://stackoverflow.com/a/54475013I haven't checked this in the IDE so some of the methods may be named differently.