I am using Jasper Report 5.6.0 + JSF 2.2 + Primefaces 5.2
My problem is in detail band (content) of the jrxml I am passing RTF from pe:ckEditor here. This editor have many rich components e.g. tables, radio, fonts etc.
In generated document many styles escaped automatically. like table or font. While that text-field markup is html.
More: font will be changed if i generate html instead of pdf. and my rough guess is if any font that is not in JasperReport -> iText library it will escaped automatically
To render RTF text you use markup="rtf" on the textElement, however you will not be able to render tables, text alignment, box's ecc.
This feature is only for producing styled text., how the text looks (bold, size, color ecc.)
What are your options?
Convert to html and use the HTML Renderer Component, note neither this is perfect since it will renderer and image of your html (problem with overflow and size).
Create your own RTF component, I have not seen an RTF Renderer Component and I don't think there are any open tracker for this feature request in the JasperSoft Community
Parse the RTF in java and use dynamic jasper to generate your report (or subreport relative to the RTF)
When generating pdf, if font extension is not provided , iText will use (quoting #Bruno Lowagie) "its best effort" to render your font, this often is not enough. Consider adding font-extension to your project
Check list for rendering font in pdf using jasper report
How to add font extensions using iReport or JasperSoft Studio
Note: If you are using the HTML Renderer Component this will not be needed since it is rendering an image.
Related
I'm trying to convert a rich text on a TRichEdit component to HTML tags.I have a function for that, but it doesn't work because the text in the component is always sent on PlainText. The option PlainText on the component is set as false.
Example: *Text in RichEdit: The house is blue. When I invoke the function is sent without the bold format in the text: RTFtoHTML(RichEdit.Lines.Text).
How can I do on the component or in other side to read this text like RTF?
I have read other questions and it didn't solve my problem. Thanks for your help.
There are a few 3rd party commercial components that do this quite well such as WPTools or TRichView. Both will attempt to optimize the generated HTML using CSS styles where applicable. Both support Delphi 2010, as well as the latest version of the compiler (Delphi Seattle as of this answer).
I created a pdf template with open office draw. it has textboxes and I can set values with acrofield. But I can't import a html content to template.
I can convert html contents to pdf file; but for template, how can I do it?
My problem is with template; also my html content have to map on page, for example center of page.
Thanks
I am not quite sure if I understand your question, but it seems like you need some kind of template where you will enter your content.
My thinking goes to OpenXML as the best fit. But since it is rather complex you can save some time by using third party tools.
From my experience, Docentric gives you good value for the money. You can prepare a template in Word and then merge it with data from any source that can fit into .NET object. Your document can be converted to pdf or xps if required.
Templates are generated in MS Word (2007 or newer) using special Docentric Add-in for template generation. All MS Word formatting can be applied here. Placeholders for data are set where the data will appear at runtime.
The process is straight forward so even end users can design reports. Developers then focus on bringing data in from various sources (database, XML). Chech the product documentation for ideas how to use it.
I have a html page having some static text as well as some controls like dropdownlist and textbox etc along with a button e.g., "Download as pdf".I need to generate a pdf file using angularjs taking the selected value of dropdownlist and value of textbox etc alongwith static content.
The page also uses some external fonts in addition to custom CSS. I need all these in my pdf.
Is it possible in jsPDF?
I tried using fromHTML():- but it only prints the text of text nodes only.
Then I tried using some built-in functions like setFont(), setFontType() etc. I also tried addFont(), but I couldn't figure out what to be passed in font style.
I even tried adding my font in the standardFonts array of addFonts() function in jsPDF library and install my external font in the system(windows folder/fonts). But it's not working.
As jsPDf has some limited designing features only, it is not meeting my requirements.
Is there any other strong tool which I can use?
I have a MVC3 web project that I am trying to display text from an xml doc in the form area of one of my views.
I would like the xml to be displayed with color coding and pretty print indenting like the xml text that is displayed when you open an xml file using IE.
Currenty I am using the #Html.Display("xmlfiletext").
The text is displayed as mono color with no new lines or carriage returns.
There are lots of syntax highlighting plugins that allow you to achieve that. Google prettify is just one example.
I'm trying to edit phpbb HTML template file with Eclipse Ganymedes version 3.4.1 containing Web Developer Tools.
These template files contain HTML markup with template variable marks in form {variable_name}. Now, when trying to open such file, Eclipse trys to validate also these template variable marks.
For example template contains
<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
After opening Eclipse shows on editor body:
Unsupported Character Body
Character encoding "{S_CONTENT_ENCODING}" is not supported by this platform.
<button>Set encoding...</button>
How to solve this using WTP or is there any better editor for template editing purpose ?
Eclipse is trying to determine the text encoding from your meta tags and fails.
To override this behavior open the file in eclipse so you can see the error. Open the File menu and choose Properties (Alt-Enter) and eclipse will show you the properties dialog for the file where you can change the text file encoding.
I don't know if this can be disabled for all the files.
I've never used Eclipse on Linux, but it looks like the problem isn't really about Eclipse supporting variables -- it's about it trying to render what a character set that it thinks is called "{S_CONTENT_ENCODING}"
You can probably get around the problem by changing {S_CONTENT_ENCODING} to utf-8 (or latin-1 or whatever) in all of your templates. (This assumes that you aren't changing encoding from one template to the next, but I really doubt you are.)
Copy-paste utf-8 where you see {S_CONTENT_ENCODING} in one of the templates, and Eclipse should handle it the other {foo} instances from there.