Jump to content

Print Screen and Save the image file automatically


Ram
 Share

Recommended Posts

Hi,

I am looking for a way to print screen a particular image by giving the size and storing it automatically in the folder. This should be done for multiple pages.

here is the link:

http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0

The above website uses PdfFlip for viewing there pdf's.. So I want to click each page screenshot the image and store it and I want to do the same until the last page of the above link.

Can this be done using autoIT?

Awaiting your response!

Thanks!

Link to comment
Share on other sites

Ram,

This may get you started, although what you seem to be asking for is rife with problems...

#include <ie.au3>
#include <screencapture.au3>
; mpos 1004 - 450 to turn pages
local $url = "[url="http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0"]http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0[/url]"
local $oie = _IECreate($url,0,1,1,1)
$oie.top = 0
$oie.left = 0
$oie.height = 1000
$oie.width = 1200
sleep(5000)
for $i = 0 to 10
winwaitactive("[url=[url="http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0"]http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0[/url]]
mousemove(1004,450)
mouseclick("primary",1004,450)
sleep(5000)
_ScreenCapture_Capture(@MyDocumentsDir & "scrcapture#" & stringformat("%02s",$i) & ".jpg")
next
_iequit($oie)

kylomas

Edit: the code editor inserted shit where it found url's...you may have to straighten these out in your code...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Ram,

This may get you started, although what you seem to be asking for is rife with problems...

#include <ie.au3>
#include <screencapture.au3>
; mpos 1004 - 450 to turn pages
local $url = "[url="http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0"]http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0[/url]"
local $oie = _IECreate($url,0,1,1,1)
$oie.top = 0
$oie.left = 0
$oie.height = 1000
$oie.width = 1200
sleep(5000)
for $i = 0 to 10
winwaitactive("[url=[url="http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0"]http://www.chandamama.com/archive/PdfFlip.php?lang=kannada&yr=1949&mnth=7&adOpt=0[/url]]
mousemove(1004,450)
mouseclick("primary",1004,450)
sleep(5000)
_ScreenCapture_Capture(@MyDocumentsDir & "scrcapture#" & stringformat("%02s",$i) & ".jpg")
next
_iequit($oie)

kylomas

Edit: the code editor inserted shit where it found url's...you may have to straighten these out in your code...

Thanks for the startup.. Let me give it a shot and get back to you in couple of hours...!!

Thanks again!!

Link to comment
Share on other sites

Yeah. The code didn't work fine. I managed to fix that line but it doesn't do anything else other opening the link up...

ie.au3 and screencapture.au3 - are they needed - I believe they are already included with autoit 3.0 right?

Sorry that - It has been long time since I have played with autoit. hence asking few silly questions.

Let me know!

Thanks!

Link to comment
Share on other sites

Ram,

Yes, they are needed...the code runs fine on my machine...post the code (exactly as you are running it)

kylomas

Edit: PS - you will probably have to adjust the mouse pos...use the window info tool to get the correct coords...

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Ram,

Yes, they are needed...the code runs fine on my machine...post the code (exactly as you are running it)

kylomas

Edit: PS - you will probably have to adjust the mouse pos...use the window info tool to get the correct coords...

Sorry Kylomas.. My bad.. It is did work. My mouse coordinates were different. Thanks...I can go from here..!!

Thanks for the great help!!

Link to comment
Share on other sites

Sorry Kylomas. I have one more question. Is there a way to capturescreen a specific location only instead of the whole window.

only the dynamic image that changes after the click on the arrow.

Is this possible?

Awaiting your response!

Link to comment
Share on other sites

Ram,

Yes, see the help file.

As I alluded to earlier, this kind of processing is fraught with problems, some of which are;

- sensitive to WEB site changes

- can only run on machines with like display metrics

- how can you tell when you are on the last page?

Good Luck,

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Thanks for the reply kylomas..

With the help document I could manage to get the specific location scanned.

Guess what I was thinking the same three problems that you have mentioned but then I figured out that the last page issue can be solved by me giving the number of pages in the prompt.

For which I am looking for solution: Can you guide me to the place where I can see about text box and that can be used on the script.

Thanks in advance!

Link to comment
Share on other sites

Ram,

I see that you are beginning to understand what I mean by

As I alluded to earlier, this kind of processing is fraught with problems, some of which are;

- sensitive to WEB site changes

- can only run on machines with like display metrics

- how can you tell when you are on the last page?

What do you expect to do with these screen images, assumming that you can capture them? Perhaps there is some other way to skin this cat?

kylomas

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Ram,

I see that you are beginning to understand what I mean by

What do you expect to do with these screen images, assumming that you can capture them? Perhaps there is some other way to skin this cat?

kylomas

I want to put them all into CBR format so that i can read it on my iPad.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...