Logo is not fitting in the specified dimension container in pdf using apache velocity template - html

#macro(logoLiveAreaSection)
<fo:block-container width="52mm" height="18mm" position="relative">
<fo:block position="absolute" top="0" left="0">
$liveArea.render("logo_live_area")
</fo:block>
</fo:block-container>
#end
I am trying to fit the new logo in container in pdf but it is coming out of that specified size, it should be fit within (52x18)mm space
Any suggestion, What should be done to solve it?
I am using this code
I tried using overflow property but no luck

another way to insert logo is to set a variable and specify your file
#set ($logo1Url="url('file:/data/logos/yourlogo.png')")
And you can use your variable in the code below
<fo:inline >
<fo:external-graphic src="$logo1Url" content-height="64px" content-width="64px"/>
</fo:inline>
external-graphic is used for a graphic where the graphics data resides outside of the XML result tree.
To specify size, use content-height and content-width.
Documentation is available here

Related

adding imageurl to image element dynamically wont work

so iam trying to add a image i have saved on my project in image folder. But it dosent work
DirectCast(Customer.Items(0).FindControl("imageControl"), Image).ImageUrl = "~/images/IMG_1287.JPG"
DirectCast(Customer.Items(0).FindControl("imageControl"), Image).DataBind()
customer is the repeater html element the image element is in. I cant call the image element direct in the server code because the image element is inside a repeater element. So i have to use findcontrol method which works good. When i debugg the code i can se that it finds the right image element the problem is when i set the imageurl nothing seems to happen in the ui but i dont understand why can anybody help me please :)
<div>
<asp:Image ID="imageControl" Width="100%" Height="70%" runat="server"/>
</div>
To me it looks like you are not trying access controls within repeater in correct manner , it should be like :
If image is in header :
DirectCast(Customer.Controls[0].Controls[0].FindControl("imageControl"), Image).ImageUrl = "~/images/IMG_1287.JPG"
If image is in footer
DirectCast(Customer.Controls[Customer.Controls.Count - 1].Controls[0].FindControl("imageControl"), Image).ImageUrl = "~/images/IMG_1287.JPG"
Please have a look at this post for more details.
PS : Are you using vb ? cause i have used C# syntax, if yes change accordingly.

Get the actual position of element after pagination in wkhtmltopdf

[Ubuntu 14.01, wkhtmltopdf 0.12.1]
wkhtmltopdf would change the position of the row element to avoid the page break. So I can't obtain the accurate position of each element.
The original HTML, to-be-rendered.html
....
<p class="SECTION">3. GGGGGGGGGGGGGGGG</p>
<p class="a">ZZZZZZZZZZZZZ</p>
<p class="c">AAAAAAAAA</p>
<p class="d">BBBBBBBBBBBBB</p>
<p class="c">CCCCCCCCCCC</p>
<p class="d">DDDDDDDDDDDDDDDDDDDDDD</p>
<p class="c">EEEEEEEEEE</p>
....
To debug, the Y-offset is appended to each element, and there is a 'absoluted' line is posited at 957.
//javascript(JQuery)
$("p").each(function(){
var pi = this;
pi.html(pi.html()+""+pi.offset()['top']);
})
var hr=document.createElement('hr');
$(hr).addClass("segment").css('top', 957).appendTo("#editor");
The html and the rendered pdf without pagination (with a extremely long page-height) are like http://i.stack.imgur.com/0lrEs.png
$ wkhtmltopdf -page-height 10000mm to-be-rendered.html output.pdf
As it shown, the line(top:957) and the content("BBBBBBBB938" top:938) are well posited where they should be.
However, the position changed when we chose the limited page-height
$ wkhtmltopdf -page-size A4 to-be-rendered.html output.pdf
The "BBBBBBBB938" has been push down as there is no enough space for it in the last page. The top of "BBBBBBBB938" should be approximately at 953px rather than its original 938. As shown in
http://i.stack.imgur.com/VRn1u.png
So the question is, is it possible to get the rendered position of the element? I would like to calculate what first line will be in each rendered page, (Because I want to change the header based on the type of first line in each rendered, paginated page), however the rows move after pagination only when rendered. I can't predict it in JS of "to-be-rendered.html".
Any idea? Thanks a lot!

Metaio SDK (AREL) - how to show image content without tracking?

