show pdf file in a icefaces modalpopup - pdf

Is it possible to show a pdf file in modalpopup with icefaces. Tried this but does not seem to work. Am new to icefaces too.
<ice:panelPopup autoCentre="true" visible="#{popup.visible}" modal="true">
<f:facet name="header"/>
<f:facet name="body">
<OBJECT DATA="/ICEfacesDevelopersGuide.pdf" TYPE="application/pdf" WIDTH="100%" HEIGHT="100%" />
<ice:commandButton value="Close" action="#{popup.close}" />
</f:facet>
</ice:panelPopup>

I ended up doing it the old way opening it on a new window or tab using output link and target attribute.

Related

Why does Apache Batik rasterise SVG documents transcoded to a PDF when opacity is set to less than one?

I have noticed that when I use Apache Batik to transcode SVG documents to PDF's that have an opacity set to less than one Batik will create a raster version of the SVG and place it in the pdf instead. When dealing with print this is not desirable. Is there any reason Batik does this? Is there anyway to avoid this flattening of SVG documents regardless of their opacity?
Our code to create the transcoder:
PDFTranscoder pdfTranscoder = new PDFTranscoder();
pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, PIXEL_CONVERSION);
pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_AUTO_FONTS, false);
We then take the SVG which is returned form element.getEncodedData() as an SVG string.
TranscoderInput input = new TranscoderInput(new ByteArrayInputStream(element.getEncodedData().getBytes()));
TranscoderOutput output = new TranscoderOutput(byteStream);
pdfTranscoder.transcode(input, output);
For opacity we edit the SVG adding a group. Consider the following svg: Note many markup tags have been removed to keep the example concise:
<svg>
<rect x="100" y="100" width="100" height="100" />
</svg>
We would edit this SVG to appear as
<svg>
<g opacity="0.5">
<rect x="100" y="100" width="100" height="100" />
</g>
</svg>

HTML2PDF on internet explorer for SVG

I'm using eKoopmans HTML2PDF on github
This is my example, my project involves using SVG and I need to display a PDF page with svg on all browsers.
Currently the SVG is not showing on Internet Explorer if you open the link on IE.
is there a way to fix this?
<div id="element-to-print">
SVG won't work on internet explorer, only google chrome
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
</div>

change default icon outlook-addin

I try to change the defaut icon of y outlook add-in. By defaut it's blue icon
I changed every logo in my images folder. When I would like add my add-in I see the correct logo
But on Outlook, I have again the old logo []
3
I tried to clean and rebuild the solution, but it didn't change anything. I don't understand why I have always the old logo. I don't know where this old logo come from
Try to add in your manifest file this:
<IconUrl DefaultValue="your URL to image"/>
<HighResolutionIconUrl DefaultValue="your URL to image" />
The image have to be 128x128 .
If you have compose and read tags you need also have this:
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
When icon16,icon32,icon80 is inside the source tag:
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="your URL to image"/>
</bt:Images>
</Resources>
You can see full example and explanation here:
https://learn.microsoft.com/en-us/outlook/add-ins/manifests

Primefaces dynamic dialog with ui:include not working after PF upgrade from 4.0 to 5.1 [duplicate]

This question already has answers here:
How to include another XHTML in XHTML using JSF 2.0 Facelets?
(2 answers)
Closed 8 years ago.
I've recently upgraded Primefaces from 4.0 to 5.1 and after that dialogs are not being shown after clicking the commandButton. It works with dynamic="false" but I need it to be lazy loaded. ExampleBean is sessionScoped and i'm using JSF 2.2. Can someone help me solve this?
<ui:composition template="/template/common/pagelayout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ez="http://xmlns.jcp.org/jsf/composite">
<ui:define name="content">
<h:form id="form">
<p:commandButton type="button" value="Log" onclick="PF('dlgLog').show();" icon="botaoLog" />
</h:form>
<p:dialog header="HEADER" widgetVar="dlgLog" resizable="false" modal="true" height="500" width="1000" dynamic="true">
<ui:include src="logPage.xhtml"/>
</p:dialog>
</ui:define>
</ui:composition>
logPage.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form id="formlog">
<p:dataTable var="log" value="#{exampleBean.logs}" emptyMessage="Empty">
<p:column headerText="Header1" width="10%">
<h:outputText value="#{log.date}">
<f:convertDateTime pattern="dd/MM/yyyy - HH:mm"/>
</h:outputText>
</p:column>
<p:column headerText="Header2" width="10%">
<h:outputText value="#{log.op}" />
</p:column>
<p:column headerText="Header3">
<p:outputLabel value="#{log.name}"/>
</p:column>
</p:dataTable>
</h:form>
</h:body>
</html>
More specifically, you removed the h:head tag (and I found out ;-). Between the versions you used, PF created it's own h:head renderer which differs from the default implementions in code jsf libraries hence the difference in behaviour (assuming your jsf impl stayed the same).
Finally figured what the problem was. Just removed the <h:head> tag from logPage.xhtml and it worked! Not sure I know the reason though, probably has something to do with <ui:include> expecting a composition which shouldn't have a <h:head> tag.

How to display flex state elements?

I am tying to create a login form which returns if login was successful or not.
I created two states and added forms to them. But how to display them in mxml?
<mx:states>
<mx:State name="log">
<mx:AddChild>
//i add form here
</mx:AddChild>
</mx:State>
<mx:State name="notlog">
<mx:AddChild>
//i add other form here
</mx:AddChild>
</mx:State>
<mx:VBox width="100%" height="100%" styleName="dark">
</mx:VBox>
How to display state within above Vbox? If I try to place state within Vbox I get an error that state can't be placed there.
Try The following one code. you need little bit of modification in it..
<mx:states>
<mx:State name="log">
<mx:AddChild>
<mx:Label text="child 1 Selected" />
//Write down the Codde here for log
</mx:AddChild>
</mx:State>
<mx:State name="notlog">
<mx:AddChild>
<mx:Label text="child 2 Selected" />
//Write down the Codde here for notlog
</mx:AddChild>
</mx:State>
</mx:states>
<mx:VBox width="100%" height="70%" styleName="dark">
<mx:Button label="Child1" click="currentState = 'log';" />
<mx:Button label="Child2" click="currentState = 'notlog';" />
</mx:VBox>
For more information visit following link
Click to open link
Have a nice day...