iText font setting for phrase - itext

I am using iText 5.5 to generate pdf files.i am trying to make the header font bold,but its not working.
I have used the Phrase to set the header content and set the font for phrase.
please help.

There is no iText 5.5, so I'm presuming you're using v. 5.0.5. You're off to a good start, iText is the best OSS library out there.
There is an example of how to use the header here: http://itextpdf.com/examples/iia.php?id=103 If you make the header Phrase bold, you'll have your header with bold text. I strongly suggest that you use the example's code so you can see how it works. Make it bold, then copy the code over to your project. Good luck.

Related

JasperReports Font adaption when using docx format printing (pdf using correct format)

I have a question regarding the font used in pdf and docx formats when printing from a JasperReports jrxml. I followed the instructions defined http://community.jaspersoft.com/wiki/custom-font-font-extension to get the JasperReports report to print Arial font in both pdf and docx prints. The pdfs happily accepted this and are printing Arial. But no matter what I try, the docx prints always show up as Sans Serif font.
I also already edited the JasperReports property lines as follows:
net.sf.jasperreports.default.font.name = ArialExtension (Name of my extension, as created by following the links documentation, jar file)
net.sf.jasperreports.default.pdf.font.name = ArialExtension
So, as I understand, JasperReports should always pick Arial as font which it doesn't. I frankly don't know what to do now. We need pdf and docx prints available for our customers and we need them in Arial font.
Can someone point me in another direction or tell me, what I am missing.
I fixed the problem! The solution is absolutely not obvious and might not work for everyone. But for me, the correct font was used in DOCX and PDF format when I named my font extension exactly like the font I want to use. So instead of ArialExtension, I called it Arial and my jar was called Arial.jar. Then the font in DOCX was correct, also in PDF.

Adding Line Height Drop Down to Tiny MCE Editor Tool Bar

We are using BlogEngine.Net for managing blog posts which has implemented version “3.9.2” of Tiny MCE Editor.
As per our requirement we want to add new control (dropdown) in tool bar of the editor to provide this line height option so that author of the blog post could set line height to any of the selected paragraphs. We even find a related link for this http://fiddle.tinymce.com/jAbaab but it didn’t work for me.
Can someone please help me on this?
Take a closer look at the way the style plugin works that gets shipped with Tinymce3. You can copy the plugin directory and apply your own changes there.
All you need to to is to get rid of the unwanted funtionality and rename the plugin (directory and in the code).
This TinyMCE plugin can help you.
https://github.com/castler/tinymce-line-height-plugin
Download and place it into your tinymce plugin folder.
It supports TinyMCE 4.

Editing the font and style of the text in the instructions box in MIT Scratch project page

The problem: How do I change the font in the instruction text box in an MIT Scratch project page. For example: make a line of text standout in bold. I believe it maybe done through editing the html code that is behind the box as I found a read only editor button that displays the code for the box. Unlike say a cell in Ipython you cannot simply surround text with tags. It seems such a simple problem but I have not found the solution yet.
Sorry, you can't do it.
The only thing you can do is to search for special font-characters and paste them in the Instruction text-box
For a day or two fairly recently this was allowed from a bug, but that bug was fixed and it's now impossible.
It's possible to change the HTML code, but that changes would only seen by you, and nobody else. There isn't a way to do it.

How to show arabic,Hebrew,etc language fonts on jasper (iReport) reports

I have this simple tabular report with many columns with different types .
But when printing the report with rtf (word) extension
the columns with numbers or date appears on the report.
the columns with with Arabic content appear on the report.
But when printing the report with PDF extension
the columns with numbers or date appears on the report.
the columns with with Arabic content DOES NOT appear on the report.
I have tried many different fonts and changed properties like PDF embed and PDF encoding.
What is the right way to do this ?
I faced this problem and its very annoying so to make it clear to all here how you do this
on the field or label that may has Arabic content go to its properties by right click or on the properties pallet of it , and make these changes
Check the box PDF embed
Choose Identity-H (Unicode with horizontal writing) from PDF encoding
Choose the font Arial if not there add it to the jasper fonts folder in the installation directory
and add it to the class path in settings
Rerun in PDF mode ... it will work
I faced similar issue with Arabic text and found above solution helps but it leads to another issues like JVM doesn't have Arial etc. And also we need to configure these properties on each and every field. Following configuration worked for me with the jasper latest versions.
Use DejaVu Sans font(I used DejaVu Sans Mono)
Add jasperreports-fonts dependency(In my case Jasper report version is 6.4.0 & jasper-fonts version is 6.0.0)
If you need right to left layout use mirroring trick mentioned in
iReport - How to change report direction to RTL?
Finally found this !!!
I'm using Jasper 6.17.0
Step 1: Download Arial font from website.
Step 2: Place this ttf file in the server path. eg. /app/jasper/Templates/TemplateFonts/
Step 3: Select text field/static field from the Jasper Design screen, In the Properties > Advanced > PDF provide below
PDF Embedded : true
PDF Encoding : Identity-H (Unicode with horizontal writing)
PDF Font Name : /app/jasper/Templates/TemplateFonts/arial.ttf
Try now :)

<blockquote> tags in iTextSharp pdf

I am converting HTML to List using XMLWorker, the indentation (using blockquote tags) not appears in pdf. I have tried creating List with HTMLWorker but the result is same. Is there any way to preserve indentation (when using blockquote tag in HTML for indentation) in pdf?
The blockquote and li do not have indentation to "preserve", its just that almost every browser (if not all) choose to indent them by default. This is an individual choice made by every browser vendor, just as Netscape choose to use grey as the default body background color in the 90's. Any text formatting that you see iText doing is its own "default style" and anything that differs from your expectations you'll need to manually change.
When I try to run a blockquote through the XMLWorker version 5.4.0 I don't see anything and its not on the list of supported HTML tags. Do you have it further wrapped in a SPAN or some other tag? Can you post a sample?
When I run an OL/LI combination through 5.4.0 I see that iText makes them indented. Can you post a sample that doesn't indent? One quick fix would be to apply a simple margin to the UL/OL such <ol style="margin-left:100px;">