Sign in to follow this  
Followers 0
Ram

Print Screen and Save the image file automatically

13 posts in this topic

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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!!

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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!!

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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.

In the Help file, in the Message Boxes and Dialogs section in particular..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

In the Help file, in the Message Boxes and Dialogs section in particular..

Great... I figured out using the directions you gave me.

Thanks a lot!!

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0