I’ve found a hack for UNIX users here, via here:
-
Put this script into a file:
#!/usr/bin/perl -w
This script takes an OpenOffice Impress output file in PDF format,
including both slides and notes, and splits that PDF into separate
slides-only and notes-only PDF files. The reason this script exists
is because OpenOffice itself (as of version 2.2, at least) does not
have the capability to export a notes-only PDF file.
being installed and available in your command search path.
if (scalar @ARGV != 1) {
print “usage: split_pdf slides_and_notes.pdf\n”;
exit 1;
}
my $pdf_file = $ARGV[0];
An OpenOffice Impress PDF contains a certain string that holds the
total number of pages in the document. There may be no guarantee
that this string must exist, but since it does for now, we use it.
my $pagecountstring = strings $pdf_file | fgrep /Count
;
$pagecountstring =~ m,/Count (\d+)>>,;
my $totalpagecount = $1;
my $halfpagecount = $totalpagecount / 2;
my $firstnotepage = $halfpagecount + 1;
my $out_file_base = $pdf_file;
$out_file_base =~ s/.pdf$//;
pdftk $pdf_file cat 1-$halfpagecount output ${out_file_base}_slides.pdf
;
pdftk $pdf_file cat $firstnotepage-$totalpagecount output ${out_file_base}_notes.pdf
;
-
Install PDFtk.
-
Export the Impress file as a PDF file with both slides and notes.
-
Run the script on the exported file.
The script will produce two new PDF files: one containing only slides and one containing only notes.
I wrote another Perl script to do something similar for HTML exports:
- Export the HTML files to directory
in-dir
.
- Create a directory
out-dir
to hold the notes-only files.
- Run
[script] in-dir out-dir
, or just [script] out-dir
if the current working directory is in-dir
.
out-dir
will hold HTML files which contain only the notes. If an original HTML file had no notes, there will be no corresponding file in out-dir
.
This doesn’t modify the original file, and doesn’t create any notes-free HTML files.
The script:
#!/usr/bin/perl
use strict;
use Cwd;
my $in_dir = cwd();
my $out_dir;
sub processFile {
my ($file_name) = @_;
open (my $in, "<", "$file_name") || die "Couldn't read $file_name: $!";
my $preamble = "";
while (<$in>)
{
$preamble .= $_;
last if (m/<body/i);
}
my $found_notes = 0;
while (<$in>)
{
if (m|^<h.>Notes:</h.>|i)
{
$found_notes = 1;
last;
}
}
unless ($found_notes)
{
close($in);
return;
}
my $out_file = "$out_dir/$file_name";
open(my $out, ">", "$out_file") || die "Couldn't write $out_file: $!";
print $out "$preamble";
print $out $_;
while(<$in>)
{
print $out $_;
}
close($in);
close($out);
}
##########################################################################
if (@ARGV == 1)
{
$out_dir = $ARGV[0];
}
elsif (@ARGV == 2)
{
$in_dir = $ARGV[0];
$out_dir = $ARGV[1];
}
else
{
print STDERR "Usage:\n";
print STDERR " notes-only.pl: in-dir out-dir\n";
print STDERR " notes-only.pl: out-dir (assumes current dir is in-dir)\n";
exit(1);
}
die "No directory $in_dir" unless (-d $in_dir);
die "No directory $out_dir" unless (-d $out_dir);
opendir(my $dh, $in_dir) || die "can't open $in_dir: $!";
while(readdir $dh) {
next unless /^text[0-9]+.html?$/;
processFile($_);
}
closedir($dh);
exit(0);