Hi

Stuart has added support for Flexpaper to SWF Tool.
CCK Fields could be mapped to output it via Flexpaper.
Just missing an automatic File conversion of PDF or Word documents.

Here I want to start a thread for documentation on "How to convert PDF's or Office Files to an SWF for Flexpaper".

First I have found http://www.swftools.org
But no instruction or test at the moment.

More ???

CommentFileSizeAuthor
#22 Options Custom Command101.27 KBknalstaaf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bennos’s picture

Title: Automatic File Conversion » Convert automatically a PDF to SWF and use Flexpaper to display

OK rename it.

I have Media Mover installed. MM has an harvesting function, which can retrieve files from a node or a cck field, convert it and write it back.

Here is short instruction.

Need ist Media Mover and the Media Mover custom command module.
Install www.swftools.org. You need to compile it. On configure look at the output. There could be some libaries missing like freetype or libjpeg. Without the libs, the module will be compiled, but pdf2swf is deactivated.

Make sure that all needed stuff ist installed.

Typically a PDF file is stored as node attachment or in a cck file field.
Both will work.

Upload and install the Media mover modules mentioned above.
the submodules with ffmpeg wrapper is not needed here.

After install of MM, you must add a configuration.
Go to admin/build/media_mover/add

You will a lot of setctions.

Informations about the Config
HARVEST CONFIGURATION
Process CONFIGURATION
Storage Configuration
Complete Configuration

1. Add some informations and choose the action for harvest a file from a cck field or a drupal upload.
2. Processing actions is "Custom Command".
3. choose an action to write the file back and save the config.

you config is now saved, but will not work.

We need to edit the config.
Now you will find some more options to choos the content type and the cck fields for ther harvesting action.
Specify the extension to only "PDF pdf"

also we must add now a custom command.

this should be something like
pdf2swf Paper3.pdf -o Paper3.swf -T 9 -f

replace the filename with provided tokens. List of tokens is available.

Last step.
Configure the write back action to same place or another place.

Should work now. try a test.

this is the first version, could be more structured.

sdgandy’s picture

Thanks a lot, this is what I've been looking for :D

bennos’s picture

nice to hear, that it helped. If you have problems. please report it back.

There could be another way to convert Pdf's. I think this could also be done via rules.

Rules Version 1.1 has a new form events plugin. Think this can also do this, but haven't tried it.

I my mind the way is

1. Content is going to be saved.
2. Field has pdf
3. ....

Rules does not support a command line instruction. Only PHP is accepted. A little bit code is needed.

Vasu’s picture

subscribing

Yuki’s picture

subscribing

grandchamp_g’s picture

Is it at all possible for you to do a video cast of how you configured this? For some reason I'm getting nothing. Thanks.

macieq’s picture

subscribing

robert.redl@easytouch.cc’s picture

subscribing

http://flexpaper.devaldi.com/
sudo apt-get install swftools
pdf2swf filename.pdf
implement conversion as drupal module with php or trigger on linux server on file upload and then autoconvert it with bash script or mono and c#

ha_le’s picture

Anyone have tried this on a Windows machine? I've got my pdf2swf installed and added to PATH. Tried with cmd it works find out of the console. But MM doesn't seem to successfully invoke the program? my config is pdf2swf [harvest_file] -o [output_file]

vimalramaka’s picture

subscribe

claymanz’s picture

subscribe.

chinesechef’s picture

subscribed.

chinesechef’s picture

Could you export the configuration as text?

chrixlee’s picture

Hi There,
1 Month ago, I was required to convert a batch of PDFs to animated Flash (better with Page-flip). I've browsed and listed some PDF to Flash sites, hope this would help any of you.

http://www.pdf-to-flash-magazine.com
Offers free online conversion and offline software which is my favorite. Multiple choices can be satisfied. It is such an innovative conversion tool for creating page flipping reading experiences.

http://www.issuu.com
Terrific online converter with large quantity of users, features in sharing documents (more like magazines 2 me). Multiple formats support: PPT/Word/PDF to Flash

http://www.page-flip.com
Can be the most professional converter with higher credit rating. However the cost is higher. The license fee for per user is €40, and this is for 3 months
not lifetime.

http://www.swftools.org/
An open source software. To be frank, the conversion effect is not as good as the former. May it meet the needs of flash/web developer.

That's all I got

chromix’s picture

I've exported a configuration that works for me.

  • Havest->Take in PDF from CCK file field called "Attachment" in the node type "Text"
  • Process-> Run PDF2SWF on the harvested file and save the resulting output file into the same directory
  • Storage-> Move the output file from the previous step to a directory used for a SWF-only CCK file field called "Converted PDF", also in the node type "Text"
  • Complete-> add the now-moved output file to the original node from the Harvest step in the "Converted PDF" field

The export follows:

