Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

C# code to 'Save As' an HTMl page containing PDF file

Hi,

I was looking for the code in C# where I am working on the automation of an application. My question is that, while the application is running it opens up a new 'Internet Explorer' window inside which it opens a PDF file.

Now I want to perform following things in this page using C# code:
1. 'Save As' the PDF file to any location.
2. Click on the different buttons available in this page like 'Print', 'send email', save.

Please if someone can provide the solution ASAP, it would be very helpful.

- Dev
0
dev_qasource
Asked:
dev_qasource
  • 2
  • 2
1 Solution
 
DeathraceCommented:
How you're converting into PDF , are you using Adobe ActiveX Dll for this or any thirdparty .dll files.
0
 
dev_qasourceAuthor Commented:
We are not converting this into PDF, its actually the web application itself which opens a new pdf file in the new 'internet explorer' window.
0
 
jmelettCommented:
If you're trying to automate tasks, try a scripting language like http://www.autoitscript.com/autoit3/index.shtml. There is also a DLL/COM Control which you can add to your C# Applications.

(I've used AutoIt a few times to automate tasks for large financial companies).

Let me know if you need any further info.

Cheers
0
 
dev_qasourceAuthor Commented:
I have a question here, since I am using Visual Studio Team system 2008 team system integrated with WebAii design canvas tool (v1.1).

The Application I am automating is fills a form and then clicking on a button generates a PDF file in the internet explorer itself. Now how would i generate the code using this tool?

I am not able to get what this tool will do for me and how?


0
 
jmelettCommented:
AutoIT allows you to access GUI components (e.g. a TextField) or HTML fields and manipulate them.

So, assuming that you enter a value into a TextField of a specific application (called "theSpecificApp"), an example code could look like this

WinActivate("theSpecificApp")
Send("{TAB}{TAB}{ENTER}") ;Use Tab/Right/Left Combinations to hit the button.. ooor
;MouseClick("left", 100, 200) ; Click with the left mouse on monitor position X Y (100 200)
WinWaitActive("Internet Explorer with pdf") ; Wait until the IE Window pops up

etc...

With AutoIt you can control Windows Form Elements, IE Objects and lots more. Check out the help file and you'll find everything needed.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now