Hiyas,
I'm trying to print to an older duplex printer, and paper size is about letter-size wide, but only a half letter-size tall, so I'm trying to define a custom page output like so. I've tried many things, but this is where I'm at right now, probably not all necessary, but nothing seems to be working.
$width = '300';
$height = '150';
$pageLayout = array($width, $height); // or array($height, $width)
$pdf = new TCPDF('P', 'mm', $pageLayout, true, 'UTF-8', false);
// set array for viewer preferences
$preferences = array(
'FitWindow' => false,
'NonFullScreenPageMode' => 'UseNone', // UseNone, UseOutlines, UseThumbs, UseOC
'ViewArea' => 'MediaBox', // CropBox, BleedBox, TrimBox, ArtBox
'ViewClip' => 'MediaBox', // CropBox, BleedBox, TrimBox, ArtBox
'PrintArea' => 'MediaBox', // CropBox, BleedBox, TrimBox, ArtBox
'PrintClip' => 'MediaBox', // CropBox, BleedBox, TrimBox, ArtBox
'PrintScaling' => 'AppDefault', // None, AppDefault
'Duplex' => 'DuplexFlipLongEdge', // Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge
'PickTrayByPDFSize' => false
);
$pdf->setViewerPreferences($preferences);
$pdf->AddPage('P', $pageLayout, false, false);
Anytime I try to change the height, it seems to affect the width. If I change the width, it still affects the width, and other sizes just don't come out as you would expect. Anyone have a suggestion, or know if I'm doing something wrong?