On 05.06.2008 11:24:12 Lea Thurman wrote: > > Jeremais, > > Thanks. It works when running against FOP 0.95-beta(Batik 1.7). I was > running against FOP-0.94(batik 1.6) originally. (I put 0.95 in error in the > original post). Sorry. > > I am hijacking the thread a little but I am surprised by the size of the > resulting PDF. Its seems that each font I reference or embed akes up about > 300K per page in the resulting PDF file. A 2 page PDF with 2 referenced > fonts generates a 1.1MB PDF, without fonts it is 84K. > > Does this seem normal to you? I suspect that because I am using FOP to to > render a number of SVG documents generated by batik and each SVG document > has the same referenced fonts then the PDF transcoder is duplicating the > fonts for each page.
Not duplicating the fonts. Rather rendering all text as shapes. We don't have support for Type 3 fonts, yet, which could be used for SVG fonts. So the PDF size is completely expected. > Does this sound correct? It seems regardless of whether I reference or embed > the font in the SVG multiple fonts of the same type are embedded in the PDF. In both cases they are SVG fonts, the way you do it. If you just remove the font-face elements from the SVGs I expect improvements of PDF sizes. > I am going to see what happens if I specify the fonts in FOP and see if the > file size is reduced. That's exactly what you should do instead of using SVG fonts. If you use FOP 0.95beta special font configuration should actually be unnecessary (except for an "<auto-detect/>" in the FOP configuration if you transform FO+SVG rather than SVG). This way, the fonts get embedded natively which should reduce PDF size and add copy/paste support for all but the most complex SVG text. > Failing this we are going to try and remove FOP from the equation and amend > batik to support multiple pages via the nextPage() method. Difficult as the PDF output support for Batik is still part of FOP. ;-) But I know what you mean. I think both approaches should work. Only the configuration is different because two different APIs are used. Good luck! > As always any pointers would be much appreciated. > > Regards > Lea. > > > Jeremias Maerki-2 wrote: > > > > Sorry for the delay. I seemed to have missed this. > > > > My suspicion is that the "No ImagePreloader found" is only a follow-up > > error of an error thrown when parsing the SVG. Are there no other error > > messages before the above error in the log? Lea, would you send me your > > SVG font file you referenced in your testfile below so I don't have to > > spend too much time trying to set up the same testcase? I'm not too > > familiar with SVG fonts. I will then try to reproduce the problem ASAP > > so I can provide better feedback. Otherwise, please try to set this up > > for debugging and try to figure out by > > org.apache.fop.image.loader.batik.PreloaderSVG fails to recognize your > > SVG as a valid SVG file. > > > > On 02.06.2008 18:04:40 Lea Thurman wrote: > >> > >> Hi, > >> > >> I am using batik 1.7 to render an SVG document. I then create a FOP > >> document > >> and reference the generated SVG which is then converted into PDF using > >> FOP > >> 0.95beta. The FOP document is below (but I suspect not the issue): > >> > >> <?xml version="1.0" encoding="utf-8"?> > >> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" > >> xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"> > >> <fo:layout-master-set> > >> <fo:simple-page-master master-name="A4-portrait" > >> page-height="29.7cm" page-width="21.0cm" margin="2cm"> > >> <fo:region-body/> > >> </fo:simple-page-master> > >> </fo:layout-master-set> > >> <fox:external-document id="img1" > >> src="/Users/temp/project/page1.svg"/> > >> </fo:root> > >> > >> Everything has been working well until I attempted to reference an > >> external > >> font in the SVG file. > >> > >> I get a 'No ImagePreloader found" error when I reference the SVG document > >> below. The error seems to be as a result of the following SVG element > >> which > >> is referencing an external font file. I know the external font file is > >> good > >> since this can be converted successfully into PDF using the testcard > >> characters. The SVG file is below: > >> > >> <?xml version="1.0" standalone="yes"?> > >> <svg width="400px" height="300px" version="1.1" > >> xmlns='http://www.w3.org/2000/svg'> > >> <defs> > >> <font-face font-family="Swiss721NarrowSWA"> > >> <font-face-src> > >> <font-face-uri > >> xlink:href="file:///Users/temp/project/myfont.svg#Font1"/> > >> </font-face-src> > >> </font-face> > >> </defs> > >> <g style="font-family: Swiss721NarrowSWA; font-size:18;fill:black"> > >> <text x="20" y="120">@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_</text> > >> </g> > >> </svg> > >> > >> Everything works as expected if I embed the font into the SVG document > >> rather than referencing it. > >> > >> I am not sure if it is something I have done with Batik or it is a FOP > >> error > >> so I decided to post here first. Apologies if this is clearly a FOP > >> problem > >> however FOP is able to handle to conversion with an embedded font so > >> maybe I > >> have referenced the font incorrectly in SVG. > >> > >> Any help would be much appreciated. > >> > >> Regards > >> Lea. > >> -- > >> View this message in context: > >> http://www.nabble.com/%22No-ImagePreloader-found%22-when-attempting-to-reference-external-font-tp17604859p17604859.html > >> Sent from the Batik - Users mailing list archive at Nabble.com. > >> > > > > > > > > Jeremias Maerki > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/%22No-ImagePreloader-found%22-when-attempting-to-reference-external-font-tp17604859p17665735.html > Sent from the Batik - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
