return $display;
}
+sub _run_python_uno {
+ my ($self, @args) = @_;
+
+ local $ENV{PYTHONPATH};
+ $ENV{PYTHONPATH} = $::lx_office_conf{environment}->{python_uno_path} . ':' . $ENV{PYTHONPATH} if $::lx_office_conf{environment}->{python_uno_path};
+ my $cmd = $::lx_office_conf{applications}->{python_uno} . ' ' . join(' ', @args);
+ return `$cmd`;
+}
+
sub is_openoffice_running {
+ my ($self) = @_;
+
$main::lxdebug->enter_sub();
- my $cmd = "./scripts/oo-uno-test-conn.py " . $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . " 2> /dev/null";
- my $output = `$cmd`;
+ my $output = $self->_run_python_uno('./scripts/oo-uno-test-conn.py', $::lx_office_conf{print_templates}->{openofficeorg_daemon_port}, ' 2> /dev/null');
chomp $output;
my $res = ($? == 0) || $output;
return 0;
}
- my @cmdline;
if (!$::lx_office_conf{print_templates}->{openofficeorg_daemon}) {
- @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
- "-minimized", "-norestore", "-nologo", "-nolockcheck",
- "-headless",
- "file:${filename}.odt",
- "macro://" . (split('/', $filename))[-1] .
- "/Standard.Conversion.ConvertSelfToPDF()");
+ system($::lx_office_conf{applications}->{openofficeorg_writer},
+ "-minimized", "-norestore", "-nologo", "-nolockcheck", "-headless",
+ "file:${filename}.odt",
+ "macro://" . (split('/', $filename))[-1] . "/Standard.Conversion.ConvertSelfToPDF()");
} else {
if (!$self->spawn_openoffice()) {
$main::lxdebug->leave_sub();
return 0;
}
- @cmdline = ("./scripts/oo-uno-convert-pdf.py",
- $::lx_office_conf{print_templates}->{openofficeorg_daemon_port},
- "${filename}.odt");
+ $self->_run_python_uno('./scripts/oo-uno-convert-pdf.py', $::lx_office_conf{print_templates}->{openofficeorg_daemon_port}, "${filename}.odt");
}
- system(@cmdline);
-
my $res = $?;
if ((0 == $?) || (-f "${filename}.pdf" && -s "${filename}.pdf")) {
$form->{"tmpfile"} =~ s/odt$/pdf/;
ghostscript = gs
# Location of the pdflatex (or compatible, e.g. xetex) binary
latex = pdflatex
+# Location of the Python interpreter to use when converting from
+# OpenDocument to PDF. Some distributions compile UNO support only
+# into binaries located in different locations than the main Python
+# binary.
+python_uno = python
# Location of the two executables "pg_dump" and "pg_restore" used for
# database backup and restoration from the admin section. If
# "pg_dump" or "pg_restore" is set to "DISABLED" then the
# Add the following paths to the PERL5LIB environment variable.
# "/sw/lib/perl5" is for Mac OS X with Fink's Perl.
lib = /sw/lib/perl5
+# Add the following paths to the PYTHONPATH environment variable for
+# locating Python modules. Python is used when converting OpenDocument
+# files into PDF files.
+python_uno_path =
[print_templates]
# If you have LaTeX installed set to 1