views:

75

answers:

1

I'm trying to solve a similar problem as was described here - to create a Windows Service for taking snapshots of rich webpages (html+js+flash) and saving them to a PDF file.

The bundle Firefox+cmdlnprint did the trick for me. I wrote a simple program running as a service that invokes Firefox to make a PDF. All seems well, the PDF gets created, but Flash is completely missing. Although, when started not as a service, Flash renders just fine.

Can anyone shed a light on what blocks Flash from rendering and if there's a workaround?

thanks!

+1  A: 

I can only shoot into the dark here but two things come to mind:

  • Who (which user) is your service running as? What happens if you make the service run under the administrator user?

  • If your service is running on the local system account, have you enabled the "allow exchange of data between desktop and service" check box for the service (Don't know what it's named in english)? You never know what Flash may need to run.

If that doesn't work out, have you looked at Crowbar and XULRunner? I don't know for sure whether they do what you need - and if they do, whether Flash works with them - but they seem to be approaches to the same thing you are trying to do.

Pekka
I could get it to work only under an Administrator-level user account.I had no luck running the service under LocalSystem account with or without "Allow service to interact with desktop" - was getting a message the service wasn't allowed to print. Thanks for suggesting other solutions, but it seems like the problem is in Flash itself. I tried another utility called IECapt (iecapt.sourceforge.net) based on the IE and it didn't render Flash in the service mode as well.
Leonid
@Leonid so it works under an Admin account as a service?
Pekka
I'm sorry, I meant I could only get the PDF generated in a service running under an Admin account. It still had blank spaces instead of Flash. If running the service under the Localsystem even the PDF couldn't be generated. So PDF+Flash only did work in the user, non-service mode. I'm trying to figure out why is that so.
Leonid
@Leonid I see. Maybe this is something to ask on an official Flash forum as well. It could be that Flash uses DirectX or something that isn't initialized in service mode.
Pekka