0

i'm new here and first of all sorry for my bad english. This is my problem: I generate a PDF document using FPDF (the rsulting document is correct, i check twice) and send it to a network printer using lpr command:

.....
$pdf->Output('stampe/lipari.pdf', 'F');

//specify the pdf I want to print
$file = 'stampe/lipari.pdf';

//Change PrinterName to the name of the printer you set up in CUPS
$cmd = "lpr -Plipari -o landscape -o fit-to-page ";
//append any files you'd like to print to the end of the command
$cmd .= $file.' 2> output';
exec($cmd);

The command return no errors and the document is printed but is always truncated by 5cm. I try several things like print with specified margins but nothing affect the result. The only visible result is when i print mirroring the document: mirrored but truncated on the other side by 5cm.

Thanks for replays

EDIT: I discover my client will return only in september and cause I can tray only "on site" I can't test right now any solution. I appreciate anyway some help.

Andrea
  • 1
  • 2

2 Answers2

0

What happens if you omit the -o fit-to-page parameter? Can you also try it with pure lp syntax?

Try changing the command to lp -d lipari -o landscape and check the result.

ewwhite
  • 435
  • 2
  • 13
  • For the first time I try without any -o command and the result was the same. Never try simple lp....sure I will but not now cause I can only try on site but my client will return in september as I edited. Thanks – Andrea Aug 28 '12 at 08:12
0

Cause the project was suspended for while i find the solution just now.

Actually the problem wheren't in the lp/lpr command. The problem was the printer driver. We reinstall HPLIP and set the correct driver...just that.

Anyway thanks for the answers.

Andrea
  • 1
  • 2