Hi, I got the problem regarding the NoClassDefFoundErrors. The new jars weren't mentioned in my Manifest file. I was able to generate PDF's from my application using the PDF transcoder. However, they do not have the fonts embedded and hence are quite large.
I had a few questions regarding font embedding. 1. Can I use the same font metrics files(xml) with Batik that I used for FOP? 2. The SVG that I generate (using Corda PopChart) has fonts embedded within it. Say, I was using TradeGothic CondEighteen, it appears in my SVG as: <!ENTITY s2 "font-family:'CF TradeGothic CondEighteen';font-size:7;fill:#000000;pointer-events:none;"> (Note the 'CF ' prepended to the font name). The font definition is like: <defs> <font horiz-adv-x="1168"> <font-face font-family="CF TradeGothic CondEighteen" units-per-em="1024" panose-1="0 0 4 0 0 0 0 0 0 0" ascent="950" descent="-216"/> .......... </font> </defs> (Again, the font is named as 'CF TradeGothic CondEighteen'). Am I correct in saying that the 'CF ' part is supposed to be internal to the SVG file and not to be used outside it? The font in the metrics file is called 'TradeGothic CondEighteen' (which is what it should be). Now, if I were to use the PDFTranscoder to convert the SVG to PDF, do I need to replace all the 'CF TradeGothic CondEighteen' with 'TradeGothic CondEighteen'? Also, while converting from SVG to PDF, are the font definitions <defs><font ...>......</font></defs> taken into consideration? I mean, does PDFTranscoder use the font definition? (When I was using FOP to do this conversion, I used to form the FO file from the SVG file. In that, I used to keep only the SVG part and strip the definitions. I also used to replace the 'CF TradeGothic CondEighteen' with 'TradeGothic CondEighteen'. Do I need to the same/similar thing here?) I am attaching a typical SVG file that is generated by PopChart. Regards, Saptarshi. <<pieUnicodeSVG.svg>> > -----Original Message----- > From: Saptarshi Sen > Sent: Thursday, December 23, 2004 10:00 PM > To: '[EMAIL PROTECTED]' > Subject: RE: Handling multiple spaces > > This is getting increasingly away from FOP and closer to > Batik.....nevertheless, I am continuing along this thread to get some more > inputs. > > I have added all the jar's under batik's lib folder into my project as well > as my Weblogic domain (where other libraries are placed). > > However, when I try to run the application I get a > java.lang.NoClassDefFoundError: > org/apache/batik/transcoder/TranscoderException. Is there anything that I > am missing. (I found a similar query by another person who was using > Tomcat. The reply simply asked him to include the jars under the web > container's lib directory). > > > In my case, I have all the jar's already in my Weblogic's application > folder. > > Thanks, > Saptarshi. > > -----Original Message----- > From: Jeremias Maerki [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 23, 2004 7:37 PM > To: [EMAIL PROTECTED] > Subject: Re: Handling multiple spaces > > > Uh, now it gets complicated.... > > On 23.12.2004 14:32:56 Saptarshi Sen wrote: > > Hi, > > I got the desired output using Batik. I am now trying to integrate it > > into my application. > > > > Since Batik uses the PDFTranscoder class from FOP, what are the > > various jar's that I need to include in my project path. I understand > that I > > should remove the fop.jar (from version 0.20.5) from my project path. > Which > > are the jar's from batik 1.5.1 that I need to include. > > I think you need all JARs from the lib directory of the binary > distribution except batik-svggen.jar and batik-swing.jar. Not sure. I'd > have to do a trial-and-error. pdf-transcoder.jar contains all classes > needed by FOP's PDF Transcoder. > > > A few requirements in my application is that I'll be embedding custom > > fonts and using batik just for SVG to PDF conversion. > > Now for the tricky part. Font configuration for the new transcoder is > not documented, yet, and it's a bit different than in FOP 0.20.5 and may > even change again until the first release of the redesign code. > > Here's a snippet to create an Avalon Configuration Object with the font > configuration: > > import org.apache.avalon.framework.configuration.Configuration; > import > org.apache.avalon.framework.configuration.DefaultConfigurationBuilder; > import org.apache.avalon.framework.container.ContainerUtil; > > import org.apache.batik.transcoder.Transcoder; > import org.apache.batik.transcoder.TranscoderException; > import org.apache.batik.transcoder.TranscoderInput; > import org.apache.batik.transcoder.TranscoderOutput; > import org.apache.batik.transcoder.XMLAbstractTranscoder; > import org.apache.batik.transcoder.image.ImageTranscoder; > > [..] > > //Transcoder instantiation > Transcoder transcoder = transcoder = new > org.apache.fop.svg.PDFTranscoder(); > > [..] > > //Font configuration > DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); > Configuration cfg = cfgBuilder.buildFromFile(new > File("src/xml/pdf-transcoder-cfg.xml")); > ContainerUtil.configure(transcoder, cfg); > > [..] > > //Transcoder properties supported by the PDF Transcoder > int dpi = 300; > transcoder.addTranscodingHint(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, > > new Float((float)(25.4 / dpi))); > transcoder.addTranscodingHint(XMLAbstractTranscoder.KEY_XML_PARSER_VALIDATI > NG, Boolean.FALSE); > transcoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, > Boolean.FALSE); > > [..] > > //On with the normal transcoding process as documented in Batik... > > > > The XML file for the font configuration would look approximately like > this: > > <cfg> > <fonts> > <font metrics-url="file:C:/Dev/FOP/temp/fonts/FUTURAL.ttf.xml" > kerning="no" embed-url="file:C:/Dev/FOP/Temp/fonts/FUTURAL.ttf"> > <font-triplet name="Futura" style="normal" weight="200"/> > <font-triplet name="Futura" style="normal" weight="normal"/> > </font> > <font metrics-url="file:C:\Dev\FOP\temp\fonts\ARIAL.TTF.xml" > kerning="no" embed-url="file:C:/Dev/FOP/Temp/fonts/ARIAL.ttf"> > <font-triplet name="Arial" style="normal" weight="normal"/> > </font> > <font metrics-url="file:C:\Dev\FOP\temp\fonts\ARIALBD.TTF.xml" > kerning="no" embed-url="file:C:/Dev/FOP/Temp/fonts/ARIALBD.ttf"> > <font-triplet name="Arial" style="normal" weight="bold"/> > </font> > </fonts> > </cfg> > > > There's one potential problem, though: I don't know what version of the > PDF Transcoder is in the Batik 1.5.1 release. That part didn't get > released properly. It could be that the font configuration doesn't work, > but I hope so. > > > Jeremias Maerki > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
pieUnicodeSVG.svg
Description: pieUnicodeSVG.svg
----------------------------------------------------------------------------------------------------------------------------- Disclaimer ----------------------------------------------------------------------------------------------------------------------------- "This message(including attachment if any)is confidential and may be privileged.Before opening attachments please check them for viruses and defects.MindTree Consulting Private Limited (MindTree)will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside.If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission." -----------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]