Arial Font Required in PDF (Birt PDF Renderer, Linux)

Export a Birt report at run time to a PDF file

The Java wrapper service is what I would recommend. You can use the RunAndRenderTask then instead of separate RunTask and RenderTask.

Or you can use the Web Viewer Servlet and retrieve the PDF output as the HTTP response.

Anyway, it is the wrong approach if you try to call any of these tasks from Javascript inside the report itself.

See https://wiki.eclipse.org/Integration_Examples_(BIRT) for an examples of the Java API and https://www.eclipse.org/birt/documentation/integrating/viewer-usage.php for the viewer (you'll want to use /run in your URL).

Birt 4.4.1 : Export to pdf does not display an image

Based on the response of "JFreeman" I think what I want is not currently possible because the image I want to display is encapsulated within the HTML tags,

The reason the image does not display in PDF is due to being in an HTML text element using HTML to convert the base64 into the image. This HTML code will be executed client side within the browser and does not occur when the report is exported to PDF which is generated server side.

but I managed to get around this by using the following method:

  • I created a java process that extracts the code64 image encapsulated
    within HTML tags, I run the physical creation of the image, and I
    store it in a previously created folder in my server .
  • This treatment java provided me complete URL of the picture created
    this url will be stored in a new table called "illustration"
  • I replace the code64 from the image with the text (see illustration NamedOrnumber541 in the appendix section), the new channel created will be stored in a new column, and the content of the new column will appear in the edition birt .
  • At the end of the generated report, I display all images related to the edition launched with components "Image" parameterized "Image file in shared resources," and the URL of the image to display is stored on in the illustration table as previously reported.
  • And by the end, in my database, I have two columns, the first contains the base64 encoded image encapsulated within HTML tags (content TextEditor) and the second column will contain the same content the first column except that instead of having the code64 image I have just indicating that the image to see is in the last part of the report (Annex) that displays images already generated by my java treatment.

it is true that this algorithm is a bit complex (I will do a small project that will contain all the treatment / control done once I have time) but the key is how to convince the customer that this solution is desirable for clear visibility of the text entered by users and not be bothered by the pictures :-).

BIRT reports not show Unicode characters on Linux

The problem was, that we used sans-serif font on the reports. Fixed it changing font to Arial.

Is there a common font format for Jasper on linux and windows to produce pdf?

Java defines the following five logical font families:

  • Dialog
  • DialogInput
  • Monospaced
  • Serif
  • SansSerif

This means that these fonts are always available in java runtime, however they are not actual font libraries but mapped by java to some font installed on system. Hence using any of these font will not cause any error in java.

However, you are exporting to pdf that instead have what is called Standard Type 1 fonts as you can see there is no match and iText (the lib creating the pdf) will use if not defined the default font Helvetica.

The conclusion is that while using a logical font, which would not throw an errors this could lead to report inconsistency in pdf (using another font).

The solution in jasper-reports is to use font-extensions



Related Topics



Leave a reply



Submit