[jboss-user] [JBoss Seam] - itext pdf in Firefox
vlaugier
do-not-reply at jboss.com
Mon Oct 29 13:05:40 EDT 2007
Hi,
I have a trouble visualizing pdfs with firefox
even when I use :
| <pdf:documentStore useExtensions="true" />
|
Firefox takes me to a page with the following source code
| <?xml version='1.0' encoding='UTF-8' ?>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
| <html><head><meta http-equiv="Refresh" content="0; URL=ticket.pdf?docId=1&cid=9&clr=true" /></head><body></body></html>
|
I guess this is because I do not manage to use the useExtensions="true" property well
This pdf page is called from a button that triggers a method that loads some parameters before it redirects to the pdf page.
Here is the calling snipet from the web page :
|
| <h:dataTable value="#{client.serviceOrders}" var="so" rendered="#{not empty client.serviceOrders}">
|
|
| <h:column >
| <c:facet name="header">Identifiant Artemis</c:facet>
| <h:outputText value="#{so.artemisId}" rendered="#{so.status.code != 2}" />
| </h:column>
|
| <h:column >
| <c:facet name="header">Date de prise commande</c:facet>
| <h:outputText value="#{so.sellTime}" rendered="#{so.status.code != 2}" />
| </h:column>
|
|
| <h:column >
| <c:facet name="header">Prix TTC</c:facet>
| <h:outputText value="#{so.amountWithTaxes}" rendered="#{so.status.code != 2}" />
| </h:column>
|
| <h:column>
| <c:facet name="header">Detail - Prestations complémentaires</c:facet>
| <!--#{potentialEditedAccount.account.fullname}-->
| <h:commandButton action="#{serviceOrderManager.viewOrder(so)}" value="Detail" rendered="#{so.status.code != 2}" />
| </h:column>
|
| <h:column>
| <c:facet name="header">Cloture - Encaissement - Reçu - Facture</c:facet>
| <h:commandButton action="#{serviceOrderManager.startClosingOrder(so)}" value="Cloturer la commande" rendered="#{so.status.code == 0 and empty so.payments }"/>
| <h:commandButton action="#{paymentHandler.setOrderforCBPayment(so)}" value="Payer la commande par CB" rendered="#{so.status.code == 1 and not so.paid}"/>
| <h:commandButton action="#{paymentHandler.setOrderForChequePayment(so)}" value="Payer la commande par chèque" rendered="#{so.status.code == 1 and not so.paid}"/>
|
|
| <h:commandButton action="#{serviceOrderManager.viewTicket(so)}" value="Reçu" rendered="#{not empty so.payments }"/>
|
| <h:commandButton action="#{serviceOrderManager.viewTicket(so)}" value="Facture" rendered="#{not empty so.payments }"/>
| </h:column>
|
|
|
| </h:dataTable>
|
|
here is the called method :
| public String viewTicket(ServiceOrder order) {
|
| serviceOrder = entityManager.merge(order);
| return "ticket";
| }
|
here is my pages.xml snipet
| <rule if-outcome="ticket">
| <redirect view-id="/ticket.xhtml"/>
| </rule>
|
I have also added the needed modification to components.xml
| <pdf:documentStore useExtensions="true" />
|
and in web.xml
| <!-- PDF filter -->
| <filter>
| <filter-name>Seam Servlet Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Servlet Filter</filter-name>
| <url-pattern>*.pdf</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Document Store Servlet</servlet-name>
| <servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Document Store Servlet</servlet-name>
| <url-pattern>*.pdf</url-pattern>
| </servlet-mapping>
|
my pdf renders well with IE and Konqueror (which do not need the useExtensions)
Thanks in advance for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099928#4099928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099928
More information about the jboss-user
mailing list