我如何使用primefaces DataExporter出口阿拉伯语数据PDF文件

问题描述 投票:0回答:1

我使用的号码:dataExporter出口我p的内容:dataTable中,其中有阿拉伯文内容。当我将其导出为Excel它工作正常,但如果我尝试将其导出为PDF格式,不显示阿拉伯文内容。我使用的iText 2.1.7。

这里是我的电话号码:dataTable中与p:dataExporter

<p:dataTable id="chequeReport_tbl" value="#{reportsController.listOfChequeReports}"  var="chequeReport"
                             paginator="true" editable="false" rows="10" 
                             tableStyle="width: auto;" style="direction: ltr; text-align: right;margin-top: 5px;margin-bottom:20px"
                             paginatorTemplate="{Exporters} {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="10">
                    <f:facet name="{Exporters}">
                        <div style="float:right;">
                            <h:commandLink actionListener="#{reportsController.generateBankChequeReportPDF()}">
                                <p:graphicImage value="res/images/pdf_2.png" width="12"/>
                            </h:commandLink>
                            <h:commandLink>
                                <p:graphicImage value="res/images/excel.png" width="24"/>
                                <p:dataExporter type="xls" target="chequeReport_tbl" fileName="chequeReport"/>
                            </h:commandLink>
                        </div>
                    </f:facet>
                    <p:column headerText="تاريخ الصرف" style="text-align: center">
                        <h:outputText value="#{chequeReport.exchangeDate}"/>
                    </p:column>
                    <p:column headerText="أسم المستفيد" style="text-align: center">
                        <h:outputText value="#{chequeReport.beneficiaryName}"/>
                    </p:column>
                    <p:column headerText="مبلغ الشيك بالدولار" style="text-align: center">
                        <h:outputText value="#{chequeReport.chequeAmountInDollar}"/>
                    </p:column>
                    <p:column headerText="العملة" style="text-align: center">
                        <h:outputText value="#{chequeReport.currency}"/>
                    </p:column>
                    <p:column headerText="قيمة الشيك" style="text-align: center">
                        <h:outputText value="#{chequeReport.chequeAmount}"/>
                    </p:column>
                    <p:column headerText="تاريخ الإصدار" style="text-align: center">
                        <h:outputText value="#{chequeReport.issuingDate}"/>
                    </p:column>
                    <p:column headerText="القطاع الإقتصادي" style="text-align: center">
                        <h:outputText value="#{chequeReport.financialDep}"/>
                    </p:column>
                    <p:column headerText="الفرع" style="text-align: center">
                        <h:outputText value="#{chequeReport.branch}"/>
                    </p:column>
                    <p:column headerText="رقم الحساب" style="text-align: center">
                        <h:outputText value="#{chequeReport.accountNumber}"/>
                    </p:column>
                    <p:column headerText="رقم الهوية" style="text-align: center">
                        <h:outputText value="#{chequeReport.idNumber}"/>
                    </p:column>
                    <p:column headerText="أسم العميل" style="text-align: center">
                        <h:outputText value="#{chequeReport.customerName}"/>
                    </p:column>
                </p:dataTable>
primefaces itext openpdf
1个回答
1
投票

实际上,你的问题可以(也应该已经)一分为二的问题,两者都具有在现有的计算器Q / A。

问题1:利用iText时如何显示在一个PDF阿拉伯语。 答1:How to display Arabic in PDF created using iText

问题2:我如何自定义PrimeFaces dataExporter导出为PDF时 答2:How do I customize the PDF from a PrimeFaces p:dataExporter, e.g. page size

它们结合在一起,你有你的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.