Skip to content

Instantly share code, notes, and snippets.

@esimonetti
Created June 19, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esimonetti/392a194495803085d679e7504c4040dc to your computer and use it in GitHub Desktop.
Save esimonetti/392a194495803085d679e7504c4040dc to your computer and use it in GitHub Desktop.
This is just an example of how to print all pdf templates of a module (Contacts) landscape instead of portrait.
<?php
// Enrico Simonetti
// enricosimonetti.com
//
// 2017-06-19 on Sugar 7.9.0.0
// filename: custom/modules/Contacts/sugarpdf/sugarpdf.pdfmanager.php
//
// This is just an example of how to print all pdf templates of a module (Contacts) landscape instead of portrait.
// After this customisation is installed, and the system is repaired, all PDF templates for Contacts will be printed landscape instead of portrait
require_once('include/Sugarpdf/sugarpdf/sugarpdf.pdfmanager.php');
class ContactsSugarpdfPdfmanager extends SugarpdfPdfmanager
{
public function preDisplay()
{
parent::preDisplay();
$this->setPageFormat(PDF_PAGE_FORMAT, 'L');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment