Page 1 of 1

How do I impl. embedded fonts, two-up pages and newlines?

Posted: Mon Jan 15, 2007 7:10 pm
by abbendix
Hello, I ´ve just begin to make creating PDFs with Fop, nFop (C#) actually and have some problems I can´t resolve or find solutions on the internet!

1. How do I embedded extarnal fonts ine the C# code-behind?
2. How do I create two-up pages? I.e. have two pages on one page side-by-side. Is it possible in the xsl:fo?
3. How do I replace the input value for a newline (\n) into a PDF newline. I read somewhere that you can use the fo:block tag to simulate a newline but its not a good way I thing if you have a text with hundreds of \n!!!

pls, I there any experts out there:)


best regards
//Albin

Posted: Tue Jan 16, 2007 6:28 pm
by sorin_ristache
Hello,

You can embed external fonts in the result if the FO engine that you use supports that. FOP supports it and you can set this in the FOP configuration file.


Regards,
Sorin

Posted: Wed Jan 17, 2007 2:57 pm
by abbendix
Hello,
Yes I now FOP supports embedded fonts! But I can´t find a way to implement it in my application! I'm using C# and ApacheFop.Net.dll, i.e. Apache fop 0.93 version. I've googling aroud whole internet after samples but without result. Please help me to embed a external font.

--- code ---

org.apache.fop.fonts.apps.TTFReader font = new org.apache.fop.fonts.apps.TTFReader();
font.loadTTF(@"C:\WINNT\Fonts\myType.ttf","myType.ttf");
" how do I making this work?"

Driver driver = new Driver(source,output);
driver.setRenderer(Driver.RENDER_PDF);
driver.run();
output.close();

--- code ---


best regard
//Albin