swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] pdf2swf -I


From: Joseph Masoud
Subject: Re: [Swftools-common] pdf2swf -I
Date: Tue, 02 Feb 2010 22:29:22 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20100116 Shredder/3.0

On 24/11/09 00:20, Chris Pugh wrote:
2009/11/22 Joseph Masoud<address@hidden>:
On 22 Nov 2009, at 20:34, Chris Pugh wrote:

Yousef,

2009/11/22 Joseph Masoud<address@hidden>:

The command I type is:
pdf2swf -I filename.pdf
and it produces:
NOTICE  Output filename not given. Writing to filename.swf
Are you *sure* that is what you are actually typing?   Because,

  pdf2swf -i filename.pdf

and,

  pdf2swf -I filename.pdf

are two entirely different commands, producing entirely different outputs!

  -I simply gives you the info.

  -i gives you the info and also converts the file ( thus producing
the complaint about no output filename ).

Just maybe using the upper and lower case 'i' didn't actually matter
with an older version of SWFTools?  I don't know,
as have not checked   But that, just could be the answer you are after. )

This does not solve my "issue", I want the output to go to stdout.  I use
the exec() function of PHP and I'd like to capture the output and store
it
in an xml file.  Here's the function:
public function getInfo($fileInstance)
   {
       // return information about the pdf file
       exec("pdf2swf -I $fileInstance",$data,$ret);

       if($ret) {
           // raise an CException;
           ...
           // place a new entry in error log
           ...
           return $data[$ret];
       } else {
           ...
           // with the new behaviour, this just returns the<notice>, I
want
the information
           return $data;
       }
   }
With the new behaviour, $data will be the<notice>  and not the
information
about the file [old behaviour default].  I guess I'll need to figure out
another way of getting this information.
Wouldn't it be easier just to output the file directly?  As with,

  pdf2swf -I filename.pdf>  filename_info

Note the difference should you happen to do,

  pdf2swf -i filename.pdf>  filename_info
Thanks for the suggestion, very much appreciated.

When I import the pdf2swf.c file from a swftools package (downloaded 4
months ago) and re-compile, I don't get the notice above anymore and
the
output goes to stdout.
Could be the letter case issue, as stated above.

Thanks again for your help.  I very much appreciate it.
Hope the above was a better attempt! ;o)

Regards,


Chris.
Hi Chris,
I have tried typing the command many different times at different times of
the day that is very unlikely for me to have messed up the case.  Something
has changed in the pdf2swf.c file I'm downloading.
This is isn't a major issue, I'm not sure why when I download exactly the
same version of swftools (0.9.0), I'm getting two different behaviors when
using pdf2swf -I [uppercase].  I have the version I downloaded four months
ago so I'm not in any major problem.
In which case it must be specifically a quirk ( or slip up ) with the
older version of
swfc.  Does this older version make use of the two flags, -i and -I?
  As I said, I have
not tried the older version you have used.

Personally, I'd also probably go for output to a file rather than a
variable, as with

   pdfswf -I>  data.xml

then read the resulting file.

Regards,


Chris.
Apologies for opening an old thread. I didn't think it was appropriate starting a new one and this post is mainly for the sake of completeness.

The following lines were removed from pdf2swf.c in swftools 0.9.0 and they were the root cause of my "problem":

-- lines 643 to 646

if(info_only) {
        show_info(driver, filename);
        return 0;
}

If you add them back into pdf2swf.c and recompile swftools, you should be able to get info to output to stdout by default when pdf2swf -I is used.

Regarding Mr. Pugh's final comment, it would still be possible to output to a file with the code snippet above included in pdf2swf.c, issue:

pdf2swf -I file.pdf -o data.xml

[I wouldn't personally use xml as an output file though to store the results of pdf2swf -I though]

Many thanks for this remarkable tool.

Regards,
Joseph





reply via email to

[Prev in Thread] Current Thread [Next in Thread]