Re: [Swftools-common] pdf2swf conversion error using php

2009-09-18 Thread franck ruzzin
Hi Ricardo,

It seems that you have found the problem.
The tests I've done were on a Linux shared server (Linux Hosting).
It is not possible to enable fastCGI. 
Moreover, the maximum memory allowed for a process is 32 Mo, and as you noticed 
with the files I sent, the conversion reach 40M/50M of memory.
I will try more investigations with an other server where fasstCGI is enabled, 
but this cannot be done before a month.

Thanks for your help,

Regards,
Franck



 Message du 17/09/09 à 15h44
 De : Ricardo Pedroso rmdpedr...@gmail.com
 A : fruz...@voila.fr
 Copie à : swftools-common@nongnu.org
 Objet : Re: [Swftools-common] pdf2swf conversion error using php
 
 
 On Wed, Sep 16, 2009 at 2:38 PM, Ricardo Pedroso rmdpedr...@gmail.com wrote:
  On Sun, Sep 13, 2009 at 8:20 AM, franck ruzzin fruz...@voila.fr wrote:
  Hi Ricardo,
 
  Following the results for 2 problematic files, one with a return code of 1 
  and the other with a return code of 6, when executing the php script via 
  http.
 
  You'll notice that the execution from shell always ends with the 
  generation of the swf file, the return code is 0.
  You'll notice that the http execution results in an error code (0) and 
  no file generation.
 
  In the begining, I thought of a error inside the pdf files (the two files 
  come from windows, one is written and converted to pdf with openoffice, 
  the other is written with word and converted with PDFcreator). But in this 
  case, why does the shell conversion succeed ?
 
  If it can help, I can send you the pdf files.
 
 Hi Franck,
 
 I received with pdf's.
 
 I copy paste you php script and run it through lighttpd.
 Both pdfs were successfully converted.
 My lighthttpd is configured to run php as fastcgi.
 
 It's seems that you have some limit configured somewhere, you have to find it.
 If with run php as mod_php, you could try to configure it to run as fastcgi.
 
 My best guess is that you are reaching a memory limit.
 Both pdf conversion reach 40M/50M of memory on my laptop.
 
 How do you run your apache/php? mod_php?
 
 You can try, as root:
 su - user_that_run_apache
 
 and then check the OS limits(memory, filesize,) for that user with:
 ulimit
 
 I found this thread that problably is related to your problem:
 http://marc.info/?t=12223344914r=1w=2
 
 Ricardo
 
 



Que sont devenues les stars de la télé réalité ? Toutes les infos sont sur 
http://people.voila.fr/people/mediatheque/dossiers/liste-des-dossiers-people.html







Re: [Swftools-common] pdf2swf conversion error using php

2009-09-16 Thread Ricardo Pedroso
On Sun, Sep 13, 2009 at 8:20 AM, franck ruzzin fruz...@voila.fr wrote:
 Hi Ricardo,

 Following the results for 2 problematic files, one with a return code of 1 
 and the other with a return code of 6, when executing the php script via http.

 You'll notice that the execution from shell always ends with the generation 
 of the swf file, the return code is 0.
 You'll notice that the http execution results in an error code (0) and no 
 file generation.

 In the begining, I thought of a error inside the pdf files (the two files 
 come from windows, one is written and converted to pdf with openoffice, the 
 other is written with word and converted with PDFcreator). But in this case, 
 why does the shell conversion succeed ?

 If it can help, I can send you the pdf files.

 Regards,
 Franck



 The results.



 *
 File Notre_participation.pdf (size = 746532 bytes)


 --
 EXECUTION FROM SHELL :
 --

 X-Powered-By: PHP/4.4.9
 Content-type: text/html

 millisec: 0.93638400 1252824381
 Array
 (
    [0] = NOTICE  processing PDF page 1 (595x842:0:0) (move:0:0)
    [1] = NOTICE  File contains jpeg pictures
    [2] = NOTICE  processing PDF page 2 (595x842:0:0) (move:0:0)
    [3] = NOTICE  processing PDF page 3 (595x842:0:0) (move:0:0)
    [4] = NOTICE  processing PDF page 4 (595x842:0:0) (move:0:0)
    [5] = NOTICE  Writing SWF file Notre_participation.pdf.swf
    [6] = EXEC RETURN VALUE : 0
 )


 millisec: 0.82071800 1252824383
 execution time : 1.8843340873718 seconds

 The file Notre_participation.pdf.swf is created

 -
 EXECUTION FROM HTTP :
 -

 millisec: 0.18996000 1252824477
 Array (
    [0] = NOTICE processing PDF page 1 (595x842:0:0) (move:0:0)
    [1] = NOTICE File contains jpeg pictures
    [2] = EXEC RETURN VALUE : 6
 )
 millisec: 0.85771300 1252824477
 execution time : 0.66775298118591 seconds

 The file Notre_participation.pdf.swf is not created


 *
 *


 File JT-2008-jan_fev_mar.pdf (size = 3974136 bytes)

 --
 EXECUTION FROM SHELL :
 --

 X-Powered-By: PHP/4.4.9
 Content-type: text/html

 millisec: 0.00954700 1252824400
 Array (
    [0] = NOTICE  processing PDF page 1 (612x792:0:0) (move:0:0)
    [1] = NOTICE  File contains jpeg pictures
    [2] = NOTICE  processing PDF page 2 (612x792:0:0) (move:0:0)
    [3] = NOTICE  processing PDF page 3 (612x792:0:0) (move:0:0)
    [4] = NOTICE  processing PDF page 4 (612x792:0:0) (move:0:0)
    [5] = NOTICE  processing PDF page 5 (612x792:0:0) (move:0:0)
    [6] = NOTICE  processing PDF page 6 (612x792:0:0) (move:0:0)
    [7] = NOTICE  processing PDF page 7 (612x792:0:0) (move:0:0)
    [8] = NOTICE  processing PDF page 8 (612x792:0:0) (move:0:0)
    [9] = NOTICE  processing PDF page 9 (612x792:0:0) (move:0:0)
    [10] = NOTICE  processing PDF page 10 (612x792:0:0) (move:0:0)
    [11] = NOTICE  Writing SWF file JT-2008-jan_fev_mar.pdf.swf
    [12] = EXEC RETURN VALUE : 0
 )


 millisec: 0.51346000 1252824426
 execution time : 26.50391292572 seconds

 The file JT-2008-jan_fev_mar.pdf.swf is created

 -
 EXECUTION FROM HTTP :
 -

 millisec: 0.02592200 1252825019
 Array (
    [0] = NOTICE processing PDF page 1 (612x792:0:0) (move:0:0)
    [1] = NOTICE File contains jpeg pictures
    [2] = NOTICE processing PDF page 2 (612x792:0:0) (move:0:0)
    [3] = NOTICE processing PDF page 3 (612x792:0:0) (move:0:0)
    [4] = NOTICE processing PDF page 4 (612x792:0:0) (move:0:0)
    [5] = NOTICE processing PDF page 5 (612x792:0:0) (move:0:0)
    [6] = EXEC RETURN VALUE : 1
 )
 millisec: 0.95641000 1252825025
 execution time : 6.93048787117 seconds

 The file JT-2008-jan_fev_mar.pdf.swf is not created


