Revision dc8ffeaa
Von Moritz Bunkus vor mehr als 4 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
47 | 47 |
use Cwd; |
48 | 48 |
use Encode; |
49 | 49 |
use File::Copy; |
50 |
use File::Temp (); |
|
50 | 51 |
use IO::File; |
51 | 52 |
use Math::BigInt; |
52 | 53 |
use POSIX qw(strftime); |
... | ... | |
909 | 910 |
|
910 | 911 |
local (*IN, *OUT); |
911 | 912 |
|
912 |
my $defaults = SL::DB::Default->get; |
|
913 |
my $userspath = $::lx_office_conf{paths}->{userspath}; |
|
913 |
my $defaults = SL::DB::Default->get; |
|
914 | 914 |
|
915 |
$self->{"cwd"} = getcwd(); |
|
916 |
$self->{"tmpdir"} = $self->{cwd} . "/${userspath}"; |
|
915 |
my $keep_temp_files = $::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files}; |
|
916 |
$self->{cwd} = getcwd(); |
|
917 |
my $temp_dir = File::Temp->newdir( |
|
918 |
"kivitendo-print-XXXXXX", |
|
919 |
DIR => $self->{cwd} . "/" . $::lx_office_conf{paths}->{userspath}, |
|
920 |
CLEANUP => !$keep_temp_files, |
|
921 |
); |
|
922 |
|
|
923 |
my $userspath = File::Spec->abs2rel($temp_dir->dirname); |
|
924 |
$self->{tmpdir} = $temp_dir->dirname; |
|
917 | 925 |
|
918 | 926 |
my $ext_for_format; |
919 | 927 |
|
... | ... | |
973 | 981 |
|
974 | 982 |
# OUT is used for the media, screen, printer, email |
975 | 983 |
# for postscript we store a copy in a temporary file |
976 |
my $keep_temp_files = $::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files}; |
|
977 | 984 |
|
978 | 985 |
my ($temp_fh, $suffix); |
979 | 986 |
$suffix = $self->{IN}; |
Auch abrufbar als: Unified diff
PDF-Erzeugung: alles in temporärem Unterverzeichnis von users erledigen
Das vermeidet Kollisionen, wenn Dateien mit festem Namen wie
`pdfa.xmp` für PDF/A erzeugt werden müssen.