2013-10-04 29 views
5

Tabloları dışa aktarırken PDF sayfa boyutunu A4 manzara olarak değiştirmek istiyorum. fasulye yöntemi yönetilenprimefaces pdf export - sayfa boyutu

<h:commandLink title="Export"> 
    <p:graphicImage value="/resources/theme-main/images/export/pdf.png" 
     style="border:0"/> 
    <p:dataExporter target="myTable" type="pdf" fileName="name" 
     encoding="windows-1250" preProcessor="#{fileExportProcessor.preProcessPDF}"/> 
</h:commandLink> 

çok basittir:

public void preProcessPDF(Object document) { 
     Document pdf = (Document) document; 
     pdf.open(); 
     pdf.setPageSize(PageSize.A4.rotate()); 
    } 

Ben de A0 boyutunu ayarlamak için çalıştı Ama burada

benim kodudur .. ben ne yaparsak halletmek olamaz ya da bazı özel boyutumu, sadece onu görmek için, ancak hiçbir şey değişti ... PDF ihracat sadece A4 portre modunda ihracat.

Bu işin nasıl yapılacağı konusunda bana yardımcı olabilir misiniz (A4 manzara modu)? Benim için çalıştı

public void preProcessPDF(Object document) { 
     Document pdf = (Document) document; 
     pdf.setPageSize(PageSize.A4.rotate()); 
     pdf.open(); 
    } 

:

cevap

İlgili konular