"Capture()ing" multiple pages


Recommended Posts

Hi,

Having trouble using Page.Capture()..

When I test it with a single page, ie

Page.Capture("Main", "c:\test\capture.jpg")

it works fine. But when I use the comma-separated overlay notation like strCurrentPage would see, ie

Page.Capture("Main,Graph1", "c:\test\capture.jpg")

it writes a 0kb jpg. Any ideas? Should it be a different notation? I have tried initialising with

Page.strCurrentPage = "Main"

delay(0.1)

Page.strCurrentPage = "Graph1"

delay(0.1)

first, but that doesn't make a difference, nor does it seem whether I have the web server active or not.

Help?!

Link to comment
Share on other sites

It does indeed. As detailed above, I tried the initialising thing, and I can successfully capture each page individually - either Page.Capture("Main","c:\test\capture.jpg") works, as does Page.Capture("Graph1","c:\test\capture.jpg"). I only run into trouble when I try:

Page.Capture("Main,Graph1","c:\test\capture.jpg")

Just confirming this is the correct syntax for capturing overlaid pages. Has anyone tried this themselves?

Link to comment
Share on other sites

Sorry, you did actually say you were initializing the pages.

No, that is not the correct syntax. Since Capture uses the same code as the web browser, it takes the same specifier and you should look at the web server section for a complete description. The comma is not a valid URL character, so you must use the + to combine pages:

Page.Capture("Main+Graph1","c:\test\capture.jpg")

There are other specifiers available to crop the pages too. I have tested this and it works.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.