RevBrowser - snapshots: not good.

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: RevBrowser - snapshots: not good.

Post by Mark » Sun Dec 05, 2010 12:08 pm

Hello,

You can use command line utilities to create snapshots of websites.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dcope
Posts: 19
Joined: Thu Jun 10, 2010 12:02 pm
Contact:

Re: RevBrowser - snapshots: not good.

Post by dcope » Sun Dec 05, 2010 10:29 pm

Mark wrote:Hello,

You can use command line utilities to create snapshots of websites.

Kind regards,

Mark
Hi Mark,

Do you have any recommended tools that run on the Mac? The tools would ideally be royalty free and re-distributable with an application.

Thanks, David.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: RevBrowser - snapshots: not good.

Post by Mark » Sun Dec 05, 2010 11:15 pm

The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dcope
Posts: 19
Joined: Thu Jun 10, 2010 12:02 pm
Contact:

Re: RevBrowser - snapshots: not good.

Post by dcope » Mon Dec 06, 2010 11:04 am

Mark wrote:David: http://qurl.tk/lf
Thanks for the link Mark. I wasn't being lazy :wink: - I had searched on this topic and found my results not to be suitable for various reasons (wrong platform, proprietary, GUI etc etc). There were a couple of results from your keywords which led me to two potential tools - webkit2png which uses PyObjC which is just a Python source script and looks interesting in terms of integration into a LiveCode app. The other is wkhtmltopdf which is quite a big (13Mb) download but includes a standalone webkit rendering engine, presumably the reason for the large download.

If anyone is interested here are the links to those tools:

http://www.paulhammond.org/webkit2png/
http://code.google.com/p/wkhtmltopdf/

Kind Regards, David.

qberty
Posts: 14
Joined: Thu Dec 16, 2010 8:08 pm

Re: RevBrowser - snapshots: not good.

Post by qberty » Thu Dec 16, 2010 8:31 pm

For anyone still willing to do this without any 3rd party external applications, you could do it the long way and set your browser window to the formatted width and height of the actually content then import a snapshot of it followed by adjust it's size again. (You can get the full width and height of a site's page or certain content by using a small VBS script or an even simpler PHP script. It's a cumbersome method, but it works and doesn't require any dependencies outside of itself besides revBrowser.dll :D

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: RevBrowser - snapshots: not good.

Post by Mark » Thu Dec 16, 2010 8:59 pm

Hi qberty,

Thanks, do you have any idea what the VBScript might be or how to do this on Mac?

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

qberty
Posts: 14
Joined: Thu Dec 16, 2010 8:08 pm

Re: RevBrowser - snapshots: not good.

Post by qberty » Fri Dec 24, 2010 5:13 am

Mark wrote:Hi qberty,

Thanks, do you have any idea what the VBScript might be or how to do this on Mac?

Best regards,

Mark
Hey Mark,

You could do it the long way and resize the whole image frame to get the screenshot, but a better plan would be using a script. Now i'm not too privvy with VBScript but I can give you js that can be converted.

Code: Select all

<script type="text/javascript">
function doClick(){
var x, y, msg='';

// for all except Explorer
if (self.innerHeight) {
x = self.innerWidth;
y = self.innerHeight;
msg += 'self.innerHeight/Width: '
+ y + ', ' + x + 'px';

// Explorer 6 Strict Mode
} else if (document.documentElement
&& document.documentElement.clientHeight) {
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
msg += 'document.documentElement.clientHeight/Width: '
+ y + ', ' + x + 'px';

// other Explorers
} else if (document.body) {
x = document.body.clientWidth;
y = document.body.clientHeight;
msg += 'document.body.clientHeight/Width: '
+ y + ', ' + x + 'px';
}
alert(msg);
}
</script>
And easier one to read would look something simple like:

Code: Select all

	var scnWid,scnHei;
	if (self.innerHeight) // all except Explorer
	{
		scnWid = self.innerWidth;
		scnHei = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		scnWid = document.documentElement.clientWidth;
		scnHei = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		scnWid = document.body.clientWidth;
		scnHei = document.body.clientHeight;
	}

Post Reply