Skip to content

Commit

Permalink
käytetään pupesoft_a2ps
Browse files Browse the repository at this point in the history
  • Loading branch information
jonikanerva committed Jul 7, 2016
1 parent 403c364 commit f98e52d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions inventointi_listat.php
Expand Up @@ -1471,11 +1471,18 @@ function il_varvaikutus($varastonarvo, $varastoonvaikutus, $where, $kutsujoinlis
echo "filenimi = {$filenimi}<br>";
}
else {
system("a2ps -o ".$filenimi.".ps -r --medium=A4 --chars-per-line={$rivinleveys} --no-header --columns=1 --margin=0 --borders=0 {$filenimi}");
$params = array(
'chars' => $rivinleveys,
'filename' => $filenimi,
'mode' => 'landscape',
);

// konveroidaan postscriptiksi
$filenimi_ps = pupesoft_a2ps($params);

if ($komento["Inventointi"] == 'email') {

system("ps2pdf -sPAPERSIZE=a4 ".$filenimi.".ps ".$filenimi.".pdf");
system("ps2pdf -sPAPERSIZE=a4 {$filenimi_ps} ".$filenimi.".pdf");

$liite = $filenimi.".pdf";
$kutsu = t("Inventointilista")."_$listanro";
Expand Down Expand Up @@ -1545,14 +1552,14 @@ function il_varvaikutus($varastonarvo, $varastoonvaikutus, $where, $kutsujoinlis
}
elseif ($komento["Inventointi"] != '') {
// itse print komento...
$line = exec("{$komento['Inventointi']} ".$filenimi.".ps");
$line = exec("{$komento['Inventointi']} {$filenimi_ps}");
}

echo "<font class='message'>", t("Inventointilista tulostuu!"), "</font><br><br>";

//poistetaan tmp file samantien kuleksimasta...
unlink($filenimi);
unlink($filenimi.".ps");
unlink($filenimi_ps);
}

$tee = "";
Expand Down

0 comments on commit f98e52d

Please sign in to comment.