Welcome, Guest
  • Author Topic: PDF/PPT Viewer  (Read 1838 times)

    mglushed

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    PDF/PPT Viewer
    « on: 10/22/10, 05:05 »
    Hi, I'm new to Flex/Flash/ActionScript, please don't get angry if my questions are too dumb.

    I'm trying to create a flex application which displays slideshows with PDF/PPT files as the source, the PDF/PPT files are stored in a SQL database, and the application needs to run online.

    Similar to these:
    http://flexpaper.devaldi.com/
    http://www.slideshare.net/

    I'm searching for a simple solution. If it can be built using only flex then it's the best. But it doesn't seem to be that simple.

    This is what I think that might work:
    Every time the application requests for a slide, use a webmethod which runs a windows batch file, which will execute a 3rd party program (SWFTools) to convert PDF to SWF file which contains each page per frame (I don't know if there is a program which can convert both PDF and PPT to SWF, prolly I will have to convert PPT to PDF, then to SWF), this should be done on server-side. But I don't know how to grab that generated swf file and return as the webmethod's result. Then, when the webmethod returns the swf file, the flex application will display it in a mx:SWFLoader component, and we can use "gotoAndStop()" method to change the current page.

    Please tell me how to make it to work, or if there is a better solution.

    Thanks for your time!

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: PDF/PPT Viewer
    « Reply #1 on: 10/22/10, 10:42 »
    There are some tools for do this (I have used print2flash, the old flashpaper) but the schema you explains seems not efficient for me. Basically the whole conversion takes some seconds for each page, and huge presentations could take minutes, being this annoying for the user. In my case, we use a special server to convert files at the time there are uploaded, storing files not in database (storing documents as BLOB in a DB imply a serialization/deserialization for each) but in a folder structure. Then our Flex application just load swf on runtime, also for pagination we need one file per page and not a whole one.
    In resume: deserialization to get the file + conversion will be overkilling for building something usable

    Jorge

    mglushed

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    Re: PDF/PPT Viewer
    « Reply #2 on: 10/23/10, 20:33 »
    Hi Jorge,

    Thank you very much for your helpful response!

    I'm sorry for being dumb, but could you explain it a bit more please:
    - How do you convert the uploaded file at the time it is uploaded? Should I use a .net webservice to get that done, or should I use PHP script? (I prefer uploading using PHP script because it can show the progress, but I don't know how to make the PHP to execute the conversation)
    - Should I use a .net webservice to store the path-to-file information in a database, or should I use PHP to write to an XML file?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: PDF/PPT Viewer
    « Reply #3 on: 10/25/10, 09:16 »
    I was not in the server side, basically I use the Filereference class to upload (trough PHP) the file to the server, then a daemon copy the file to another Windows server in a folder that print2flash automatically converts to swf and copy again to the Unix server, finally I use in my app. If you want to do yourself, check which API your selected product support (in Print2flash we need to use .Net), usually documentation explain how to use.
    Print2flash is here: http://print2flash.com/

    Jorge