Alt for images in JasperReports - image

While putting an image element in PDF report, how can we give the alt description or similar kind of description for that image? The idea is to read the description when some screen reader is used to read the PDF. Currently, the reader (JAWS) says just 'graphic' when encountering an image in the PDF.
Thanks!

Found out at last.
In case anyone is having similar query;
You could use the hyperlinkTooltipExpressionto set the alternate text. Something like this;
<image isLazy="true">
<reportElement positionType="Float" x="0" y="0" width="100" height="100"/>
<imageExpression class="java.lang.String"><![CDATA[$P{imageToBeShown}]]></imageExpression>
<hyperlinkTooltipExpression><![CDATA["Description goes here"]]></hyperlinkTooltipExpression>
</image>

Related

I'm trying to reference an image (in a svg code) that is in the same folder that my svg is, but I tried several ways that didn't work

I have this file named loadingReviewButtonSpinner.gif, and this file is saved on my computer in the folder where I have my project images (assets/images), but I'm trying to reference to this file in my SVG, and it isn't working.
<svg
<image
width="70" height="70"
transform="translate(30.1 -7.5)"
href="loadingReviewButtonSpinner.gif"
/>
</svg>
I have also uploaded this same image (loadingReviewButtonSpinner.gif) to a server online, and when I do the reference to the online image, it working 100%
<svg
<image
width="70" height="70"
transform="translate(30.1 -7.5)"
href="https://tinypic.host/images/2022/05/18/animation_500_l1ki69jf.gif"
/>
</svg>
But I really need it to work for me referring to the folder where my project is.
And I already tried so many options, but none of them is working...
For example, I tried:
href="file://loadingReviewButtonSpinner.gif" (and the variations with the path)
href="//..//..loadingReviewButtonSpinner.gif"
href="file:///loadingReviewButtonSpinner.gif"
I did what was said in the comment and it worked.

Header image on SAPUI5 application

I am just trying to add the image on index.html. I have create a folder of images under webcontent and add the image in images folder. I am calling it in the following way:
<HBox >
<Image
src="{./images/abc1.jpg}"
width="100%"
height="100%"/>
</HBox>
But it is showing nothing on browser. Please advice.
You use curly brackets when you are trying to bind data from a model.
Since you are not using a model to bind data. You can remove it and try.
Code for the same is as mentioned here:-
<HBox>
<Image src="./images/abc1.jpg" width="100%" height="100%"/>
</HBox>

Reportlab change font size in drawString

I tried to do everything, but I really can't get a way, how to change font size in drawString element. See the example below please
<illustration width="20" height="20">
<image file="checkbox.png" x="10" y="20" width="7" preserveAspectRatio="true" />
<drawString x="20" y="20">YES</drawString>
<image file="checkbox.png" x="10" y="10" width="7" preserveAspectRatio="true" />
<drawString x="20" y="10">NO</drawString>
</illustration>
This is my code, however I have really no idea where the font-size comes from. And I am unable to find how to change font size for words "YES" and "NO". Can anybody help? Thank you a lot
The problem can be resolved by using
<setFont name="fnt1" size="11"/>
before element.

Removing underline from hyperlink in Windows Store app

I'm creating a universal Windows Runtime App for Windows Phone 8.1 and Windows 8.1 using Xaml and C#.
I have inline hyperlinks setup as so -
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
This will display the text with a underline indicating the clickable hyperlink. However I want to indicate hyperlinks by color not underline as I can have multiple of them in a TextBlock.
I want to remove the underline from the inline Hyperlinks - TextDecorations property no longer exists in WP 8.1 and Windows 8.1 Store apps.
Note* I'm using Hyperlink element not HyperlinkButton as I need to have the links inline with text.
I would write a comment, but my reputation is not enough to do that.
I tried the same code on a blank both win 8.1 and win phone 8.1 project. However, the hyperlink is displayed with color by default, not with an underline as opposed to your project. My code is like below
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com" Foreground="#FF0007FF">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Could you try the Foreground property? Maybe it helps you.
In the final version of Windows 8.1 the Hyperlink-element doesn't have an underline. Maybe the confusion was caused by the focus border around the hyperlink? So the XAML:
<TextBlock Width="400" TextWrapping="Wrap" VerticalAlignment="Center">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Shows as:
One thing that can trick the viewer is that if the page doesn't have any other focusable items, the Hyperlink gets the focus and a border is drawn around it. This may look like it has underline:
If you want to get rid of that, add Button with Opacity 0 to the top of the page.
If you want to style the Hyperlink, you can overwrite it using the following keys:
<SolidColorBrush x:Key="HyperlinkDisabledThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="HyperlinkForegroundThemeBrush" Color="#FF4F1ACB" />
<SolidColorBrush x:Key="HyperlinkPointerOverForegroundThemeBrush" Color="#CC4F1ACB" />
<SolidColorBrush x:Key="HyperlinkPressedForegroundThemeBrush" Color="#994F1ACB" />
So if you have the following App.xaml.cs:
<Application.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="HyperlinkForegroundThemeBrush" Color="Green" />
</ResourceDictionary>
</Application.Resources>
You will get a green Hyperlink:
If you want the link to have underline, you can use the Underline-element. The XAML:
<TextBlock Width="400" TextWrapping="Wrap" VerticalAlignment="Center">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com"><Underline>bing</Underline></Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
And the result:
In my app I'm using
<Hyperlink TextDecorations="None" ...></Hyperlink>
to get rid of the underline.

Attribute {StaticResource resourcename} value is out of range

I have a button in a page defined as:
<Button Content="{StaticResource resourcename}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="32" Height="32" >
and the resource "resourcename" is defined in the app as follow:
<Grid x:Key="resourcename">
<Path Fill="Black" Stretch="Fill" Data="M7.99799,14.26781 .....
</Grid>
</Application.Resources>
When the application starts the following exception is raised:
Attribute {StaticResource resourcename} value is out of range.
I can't understand why, and BTW into the designer I can see the path correctly displayed. What I'm missing ?
I have seen people trying to and complaining about Content being set from a UIElement stored in a resources collection. I would refrain from that approach - one problem being - a UIElement might only be a child of a single UIElement. A better approach might be to store a DataTemplate in resources and set that DataTemplate as a button's ContentTemplate.

Resources