473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I retrieve and save a .PDF from a website?

Hello All,

Its a bit more complicated than the subject line implies.

A website that I use for information allows me to click on a link and their .PDF displays in IE's browser window.. Since this data has a life-span
of about a week (replaced by a newer updated one on a daily basis) and if I happen to miss a day viewing and recording the info I want, its gone
forever.

To solve this problem, I wrote a small app to retrieve their index page of the info into a vb.net webbrowser control. This works fine for viewing,
but now I want to save the retrieved file as a .PDF on my local system. (It does bring up the Adobe toolbars and commands in the browser window and I
can save from there.) I want this to be "automatic" so I can set my app to run through the task scheduler and I won't have to be present to download.

The .PDF files are not accessible directly from a directory. Each of the links from the index page is directed to a Javascript (I believe) routine
with some parameters. And apparently from that script, the proper location of the file is determined and subsequently returned to my browser control
as a PDF file.

A sample of my code is below. (After the Navigate command, how do I save the contents of wbPage as a PDF?) Can I essentially do a Navigate directly
onto a local drive?

Thanks,

Hexman
-------------------Code Sample---------------------------
wbPage - System.Windows.Forms.WebBrowser

wbPage.Navigate("http: //www.somewebsite.com/locatePDF.do?filename=ENV060708.pdf")

'File.WriteAllBytes("c:\SavedPDF.pdf", wbPage.DocumentStream) <--- doesn't work
Jul 8 '06 #1
0 1454

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Didier FRAISSE | last post by:
i need to retrieve every day an email and to save his attachments for later processing. i found some piece of code in the documentation like import poplib pop = poplib.POP3(Host)...
0
by: nyousfi | last post by:
Hi everyone, I hope you can help! I have the following query accesing an SQL Server 2000 Box SELECT website.websiteID, website.description, website.URL, website.DepartmentID
2
by: PDXWilliam | last post by:
Hello, I'd really appreciate help on this. I'm programmatically retrieving data from a website and on one particular page, I'm figure out what I should be sending to grab this data. Please...
3
by: Mal Reeve | last post by:
Hello, I am looking for an easy way to retrieve a file from a given website.. I am building an app that will retrieve a .csv file then TRANSFER text it into a table for further processing.. ...
2
by: will | last post by:
hi, my ISP doesn't have webmail service, so i use TcpClient & Friends to issue POP3 commands to retrieve emails, store data on a website, and use that website to view emails. it all works...
1
by: Brian Henry | last post by:
Here is a simple problem, havent worked much with HTTP streams so haven't done this yet... I want to access a picture located at http://www.somesite.com/images/imagename.jpg then save it to a local...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file and have the hyperlinks work when I bring the file back up. If the web page has a hyperlink like the following <a href="OurWeb/News/abcFile.htm">, after...
1
by: deepaks85 | last post by:
Dear Sir, Is there any way to Get / Retrieve data from any website? I want the contents from a website into my website so that the contents can automatically update if the contents get changed...
1
by: ASPLearner | last post by:
Hi, I am trying to retrieve contect from other website and save it to database. Anyone can help? For Example: I want my script go to a webpage and retrieve someone's first name, last name &...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.