I have just simple rectangle button realized as image content and i wanna to show it on screen without any tracking and without using screen anchors.
You can see i have no translation and rotation, but screen is still empty.
<object id="button1">
<title><![CDATA[Button 'images']]></title>
<assets3d>
<model><![CDATA[html/resources/0cde94934f9b4dab0998a3d73b2865ba/0cde94934f9b4dab0998a3d73b2865ba.zip]]></model>
<transform>
<translation>
<x>0.0</x>
<y>0.0</y>
<z>0.0000000000</z>
</translation>
<rotation type="eulerdeg">
<x>0.0000000000</x>
<y>0.0000000000</y>
<z>0.0000000000</z>
</rotation>
<scale>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</scale>
</transform>
<properties>
<coordinatesystemid>0</coordinatesystemid>
<screenanchor flags="4">0</screenanchor>
</properties>
</assets3d>
<viewparameters/>
</object>
You can use Dummy-Tracking: http://helpdesk.metaio.com/questions/7548/explanation-on-dummy-tracking
In general the best place to ask questions about AREL or the metaio SDK is http://helpdesk.metaio.com
There you should get an answer quickly.
I think that the problem is here:
<scale>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</scale>
The 0.0 is not a neutral scaling value.Your scaling transformation results in an object with no dimension. As it is shown on http://www.advancedmetaio.com/explaining-the-arel-xml-structure-part-2-transformations/, if you don't want to apply any scaling transformation your scaling values should be (1, 1, 1) :
<scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</scale>

Force GridView To Create Not Recycle Controls

I have a GridView in a windows store app that has an ItemContainerStyleSelector. Within the style is an Image control that has a custom dependency property to set the source (This is so I can get a handle on the Image and hook up to the unloaded event).
My issue is the Image is never unloaded and seems to be reused. This means that when I set the source, the image is set on other items in the GridView as well (For Example I have an object which has no image but after scrolling away and then back again it has an image from another object).
I've tried to set virtualization mode to standard where I can but it doesn't help. Any ideas would be greatly appreciated.
Here is the Image that is contained in the style. This is passed to a method "OnRemoteURISourceChanged" when set. I'd expect a different image control whenever the method is called but this is not the case.
<Image x:Name="BackgroundImage" DataContext="{Binding CurrentBackdrop}" helpers:ImageExtensions.RemoteURISource="{Binding Uri}" Stretch="UniformToFill"/>
And here is my GridView
<GridView x:Name="ItemsGrid" Grid.Row="1" ItemsSource="{Binding BrowseResults}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Margin="20,0,20,0"
IsItemClickEnabled="True" ItemClick="ItemsGrid_ItemClick" VirtualizingStackPanel.VirtualizationMode="Standard">
<GridView.ItemContainerStyleSelector>
<controls:UPnPCDStyleSelector CDObject="{StaticResource somestyle1}" Container="{StaticResource somestyle2}" Item="{StaticResource somestyle3}"/>
</GridView.ItemContainerStyleSelector>
<GridView.ItemsPanel>
<ItemsPanelTemplate VirtualizingStackPanel.VirtualizationMode="Standard">
<WrapGrid Orientation="Vertical" VirtualizingStackPanel.VirtualizationMode="Standard"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
UPDATE: The issue appears to be the WrapGrid. If I change this to a VirtualizingStack Panel and set the VirtualizationMode to Standard then everything works as expected but obviously my items then only appear on one line and not multiple lines as I wish.
How do I set the virtualization mode of a WrapGrid?
Is there a chance your helpers:ImageExtensions.RemoteURISource doesn't clear the Image.Source when either your CurrentBackdrop property or its Uri property value is null?
Are you sure the task which is loading the img source returns to default ui context when awaiting? I don't think it is a good idea to set Image.Source property form code. The better solution would be to create a custom observable task class and bind im source to it's result. In the background you can call the task. Do you need the control to be Image? Because if it would be a control with template, it would be easier for you to do that. I can send you the class which does that if you want to.

ILog Elixir ColumnChart3D Labels not formating properly

I've looked through all IBM doc and Adobe livedocs, My labels for my columns which are loading dynamically are not centered properly under the columns. Here is the component code. The labels are off center to the left, and some overlap the one left of where it should be. I tried adding styles to several different areas but couldn't get it:
<ilog:ColumnChart3D id="columnChart" dataProvider="{chartData}" showDataTips="true" elevationAngle="5" projectionType="oblique" width="90%" height="100%"
rotationAngle="2" lightLatitude="0" lightLongitude="0"
ambientLight="0.1"
totalDepth="2" zoom="1" >
<ilog:horizontalAxis>
<mx:CategoryAxis dataProvider="{chartData}"
categoryField="{chartCatField}"/>
</ilog:horizontalAxis>
</ilog:ColumnChart3D>
<mx:Legend dataProvider="{columnChart}" right="0" bottom="0" />
</s:Panel>
The 3D charts axis renderer labels layout is not as smart as the one of the 2D charts due to the layout in a 3D space that is not as easy.
You can try to labelRotation property on the AxisRenderer3D to rotate the labels so that they don't collapse. Or reduce their size using the fontSize property on the same object.
<ilog:ColumnChart3D ...>
...
<ilog:horizontalAxisRenderer>
<ilog:AxisRenderer3D labelRotation="30" fontSize="8"/>
</ilog:horizontalAxisRenderer>
</ilog:ColumnChart3D>
You can also remove some labels using the canDropLabels property is needed.
FYI IBM ILOG Elixir does have specific forum here where you can find information on the product.