So, doesn't seems to be a timeout problem.
It's is not easy to know what really is happening, at least for me.
You may check your server logs, maybe they can give some hints.

Depending you apache/php configuration (mod_php, fastcgi, suphp, ...)
the process will run
in a different environment/user.
You can try to run pdf2swf with that user from shell.

pdf2swf needs to write some tempfiles, could be some
restriction/privileges to write tempfiles?
But if you successfully convert some pdf's I suppose the problem is not here.

I really don't know...

You can send me the files, I can try exec them on lighttpd (I don't
have apache installed) on my laptop

Please, do a Reply all to keep the discussion in the mailing.
Someone can jump into, and give you the answer.
But If you want to send me the files then send them directly to me.

Ricardo




Re: [Swftools-common] pdf2swf conversion error using php

2009-09-12 Thread Ricardo Pedroso
On Sat, Sep 12, 2009 at 11:18 AM, franck ruzzin fruz...@voila.fr wrote:
 I have on a Linux server the file 'convert.php', containing :

 ?php
        $output=array();
        $command = ../pdf2swf -t -o Notre_participation.pdf.swf 
 Notre_participation.pdf;
        $return_var=0;
        $s=exec($command,$output,$return_var);

        array_push ($output, EXEC RETURN VALUE :  . $return_var);
        print_r($output);
 ?


 If I type via SSH the following code

 (uiserver):u44819199:~/swftest/script  bphp convert.php/b
 I have the following response


 Array
 (
    [0] = NOTICE  processing PDF page 1 (595x842:0:0) (move:0:0)
    [1] = NOTICE  File contains jpeg pictures
    [2] = NOTICE  processing PDF page 2 (595x842:0:0) (move:0:0)
    [3] = NOTICE  processing PDF page 3 (595x842:0:0) (move:0:0)
    [4] = NOTICE  processing PDF page 4 (595x842:0:0) (move:0:0)
    [5] = NOTICE  Writing SWF file Notre_participation.pdf.swf
    [6] = EXEC RETURN VALUE : 0
 )


 and the file 'Notre_participation.pdf.swf' is generated.

 But if open the same file via a navigator (ie http://mysite/convert.php),
 I have the following response


 [0] = NOTICE processing PDF page 1 (595x842:0:0) (move:0:0)
 [1] = NOTICE File contains jpeg pictures
 [2] = EXEC RETURN VALUE : 6


 the process stops and the file Notre_participation.pdf.swf is not created.


Could this be a timeout issue???
How long the file takes to be converted when you execute from shell?

If this is the problem you have two timeouts to take care of.
One from php (30 seconds by default), and the other from the webserver.

 I have an other file with a return value of 1

Is this one correctly converted when executed from shell?

Regards,
Ricardo