Docx4j DrawingML and VML (docx to PDF) - pdf

I am a bit new to Docx4j and "wordML".
I want to convert this docx to a pdf :
But my research showed me that drawingML and VML wasn't supported, at least yet.
like : http://www.docx4java.org/forums/pdf-output-f27/drawingml-vml-to-pdf-t949.html
Is it true ? Is there a way out of this problem with Docx4j or should I think of using another technology ?
Thanks in advance !

Generally speaking, docx4j’s PDF output is suitable for documents which contain paragraphs, tables and images. It can’t handle more exotic features, such as equations, SmartArt, or WordArt (DrawingML or VML).
source : http://www.docx4java.org/svn/docx4j/trunk/docx4j/docs/Docx4j_GettingStarted.pdf
I used the openoffice api : https://angelozerr.wordpress.com/2012/12/06/how-to-convert-docxodt-to-pdfhtml-with-java/
For who it may concern !!!

Related

Gujarati fonts not displaying in PDF properly using itext 5.5.5 and xmlworker 5.5.5

I am using arial .ttf file. I have tried different font file for gujarati such as lohit, padmaa, shruti but it not displaying properly. The characters are not getting substituted properly.
In PDF it displays as :
અરથ પરજ ડરમ વૈભવ સવગે
Originally it should display as:
અર્થ પ્રજા ડ્રમ વૈભવ સ્વર્ગે
I have tried using GlyphSubstitutionTableReader but its not working for me.
Please guide me. Thanks in advance.
iText 5 currently doesn't support any Brahmic scripts. The reason is that these require an implementation of a specific font table called GSUB, which simply isn't there yet. There is no way to get this to display correctly with iText 5.5.5, but anyone is welcome to try and implement it.

Exporting map from TileMill to PDF/SVG

I have such a big problem with exporting and importing map from TileMill to Illustrator/Inkscape. The problem is with strokes of labels / names.
It seems that TileMill export each letter of label as a separate expanded path–object and doing an outline of that. The result is very bad. Take a look: http://cl.ly/image/0Z2o2v3v2r2C
Do you have any ideas how to fix it? Or maybe there is a solution to create a working text path in Illustrator from that kind of object?
This is unfortunately an upstream bug in Mapnik, and upstream from there in the raw SVG rendering libraries it uses.

Which xsl-fo elements can be the destination of a fo:basic-link with internal-destination?

I have a document in docbook format. I used to generate HTML from this. Now I tried to generate xsl-fo and then use Apache fop to build a pdf. However fop emitted several warnings about missing link destinations and they don't work in the produced pdf. These links works fine with HTML output. I can see that the missing id:s are actually present in the xsl-fo. It seems like some links works, for example those with a docbook section element as destination. However those which points to a docbook table row element doesn't work.
Is this a docbook bug? Or are there limitations in xsl-fo on which elements might be link destinations? A fop bug? Or actually a limitation in the pdf format itself?
Embarrasing that I didn't found it before. It's a known fop bug, fop-2110.

Special characters in iText

I need help in using these symbols ⎕, ∨, ๐, Ʌ, and so on. But when I create a PDF with iText these symbols do not appear.
What can I do so that these symbols appear?
You have to use a font and encoding that contains those characters. Your best bet is to use IDENTITY_H for your encoding, as this grants you access to every character within a given font... but you still have to use the right font.
There are several font-manipulation examples within "iText in Action's" chapter on fonts:
http://www.itextpdf.com/book/chapter.php?id=11
The examples are down the right side. Buying the book would probably help too.
I had the same problem too and I figured out using IDENTITY_H for encoding is working fine.
For example:
java.awt.Font f =...;
Font font = FontFactory.getFont(f.getName(),BaseFont.IDENTITY_H)
I don't understand why with BaseFont.WINANSI it doesn't work. Winansi is the standard Windows Cp1252 character set, that one used by my JVM. So, if the char is correctly displayed in Java, why it is not the case for PDF?
You can escape them according to the unicode escape sequence defined in the java language specification. See http://java.sun.com/docs/books/jls/first_edition/html/3.doc.html
If you are using IntelliJ IDEA for your code you can download the StringManipulation plugin, that does the escapes for you. In the settings of IDEA you can also set the "Transparent native-to-ascii conversion" checkbox under File encodings, and this should help do the trick.
square in pdf file by iText:
BaseFont bf = BaseFont.createFont("c:/windows/fonts/arialbd.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
question.add(new Phrase("\u25A1", new Font(bf, 26)));
You can see a pdf file exemple here

iTextSharp Header Footer help

I am using iTextSharp to generate pdf in my .net application.
Now I want to add Header and Footer in my pdf document.
I got code from a site something like given below but it doesn't work.
[
//we Add a Header that will show up on PAGE 1
HeaderFooter header = new HeaderFooter(new Phrase("This is a header"), false);
document.Header = header;
]
I create document object like:-
Dim document As text.Document = New text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25)
But it doesn't have property of Header as mention in the above code.
Can anyone suggest me how to do it.
Unfortunately I cannot help you regarding your iTextSharp issue as we have stopped using it when we found out, that it cannot automatically break the content for multi-page PDFs, and it forces the programmer to hardcode critical values leading to bad coding.
In the same time, if it's not a problem to change the PDF generator library for your project then you may check out PDFSharp and Migradoc which we're using succesfully for over 1 year now. Much simpler to integrate then iTextSharp, requires less code, it has great charting tools, a much more intuitive object oriented model and the best part is that it has a great documentation with a dozen of working example projects.
Happy coding!