Png output and transparent background
FOP Fans, I am (a beginning fop user) using fop with png output (tried both the trunk and 0.92 beta) and was wondering whether there is a possibility to set the page background to transparent. I tried background-color=transparent but that does not seem to work. Any guidance would be greatly appreciated, Thanks, Peter
Drop cap first letter...
I would like to know if anyone has gone around this kind of thing (the first letter of a chapter apearing as a huge size aligned to the top of the current line with all the text of the rest of the paragraph working around it)... Any suggestions on how to do it? My first idea was to use a list, with a huge character and a very strong sub percentage attached to it so it would drop down... Is there a better approach? Cheers... LF -- View this message in context: http://www.nabble.com/Drop-cap-first-letter...-tf2220007.html#a6149419 Sent from the FOP - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Drop cap first letter...
Hi Luis, I would like to know if anyone has gone around this kind of thing (the first letter of a chapter apearing as a huge size aligned to the top of the current line with all the text of the rest of the paragraph working around it)... Any suggestions on how to do it? XEP uses fo:floats for this task, maybe it works for FOP too. See [1]. Tom -- [1] http://xep.xattic.com/xep/testsuite/usecases/dropcap.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Png output and transparent background
Hello, I have the *impression* this is related to some code in org.apache.fop.render.java2d.Java2DRenderer#getPageImage, namely // draw page frame graphics.setColor(Color.white); graphics.fillRect(0, 0, pageWidth, pageHeight); graphics.setColor(Color.black); graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2); graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2); graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3); graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2); graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3); Depending on the use case having a white page background and black frame might be fine. In my case it is not what I want. Would this be considered a bug or a feature, and/or would it make sense to add some kind of option to either enable or disable this part of the code? Thanks, Peter From: Peter [mailto:[EMAIL PROTECTED]] Sent: dinsdag 5 september 2006 11:54 To: 'fop-users@xmlgraphics.apache.org' Subject: Png output and transparent background FOP Fans, I am (a beginning fop user) using fop with png output (tried both the trunk and 0.92 beta) and was wondering whether there is a possibility to set the page background to transparent. I tried background-color=transparent but that does not seem to work. Any guidance would be greatly appreciated, Thanks, Peter
Re: font not found in 0.92beta from ant
Hi, I am using FOP from trunk, but still the warning fop.fonts.FontInfo (FontInfo.java:260) - Font 'Frutiger,normal,400' not found. Substituting with 'any,normal,400'. My implementation fopFactory.setUserConfig(StringUtils.urlToString(userConfigUrl)); fopFactory.setFontBaseURL(StringUtils.urlToString(fontBaseUrl)); ua = fopFactory.newFOUserAgent(); //ua.setURIResolver(new FOURIResolver() { // public Source resolve(String href, String base) throws TransformerException { // File f=new File(base,href); // return new StreamSource(f); // } // }); if (baseUrl != null) { ua.setBaseURL(StringUtils.urlToString(baseUrl)); // Configuration.put(baseDir, StringUtils.urlToString(baseUrl)); } // //Configuration.dumpConfiguration(); ByteArrayOutputStream byteArrayOut = null; try { byteArrayOut = new ByteArrayOutputStream(); //driver.setOutputStream( byteArrayOut ); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, ua, byteArrayOut); // Setup JAXP using identity transformer TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); // identity transformer // Setup input stream Source src; if (xmlfoDoc != null) { src = new DOMSource( xmlfoDoc ); } else { //encode the euro character becuase the fop rderer doesn't support the iso euro-character String euroEncodedString = xmlfoString.replaceAll(String.valueOf((char)128),#x20AC;); src = new StreamSource( new StringInputStream(euroEncodedString)); } Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); Am i doing anything wrong ? Thanks, Naveen [Naveen Bandhu] On 25.05.2006 13:01:24 Johannes K?nsebeck wrote: Jeremias Maerki wrote: Yes, it looks like the Ant task wasn't looked after properly. I've reconnected the configuration in FOP Trunk: http://svn.apache.org/viewvc?rev=408707view=rev Hi Jeremias, thanks for looking after it. I now switched to write my own Java-app, which embeds fop. Could it be there is the same problem? No. In the Ant task the user configuration was not set on the FopFactory. In your own Java application you are responsible to set the user configuration on the FopFactory. I could not get it to work, till i wrote my own very stupid FOURIResolver : ^^ What's it? What's the error message or the symptom? foUserAgent.setURIResolver(new FOURIResolver() { public Source resolve(String href, String base) throws TransformerException { File f=new File(base,href); return new StreamSource(f); } }); Should really not be necessary. Before i tried a lot with : fopFactory.setFontBaseURL(...); foUserAgent.setBaseURL(...); How do I use them ? I tried file:/home/... or file:///home/... or without the protocol : /home/... ? but nothing worked (fonts/gfx). Sorry, I don't have the code to show the problem anymore. file:///home/... should have worked. Try absolute paths in the user configuration file instead of trying to set the base URLs in code. It could probably do with some extra attention. For example, doing XSLT and FOP in one step to improve performance and to avoid temporary files. Want to give it a shot? Patches are always welcome. Ok, I will try. Patches? Well, maybe one day when I'm grown up and a *real* Java-Coder ;) :-) snip/ On 22.05.2006 10:03:24 Johannes K?pnsebeck wrote: Hi, I have a project where I use ant to do some xslt and fop transformations. Everything worked well till i switched to fop 0.92b. Now my fonts aren't found. It works from commandline, too. Is the anttask broken? Ant log: snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Drop cap first letter...
My test case would be this one: ?xml version=1.0 encoding=ISO-8859-1? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; !-- layout information -- fo:layout-master-set fo:simple-page-master master-name=capa05 page-height=297mm page-width=210mm margin-top=18mm margin-bottom=18mm margin-left=17mm margin-right=17mm fo:region-body region-name=corpo margin-top=22mm margin-bottom=20mm margin-left=3mm margin-right=3mm display-align=center background-color=#F2F2FF/ fo:region-before precedence=true region-name=cabecalho extent=22mm background-color=#F2F2FF display-align=after/ fo:region-after precedence=true region-name=rodape extent=20mm background-color=#F2F2FF/ fo:region-start region-name=esquerda extent=3mm background-color=#F2F2FF/ fo:region-end region-name=direita extent=3mm background-color=#F2F2FF/ /fo:simple-page-master /fo:layout-master-set !-- end: defines page layout -- fo:page-sequence master-reference=capa05 fo:static-content flow-name=cabecalho fo:block/fo:block /fo:static-content fo:static-content flow-name=rodape fo:block/fo:block /fo:static-content fo:flow flow-name=corpo fo:block fo:list-block start-indent=5mm provisional-distance-between-starts=10mm fo:list-item fo:list-item-label end-indent=label-end() fo:block font-size=30 baseline-shift=-150%A/fo:block /fo:list-item-label fo:list-item-body start-indent=body-start() fo:blockgora isto vai fundionarsd sdf dasfas fdas fadf ads f ads f ds f asdf das fdasfdasf dasfasdf ddasfasdf dasfdasf sdafdasfdas fasdfdas fdasfdas fdasfdfad fdsafads asdfdasf dasfdasfdasfas dasfasf dasfdasf dasfas fasdfadsfads dasfadsfdas fdasfdasf asdfasdfa dsfadasf dasfadsf asd./fo:block /fo:list-item-body /fo:list-item /fo:list-block /fo:block fo:block fo:inline font-size=30A/fo:inlinegora isto vai fundionarsd sdf dasfas fdas fadf ads f ads f ds f asdf das fdasfdasf dasfasdf ddasfasdf dasfdasf sdafdasfdas fasdfdas fdasfdas fdasfdfad fdsafads asdfdasf dasfdasfdasfas dasfasf dasfdasf dasfas fasdfadsfads dasfadsfdas fdasfdasf asdfasdfa dsfadasf dasfadsf asd. /fo:block /fo:flow /fo:page-sequence /fo:root For now, if i dont specify in the list-item-body an indent, the content is overlaped as if the bullet A didn't existed. I'm not sure if this is the expected behavior from the spec... What i was supposing to happen would be that in the lines that where horizontally overlaped by the bullet, the content would be indented to the immediate character position. In the next lines, it would be not indented. Would the floats that Vincent talked about would do this? http://www.nabble.com/-Poll--Expectations-regarding-side-floats-tf2091037.html#a5763549 Cheers LF Pascal Sancho wrote: -Original Message- From: Thomas Schraitle [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 05, 2006 1:14 PM I would like to know if anyone has gone around this kind of thing (the first letter of a chapter apearing as a huge size aligned to the top of the current line with all the text of the rest of the paragraph working around it)... Any suggestions on how to do it? XEP uses fo:floats for this task, maybe it works for FOP too. See [1]. Hi, No, FOP doesn't support fo:float yet. I don't think there is any efficient workaround; good luck Pascal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Drop-cap-first-letter...-tf2220007.html#a6154651 Sent from the FOP - Users forum at Nabble.com.