Most of my slides are S5 format made by Spork and Spork::S5.
S5 is a slide show format based entirely on XHTML, CSS, and JavaScript.
I like this html based slide system. But when I wanted to upload my slide to SlideShare, I found it's not support html slide!
So I did a hack, convert S5 slide to PDF. Below is the result. Source S5 slide is here.
YATTA!
Requirements
- Firefox 2.0 or above (maybe prefer to 3.0)
- JSActions
- capture_s5.js (JSActions script)
- image2pdf.pl
1. Install Firefox and JSActions extension.
Firefox 3.0 is recommended. 2.0 might work but I didn't try.
JSActions is recommended latest version (I installed jsactions_3.0.0a4_2008051401.xpi)
After installing both, open JSActions config panel (Tools - Add-ons - JSActions option button) and set script folder.
2. Install capture_s5.js
This is JSActions's script capture s5 slide and save it to local disk.
Download the script and edit first line of the script.
var dir = "j:\\tmp\\";
This is a directory where captured images are saved to.
After edit the script, put it into directory named "JSActions script folder\global\". If you don't have global directory under the script folder, create it by yourself.
Then, restart firefox and you'll find "actions - capture s5" in mouse context menu.
3. Save S5 slide as image
Open your S5 slide in Firefox, and run capture_s5.js
After this command, you'll see saved slide images (slide0001.png, slide0002.png...) in your local directory.
4. Create PDF from images
Install PDF::FromImage and get image2pdf.pl from its example directory.
And run it like following:
image2pdf.pl -o output.pdf slide*.png
Finally, you get your slide PDF!
Enjoy!
Hello again. Long time no see, but I'm fine.
I'm now working on こえ部 which is a voice communication service build with Catalyst.
It already has lots of funny voices. This is my recent favorite こえ(voice):
It's very funny, isn't it? :)
Let's sign up and enjoy it if you're interested in!
ART-Meter, one of our services, is the shop where everyone can sell his/her own paintings. And the price is decided only by size of paintings, 1 yen for 1 scm.
The web shop was already upgraded last week, and real shop will relocate and reopen tomorrow!
I had gone to see the new shop yesterday, and it's wonderful.
Lighttpd has error-handler-404 feature which is useful as dynamic content handler.
But it seems that Catalyst does not support this.
This is problem of Catalyst's environment parser (Catalyst::Engine::CGI)
When I set error-handler-404 to "/script/myapp_fastcgi.pl" and request /foo/bar (no exsits path),
Lighttpd call /script/myapp_fastcgi.pl with following %ENV
PATH_INFO and QUERY_STRING are always empty via error-handler-404.REQUEST_URI: /foo/bar
REDIRECT_URI: /script/myapp_fastcgi.pl
PATH_INFO: ''
QUERY_STRING: ''
Instead of those vars, set REQUEST_URI (path+query)
It seems that Lighttpd always set REQUEST_URI whether error-handler is set or not.
So the solution about this problem is that Engine::CGI parses REQUEST_URI for any lighttpd's request.
Here is the patch:
Update at 2006-09-09 14:36 +0900: updated patch--- /usr/local/share/perl/5.8.8/Catalyst/Engine/CGI.pm 2006-07-20 06:45:16.000000000 +0900
+++ lib/Catalyst/Engine/CGI.pm 2006-09-09 20:07:45.000000000 +0900
@@ -140,12 +140,28 @@
my $path = $base_path . ( $ENV{PATH_INFO} || '' );
$path =~ s{^/+}{};- my $uri = URI->new;
- $uri->scheme($scheme);
- $uri->host($host);
- $uri->port($port);
- $uri->path($path);
- $uri->query( $ENV{QUERY_STRING} ) if $ENV{QUERY_STRING};
+ my $uri;
+
+ # lighttpd always set requested uri into REQUEST_URI
+ if ( ( $ENV{SERVER_SOFTWARE} || '' ) =~ /lighttpd/ and $ENV{REQUEST_URI} ) {
+ $uri = URI->new( $ENV{REQUEST_URI} );
+ $uri->scheme($scheme);
+ $uri->host($host);
+ $uri->port($port);
+
+ use YAML;
+ warn Dump $uri;
+
+ $ENV{QUERY_STRING} = $uri->query if $uri->query;
+ }
+ else {
+ $uri = URI->new;
+ $uri->scheme($scheme);
+ $uri->host($host);
+ $uri->port($port);
+ $uri->path($path);
+ $uri->query( $ENV{QUERY_STRING} ) if $ENV{QUERY_STRING};
+ }# sanitize the URI
$uri = $uri->canonical;
@@ -167,7 +183,11 @@
my ( $self, $c ) = @_;
local (*ENV) = $self->env || \%ENV;- if ( $ENV{QUERY_STRING} ) {
+ if ( ( $ENV{SERVER_SOFTWARE} || '' ) =~ /lighttpd/ and $ENV{REQUEST_URI} ) {
+ my ($query_string) = $ENV{REQUEST_URI} =~ /\?(.*)/;
+ $self->SUPER::prepare_query_parameters( $c, $query_string );
+ }
+ elsif ( $ENV{QUERY_STRING} ) {
$self->SUPER::prepare_query_parameters( $c, $ENV{QUERY_STRING} );
}
}
Update at 2006-09-09 20:13 +0900: updated patch again, added prepare_query_parameters fixes for query_parameters.
nothingmuch gave me some ideas to Helper::Lighttpd:
- Static files generation (lighttpd.conf ...etc)
- Independent from Static::Simple for static files serving
Hmm, I thought this helper just as a test server, but these features exactly nice if it'll be implemented.
So I'm going to work for it.
And.. code patch is very welcome :)
Catalyst's default build-in test server has many problems now. (IE redirection, performance, and etc..)
So I've created Catalyst::Helper::Lighttpd today.
This is a helper script to generate a server script that makes lighttpd as a catalyst test server.
After install this module, you can generate new lighty's test server by following command:
Then ./script/myapp_lighttpd.pl are created../script/myapp_create.pl Lighttpd
Usage of this myapp_lighttpd.pl is:
Usage:
myapp_lighttpd.pl [options]Options:
-? -help display this help and exits
-host host (defaults to all)
-p -port port (defaults to 3000)
-l -lighttpd lighttpd path (defaults to `which lighttpd`)
Almost same as myapp_server.pl (default server).
But if your lighttpd comamnd is not in PATH environment, you need to specify it by -l option.
Actually this script just boot lighttpd as no daemon mode, and the server boot myapp_fastcgi.pl internal.
Very simple, but useful (for me :)
Although I'm going to upload this helper to CPAN, but I hope that default build-in server would have this feature if it possible.
catalyst gurus: How about this? Or any ideas?
Soon after seeing the entry about KIKU-TAN at kentaro's blog, I've bought it and started to learning English words by using it.
And now, I finished first a week process of it (10% of total)
This is nice book. But because my brain capacity is poor, I need to a lot of time to memorize one word.
And I often forget the word that I learned before, so I have to read back previous page everyday.
I found my vocabulary was poorer than what I imagined.
Kentaro, Thank you for introduced such a nice book.
I will test this out tonight and let you know how to goes. read more
on Fixes Engine::CGI for Lighttpd