you don't have to touch the class Pdf inside the bundle
just in the controller you have to add the options when you call to the methode
$response->setContent($this->get('knp_snappy.pdf')->getOutputFromHtml($html,array('page-height' => 200,'page-width' => 50)));
and this is the hole controlller acation
/**
* Displays a form to create a new Delivery entity.
*
* @Route("/generate/pdf/ticket/{id}", name="delivery_show_pdf_ticket")
* @Method("GET")
* @Template("ShippiesServiceWebAppBundle:Delivery:ticket.html.twig")
*/
public function generatePDFTicketAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ShippiesCoreBundle:Delivery')->find($id);
$info = array(
$entity ->getClient()->getCustomerNumber(),
);
$infoText = implode('|', $info);
$options = array(
'code' => $infoText,
'type' => 'datamatrix',
'format' => 'png',
'width' => 3,
'height' => 3,
'color' => array(0, 0, 0),
);
$barcode =
$this->get('sgk_barcode.generator')->generate($options);
$request = $this->getRequest();
$html = $this->render('ShippiesServiceWebAppBundle:Delivery:ticket.html.twig', array('entity' => $entity,'info'=>$infoText,'barcode'=>$barcode,'base_dir' => $this->get('kernel')->getRootDir() . '/../web' . $request->getBasePath()));
$response = new Response();
$response->setContent($this->get('knp_snappy.pdf')->getOutputFromHtml($html,array('page-height' => 200,'page-width' => 50)));
$response->headers->set('Content-Type', 'application/pdf');
$response->headers->set('Content-disposition', 'filename=1.pdf');
return $response;
}