I have a view of user data. I want to print a postcard for each one with name and address from the view on the front and other data from the view on the back. Ideally, there will four postcards per printable page, so matching up front-side data and back-side data is a challenge.
I solved this problem with a custom module. Total php, html, and css is 250 lines. Cards can be printed double-sided or fronts and backs separately for non-duplex printers. I prepare the view with the following code:
$view = views_get_view('postcard'); $view->set_display('page'); $view->preview = true; $view->is_cacheable = false; $view->pre_execute(); $view->display_handler->preview(); $view->post_execute();
To access view data after the above processing, I wrote a simple
getViewData() function that uses Drupal's