@@ -236,6 +236,8 @@ public function bmlt_meeting_list($atts = null, $content = null)
236236 $ num_columns = 3 ;
237237 } elseif ($ this ->options ['page_fold ' ] === 'quad ' ) {
238238 $ num_columns = 4 ;
239+ } elseif ($ this ->options ['page_fold ' ] === 'pocket ' ) {
240+ $ num_columns = 4 ;
239241 } elseif ($ this ->options ['page_fold ' ] === '' ) {
240242 $ this ->options ['page_fold ' ] = 'quad ' ;
241243 $ num_columns = 4 ;
@@ -296,6 +298,16 @@ private function constuct_page_type_settings()
296298 } elseif ($ this ->options ['page_size ' ] == 'A4 ' ) {
297299 $ page_type_settings = ['format ' => array (99.0 , 210.0 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
298300 }
301+ } elseif ($ this ->options ['page_fold ' ] == 'pocket ' ) {
302+ if ($ this ->options ['page_size ' ] == 'letter ' ) {
303+ $ page_type_settings = ['format ' => array (279.4 , 107.95 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
304+ } elseif ($ this ->options ['page_size ' ] == 'legal ' ) {
305+ $ page_type_settings = ['format ' => array (355.6 , 107.95 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
306+ } elseif ($ this ->options ['page_size ' ] == 'ledger ' ) {
307+ $ page_type_settings = ['format ' => array (431.8 , 139.7 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
308+ } elseif ($ this ->options ['page_size ' ] == 'A4 ' ) {
309+ $ page_type_settings = ['format ' => array (297.0 , 105.0 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
310+ }
299311 } elseif ($ this ->options ['page_size ' ] == '5inch ' ) {
300312 $ this ->options ['page_fold ' ] = 'full ' ;
301313 $ page_type_settings = ['format ' => array (197.2 , 279.4 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
@@ -307,8 +319,6 @@ private function constuct_page_type_settings()
307319 $ page_type_settings = ['format ' => $ ps . "- " . $ this ->options ['page_orientation ' ], 'margin_footer ' => $ this ->options ['margin_footer ' ]];
308320 } elseif ($ this ->options ['page_size ' ] == '5inch ' ) {
309321 $ page_type_settings = ['format ' => array (197.2 , 279.4 ), 'margin_footer ' => $ this ->options ['margin_footer ' ]];
310- } elseif ($ this ->options ['page_size ' ] == 'pocket ' ) {
311- $ page_type_settings = ['format ' => array (279.4 , 107.95 ), 'margin_footer ' => 0 ];
312322 } else {
313323 $ ps = $ this ->options ['page_size ' ];
314324 if ($ ps == 'ledger ' ) {
@@ -504,6 +514,39 @@ private function reorder_booklet_pages($mode)
504514 $ tplIdx = $ mpdftmp ->ImportPage ($ np );
505515 $ mpdftmp ->UseTemplate ($ tplIdx );
506516 $ this ->mpdf = $ mpdftmp ;
517+ } else if ($ this ->options ['page_fold ' ] == 'pocket ' ) {
518+ $ FilePath = $ this ->bread ->temp_dir () . DIRECTORY_SEPARATOR . $ this ->get_FilePath ('_pocket ' );
519+ $ this ->mpdf ->Output ($ FilePath , 'F ' );
520+ $ mpdfOptions = [
521+ 'mode ' => $ mode ,
522+ 'tempDir ' => $ this ->bread ->temp_dir (),
523+ 'default_font_size ' => '' ,
524+ 'margin_left ' => 0 ,
525+ 'margin_right ' => 0 ,
526+ 'margin_top ' => 0 ,
527+ 'margin_bottom ' => 0 ,
528+ 'margin_footer ' => 6 ,
529+ 'format ' => $ this ->options ['page_size ' ] . '-L ' ,
530+ 'orientation ' => 'L ' ,
531+ 'restrictColorSpace ' => $ this ->options ['colorspace ' ],
532+ ];
533+ $ orientation = $ this ->options ['page_size ' ] == 'ledger ' ? 'P ' : 'L ' ;
534+ $ mpdftmp = new mPDF ($ mpdfOptions );
535+ $ this ->mpdf ->shrink_tables_to_fit = 1 ;
536+ $ np = $ mpdftmp ->SetSourceFile ($ FilePath );
537+ $ ow = $ this ->options ['page_size ' ] == 'ledger ' ? $ mpdftmp ->h : $ mpdftmp ->w ;
538+ $ oh = $ this ->options ['page_size ' ] == 'ledger ' ? $ mpdftmp ->w : $ mpdftmp ->h ;
539+ $ fh = $ oh / 2 ;
540+ $ mpdftmp ->AddPage ($ orientation );
541+ $ tplIdx = $ mpdftmp ->importPage (1 );
542+ $ mpdftmp ->UseTemplate ($ tplIdx , 0 , 0 );
543+ $ mpdftmp ->UseTemplate ($ tplIdx , 0 , $ fh );
544+ $ sep = $ this ->columnSeparators ($ oh );
545+ $ mpdftmp ->AddPage ($ orientation );
546+ $ tplIdx = $ mpdftmp ->ImportPage (2 );
547+ $ mpdftmp ->UseTemplate ($ tplIdx , 0 , 0 );
548+ $ mpdftmp ->UseTemplate ($ tplIdx , 0 , $ fh );
549+ $ this ->mpdf = $ mpdftmp ;
507550 } else if ($ this ->options ['page_fold ' ] == 'flyer ' ) {
508551 $ FilePath = $ this ->bread ->temp_dir () . DIRECTORY_SEPARATOR . $ this ->get_FilePath ('_flyer ' );
509552 $ this ->mpdf ->Output ($ FilePath , 'F ' );
0 commit comments