Bruno Lowagie wrote: > Geertjan Wielenga wrote: > > >> Another question: how can I maintain the original coloring of the >> document that I turn into PDF? If I have a class, for example, with >> different color for different syntax, it all becomes black. >> >> > I assume you are Geertjan, the developer of the NetBeans module > that converts Java source code to PDF.
Yes I am. Here's the latest enhancement to the module: http://blogs.sun.com/roller/page/geertjan?entry=preview_functionality_for_itext_integration > What principle do you use? > If you put the flat source code file inside a Paragraph and add this > paragraph to a document object, it is evident that the syntax will not > be colored: it's just plain text; if you open it in Notepad, it won't be > colored either. > However, I suppose that NetBeans parses the source file and writes > everything to a Graphics2D object in different colors. I don't know > if it's possible, but if you could redirect this to an iText PdfGraphics2D > object, you could let NetBeans do the coloring... > Otherwise, there is no other way than to parse the source code files > yourself and apply the colors yourself. > Thanks for the idea. I'll investigate. Geertjan > br, > Bruno > > > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
