a.knight Posted August 14, 2009 Share Posted August 14, 2009 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 More sharing options...
AzeoTech Posted August 14, 2009 Share Posted August 14, 2009 I presume Graph1 contains a graph? If so, you have to actually view the page to initialize the graph before you can capture it. You can do this automatically from script by just changing to each page with 0.1 second delay between. Link to comment Share on other sites More sharing options...
a.knight Posted August 17, 2009 Author Share Posted August 17, 2009 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 More sharing options...
AzeoTech Posted August 17, 2009 Share Posted August 17, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.