Sorry for not providing the version of FOP I was using, Jeremias. It was 0.20.5, but, I upgraded to the newest version of FOP in the CVS and used your code and it worked like a charm. I really appreciate your help. I would use text stroking, except the filesize difference is so huge. For example, the PDFs I was generating before with glyphs were 1.5MB, but these ones I am generating now with text elements instead of glyphs are 17KB. It seems crazy, but the difference is that big. The only thing that I can't get to tweak right is that the font sizes seem to be about 1-2 pts smaller when I transcode them into PDFs, and they are no longer bold. Do you know what might cause this? Anyway, thanks very much for your assistance, I was stuck on this problem for quite awhile. Shaun
-----Original Message-----
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Mon 4/12/2004 2:32 AM
To: [EMAIL PROTECTED]
Cc:
Subject: Re: Problems generating text in PDF files with PDFTranscoder
In order to get a "real quick" answer you'd have to provide the full set
of information, the FOP version you're using, for example. I assume
you're using FOP 0.20.5 because there the PDFTranscoder takes a special
parameter instead of the strokeSVG parameter in the config file to
configure painting of text. Your code example creates an Avalon
configuration object but that's only of use in the HEAD version of FOP
in CVS.
So, you've got two options:
1. Upgrade to FOP HEAD from CVS so you get the latest, most advanced PDF
Transcoder which determines automatically when it can paint text as text
and when it has to resort to painting text as shapes. It's not always
possible to paint text as text because there may be complex
circumstances like alinging text on a path which are not yet implemented
in either version of FOP.
2. Try the following code (modified from your example) to switch to text
painting:
File userConfigFile = new File("C:/userconfig.xml");
Options options = new Options();
options.loadUserconfiguration(userConfigFile);
AbstractFOPTranscoder transcoder = new
org.apache.fop.svg.PDFTranscoder();
transcoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, new
Boolean(false);
TranscoderInput input = new TranscoderInput(
new FileInputStream("C:/start.svg"));
TranscoderOutput output = new TranscoderOutput(baos);
transcoder.transcode(input, output);
Another comment: Having the text as shapes is not really a bad thing as
long as people have enabled "smooth line art" in Acrobat Reader in which
case you wouldn't see much of a difference. It only looks worse on
screen when the settings is disabled. Printing the PDF produces nice
results.
I hope that helps.
On 12.04.2004 02:51:59 Shaun Roach wrote:
> I am having trouble with getting the PDFTranscoder to output text
> instead of glyphs. I have tried just about everything, and I was
> wondering if anyone could help me out. For my latest try, I basically
> modified some code I found somewhere on the internet, it is below.
>
> Could someone inspect it really quickly and tell me what might be
wrong?
> I am not getting any errors, but the resulting PDF (It is a webbased
> program and I return the ByteArrayOutputStream PDF to the browser) has
> the text rendered as glyphs.
> Thanks for your time,
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
