0

I have a flex project where people can style something (add pictures, forms, text, ...) and create a PDF in the end. I'm using the purepdf library to create the PDF. My problem is, that when I create the PDF there is one point where the PDF library needs more than the default 15 seconds script time to create the page.

I always get the following error message: Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.

I tried to add scriptTimeLimit="60" and also add -default-script-limits 1000 60 to the compiler options, but it's still at the default 15 seconds.

I already tried to break up the creation of the PDF in different chunks, but that's as small as I can go. Can anyone help me to extend the default script time?

Thanks guys!

Hannes
  • 3,752
  • 2
  • 37
  • 47
  • 1
    You really don't want to do that. The app idle all this time and the user might just terminate the app anyway. What you need is make sure you don't need that much time to process your code. – BotMaster Oct 28 '14 at 15:07
  • 1
    Your question shouldn't be about the script time out limit, but rather how to create the PDF more asynchronously as that is the proper solution. I've never used purepdf, but I have used others (alivepdf) with very very large amounts a data with success. – BadFeelingAboutThis Oct 28 '14 at 16:09
  • Could you post your PDF-creation code? – Brian Oct 28 '14 at 19:40

1 Answers1

1

Thanks for your help! You're right, we shouldn't leave the app hanging for that long. I finally found a solution with the help of an ActionScript Worker. I handed the whole PDF creation over to a worker and showed an animated loading bar. As it turns out Workers aren't affected by the execution time limit and can handle exhaustive tasks.

Thanks for pointing me in the right direction!

Hannes
  • 3,752
  • 2
  • 37
  • 47