Line separator using com.lowagie.text.pdf - itext

I'm trying to insert a line separator - horizontal line. Currently I am using iText 2.1.7 or older (com.lowagie.text.pdf) to generate my PDF file.
There is no option available for line separator in document.add() as like in a more recent version of iText.
We have a LineSeparator object only in com.itextpdf.text.pdf.draw.DottedLineSeparator (iText 5 or newer).
Since most of my applications are using iText 2.1.7 or older, I don't want to switch them to iText 5 or newer.
Is there any option in com.lowagie.text.pdf for line separator?

Related

unwanted indent after line wrap

I'm converting some worddocuments (docx) with docx4j 6.1.2 and docx4j-export-fo 8.1.2 (apache FOP 2.3) to PDF with Java 11 like this:
// Load File
var wordMLPackage = WordprocessingMLPackage.load(wordDocument.getInputStream());
// Convert to PDF
var out = new FastByteArrayOutputStream();
Docx4J.toPDF(wordMLPackage, out);
return new ByteArrayResource(out.toByteArray());
In all paragraphs in the generated PDF there is a formatting issue I can't get a grip on. The following image shows a section from the docx in word.
The next image shows the section from the pdf file.
Each wrapped line starts with some extra indent on the left side.
Long lines are not wrapped.
Any ideas?
Edit 1:
The docx File is here: https://filebin.net/cux9s1p5ufm1vgul.
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-export-fo</artifactId>
<version>6.1.0</version>
</dependency>
works ok.
It seems the problem is white-space-collapse="false" white-space-treatment="preserve" introduced by https://github.com/plutext/docx4j-export-FO/commit/4451111aa02a698ed54788299513f7eac74bd996#diff-eeb9c00a64479f4ff29769e29a6a0cd7R455

How will Perl 6 handle the new combining emoji length?

Some emoji now combine. For instance, U+1f441 (👁) U+200d (ZWJ) U+1f5e8 (🗨) combine to make 👁‍🗨 (I am a witness). Rakudo 2016.07.1 on MoarVM 2016.07 says there are two graphemes:
> "\x[1f441]\x[200d]\x[1f5e8]".chars
2
I think that should be 1. It seems to have a similar problem with
> "\x[1f441]\x[fe0f]\x[200d]\x[1f5e8]\x[fe0f]".chars
2
But at least it handles U+fe0f (VS-16, emoji representation) correctly.
Are there plans to fix this in a later version of Perl 6 or am I misunderstanding the intent of the chars method?
The ZWJ sequence you mentioned is only part of Unicode Emoji 4.0 which is still in draft status and planned for release in November 2016. Under this new version, U+1F5E8 has the Grapheme_Cluster_Break property E_Base_GAZ (EBG), so the sequence should indeed form a single grapheme cluster.
I'm sure that Perl 6 will catch up at some point.

Install4j autoupdate version comparision

Can you please say how version compare works for UpdateCheck? How Checker determines that version in updates.xml is newer than his version?
For example, my versioning is using formula YEAR/MAJOR.MINOR: 2015/1, 2015/1.1, 2015/1.2, 2015/2, 2016/1 and so on. But I also have specific releases as 2015/1.2-LOK15. How these version numbers will be compared during version check?
Thank you in advance.
install4j transforms the version string into an array of version components. The separators for creating numeric version components are ".", "-" and "_". Each version component has an optional leading text part and a trailing numeric part. The text parts are compared lexically, the version parts are compared numerically.
Version components that start with non-numeric characters, like "LOK15" are generally considered to be pre-cursor versions to the same version component without the text part (like "beta" or "RC"). So 2015/1.2-LOK15 is considered to be lower than 2015/1.2. However 2015/1.2-15LOK would be higher than 2015/1.2.

Apache PDFBox 1.6.0 TextStripper not able to recognise characters having "Frutiger LT - 45" fonts

When I tried to extract contents from PDFs, I am successfully able to extract all text with PDFBox API but getting trouble with fonts having 'Frutiger' style. For these I am getting squared Boxes in place of characters.
It seems PDFBox FontBox supports only 14 UTF characters set, see link. And none of them is Frutiger style fonts. Is this a BUG with PDFBox or I am missing something here?

iReport + UTF-8

I have some utf-8 characters in jasperreports template. In iReport editor everything fine.
But after compiling the output PDf can not draw the valid unicode characters and draws ? instead.
How can I fix it?
Thank you
In order to enable unicode support in output PDF file you have to:
Add jasperreports-fonts-x.x.x.jar to project's classpath
In iReport select external font for textboxes and static text elements. Usually, it is DejaVu fonts
This is solution for latest versions of JasperReports (tested on 4.5.0)
if you have problems displaying UTF-8 characters in the pdf, no need to do anything! Just change the font of the cells in the table from sanserif to Dejavu sans. thats it.