title: change default format dataExporter in Primefaces
body: <p>I want to use to generate a pdf dataexporter, use the method preprocessor to insert some content. By giving the type letter size page assimilates well as formats of texts. Then make a page break to put the chart on a new page, right there is the problem that generates the second page with other size and also find a way to change the font size of the text of the exported table.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:commandLink&gt;  
        &lt;p:graphicImage value="/images/pdf.png"/&gt; 
               &lt;p:dataExporter type="pdf" target="dataTableAddDetalles" fileName="pdf" preProcessor="#{serviciosMB.preProcessPDF}"/&gt;  
  &lt;/h:commandLink&gt;
  </code></pre>
  
  <p>backing bean</p>
  
  <pre><code> public void preProcessPDF(Object document) throws Exception {
      try {
          Document pdf = (Document) document;
          pdf.open();
          pdf.setPageSize(PageSize.LETTER);
  
          ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
          String logo = servletContext.getRealPath("") + File.separator + "images" + File.separator + "header.gif";
  
         // pdf.add(Image.getInstance(logo));
          pdf.add(new Paragraph("EMNI", FontFactory.getFont(FontFactory.HELVETICA, 22, Font.BOLD, new Color(0, 0, 0))));
          SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
  
          pdf.add(new Phrase("Fecha: " + formato.format(new Date())));
          pdf.newPage();
      } catch (Exception e) {
          //JsfUtil.addErrorMessage(e, e.getMessage());
      }
  }
  </code></pre>