$configuration = new stdClass;
$configuration->required = array('mm_cck', 'mm_custom_command', 'mm_dir', 'mm_cck');
$configuration->name = 'PDF to SWF';
$configuration->cid = '3';
$configuration->description = 'Convert PDF attachments to SWF files using PDF2SWF';
$configuration->start_time = '1285708147';
$configuration->last_start_time = '1285707573';
$configuration->status = 'stopped';
$configuration->settings->mma_file_perm = '0';
$configuration->settings->mma_file_mask = '0644';
$configuration->settings->mma_node_edit_item_show = '0';
$configuration->settings->mma_node_item_delete = '1';
$configuration->settings->mma_node_config_rss = '0';
$configuration->settings->mma_cron_notify = '0';
$configuration->settings->mma_cron_notify_email = '';
$configuration->settings->mma_cron_notify_time = '10';
$configuration->settings->mma_process_num = '0';
$configuration->settings->mma_storage_num = '0';
$configuration->settings->mma_complete_num = '0';
$configuration->harvest->module = 'mm_cck';
$configuration->harvest->action = '1';
$configuration->harvest->configuration =  array(
  'mm_cck_havest_node_type' => 'text',
  'mm_config_harvest_field' =>  array(
    'field_attach' => 'field_attach'
  ),
  'file_types' => 'PDF pdf',
  'cid' => '3',
  'module' => 'mm_cck',
  'action' => '1',
  'verb' => 'harvest'
);
$configuration->harvest->cid = '3';
$configuration->process->module = 'mm_custom_command';
$configuration->process->action = '1';
$configuration->process->configuration =  array(
  'output_file' => 'sites/core/files/text/nid[nid]-fid[fid].swf',
  'command' => 'pdf2swf "[harvest_file]" -o "[output_file]" -f -T 9 -t -G',
  'cid' => '3',
  'module' => 'mm_custom_command',
  'action' => '1',
  'verb' => 'process'
);
$configuration->process->cid = '3';
$configuration->storage->module = 'mm_dir';
$configuration->storage->action = '2';
$configuration->storage->configuration =  array(
  'path' => '/www/drupal6/sites/core/files/text/flexpaper',
  'cid' => '3',
  'module' => 'mm_dir',
  'action' => '2',
  'verb' => 'storage'
);
$configuration->storage->cid = '3';
$configuration->complete->module = 'mm_cck';
$configuration->complete->action = '3';
$configuration->complete->configuration =  array(
  'mm_cck_field_save_complete' => 'field_converted_pdf',
  'mm_cck_new_node_complete' => '0',
  'mm_cck_save_type_complete' => 'image',
  'mm_cck_save_author_complete' => 'Anonymous',
  'mm_cck_title_default_complete' => '',
  'mm_cck_body_default_complete' => '',
  'mm_cck_save_options_complete' =>  array(
    'comment' => '0',
    'status' => '0',
    'promoted' => '0',
    'sticky' => '0'
  ),
  'mm_cck_file_replace_complete' => '0',
  'mm_cck_file_source_delete_complete' => '0',
  'field_save_list_complete' => '0',
  'cid' => '3',
  'module' => 'mm_cck',
  'action' => '3',
  'verb' => 'complete'
);
$configuration->complete->cid = '3';
$configuration->hierarchy->parent = '0';
kmasterzone’s picture

Hi, I'm very much new to drupal up-till now I've created 'CCK file field called "Attachment" in the node type "Text"' rest of it, how to do it I cannot understand, please help.

Actually what I want to do is:
1) take a pdf and convert it to page-wise swfs with naming conventions as 00001.swf, 00002.swf and so on.
2) next I want I'll parse the output directory and make a xml out of it, so that I can feed that to my Flex WebApp.

Link: http://demo.techmastiff.com/eMagazine/

In the above link the fetched xml is static. To which I want to make it dynamic.

Thanks.
Kunal Bhatia

udvranto’s picture

subscribing

asb’s picture

Fascinating approach to display PDF files. Has someone managed to get this working on a public site? How does it look like?

delta’s picture

subscribing

bipink8’s picture

Hi,

I wanted to display the pdf or other office files(uploaded through CCK field) in my webpages only.please help about this.

thanks in advance,
Bipin

knalstaaf’s picture

2. Processing actions is "Custom Command".
3. choose an action to write the file back and save the config.

I'm stuck here.

The option mentionned in step 2 provides two more options:

  • Output file (Define output file.)
  • Command (Define command for this action. If you want to use 'Output file' value from previous field use [output_file].)

What do we have to fill out there?

knalstaaf’s picture

FileSize
101.27 KB

Is the explanation of #1 still up to date? Maybe some functions weren't provided back then. I'm stuck in the steps mentionned above. Attached there's a screen of the options I'm getting (and of which I have no idea what to fill out).

The storage configuration provides the same options as (shown in) complete configuration.

Install www.swftools.org. You need to compile it. On configure look at the output. There could be some libaries missing like freetype or libjpeg. Without the libs, the module will be compiled, but pdf2swf is deactivated.

Do you mean installing the SWFtools module in your Drupal site, of installing it on your (Apache) server? I can't find any reference concerning freetype or libjpeg either, where should these files should be put? This all sounds really technical tbh. Video podcasts save lives indeed.

DriveRovers’s picture

You can also use another pdf flippingbook maker to convert you pdf to swf, it is easy to use. you can download a free trail first to try.

asb’s picture

#23 is advertising spam. The referenced software is closed source and commercial, costs $97.00 and is only availabe for Windows 7. Additionally, this kind of crap is totally irrelevant for the issue "Convert automatically a PDF to SWF and use Flexpaper to display".

Jegan2668’s picture

Hi,

I am facing one major issue. I am trying to download Media Mover module from http://drupal.org/project/media_mover. But there is no 6.x version. How can i implement.