cvs commit: xml-fop/src/org/apache/fop/layout AreaTree.java
keiron 02/05/22 23:27:14 Modified:src/org/apache/fop/apps StreamRenderer.java src/org/apache/fop/extensions Bookmarks.java src/org/apache/fop/fo FObj.java FObjMixed.java src/org/apache/fop/fo/flow BasicLink.java BidiOverride.java Block.java BlockContainer.java Character.java ExternalGraphic.java Flow.java InitialPropertySet.java Inline.java InlineContainer.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java ListItemBody.java ListItemLabel.java MultiCase.java MultiProperties.java MultiPropertySet.java MultiSwitch.java MultiToggle.java PageNumber.java PageNumberCitation.java Table.java TableAndCaption.java TableBody.java TableCaption.java TableCell.java TableColumn.java TableRow.java src/org/apache/fop/fo/pagination PageSequence.java src/org/apache/fop/layout AreaTree.java Log: sets up the id independantly of the layout Revision ChangesPath 1.13 +8 -170xml-fop/src/org/apache/fop/apps/StreamRenderer.java Index: StreamRenderer.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StreamRenderer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- StreamRenderer.java 17 May 2002 14:47:12 - 1.12 +++ StreamRenderer.java 23 May 2002 06:27:12 - 1.13 @@ -2,8 +2,7 @@ import java.io.OutputStream; import java.io.IOException; -import java.util.Vector; -import java.util.Enumeration; +import java.util.HashSet; import org.xml.sax.SAXException; @@ -12,8 +11,6 @@ import org.apache.fop.area.AreaTree; import org.apache.fop.area.Title; import org.apache.fop.render.Renderer; -import org.apache.fop.datatypes.IDReferences; -import org.apache.fop.extensions.ExtensionObj; import org.apache.fop.fo.pagination.PageSequence; import org.apache.avalon.framework.logger.Logger; @@ -72,21 +69,10 @@ private FontInfo fontInfo = new FontInfo(); /** - The list of pages waiting to be renderered. + The current set of id's in the FO tree + This is used so we know if the FO tree contains duplicates */ -private Vector renderQueue = new Vector(); - -/** - The current set of IDReferences, passed to the - areatrees and pages. This is used by the AreaTree - as a single map of all IDs. -*/ -private IDReferences idReferences = new IDReferences(); - -/** - * The list of extensions. - */ -private Vector extensions = new Vector(); +private HashSet idReferences = new HashSet(); private Logger log; @@ -109,12 +95,12 @@ log = logger; } -public IDReferences getIDReferences() { +public HashSet getIDReferences() { return idReferences; } -public void addExtension(ExtensionObj ext) { -extensions.addElement(ext); +public AreaTree getAreaTree() { +return areaTree; } public void startRenderer() @@ -189,10 +175,6 @@ throws FOPException { //areaTree.setFontInfo(fontInfo); -// for(Enumeration e = extensions.elements(); e.hasMoreElements(); ) { -// ExtensionObj ext = (ExtensionObj)e.nextElement(); -// ext.format(areaTree); -// } pageSequence.format(areaTree); } @@ -219,149 +201,5 @@ public FontInfo getFontInfo() { return this.fontInfo; } - -// COMMENT OUT OLD PAGE MANAGEMENT CODE -// public synchronized void queuePage(Page page) -// throws FOPException, IOException { -// /* -// Try to optimise on the common case that there are -// no pages pending and that all ID references are -// valid on the current pages. This short-cuts the -// pipeline and renders the area immediately. -// */ -// if ((renderQueue.size() == 0) idReferences.isEveryIdValid()) { -// //renderer.render(page, outputStream); -// } else { -// addToRenderQueue(page); -// } -// pageCount++; -// } - -// private synchronized void addToRenderQueue(Page page) -// throws FOPException, IOException { -// RenderQueueEntry entry = new RenderQueueEntry(page); -// renderQueue.addElement(entry); - -// /* -// The just-added entry could (possibly) resolve the -// waiting entries, so we try to process the queue -// now
Re: Latest version (f) of FO Schema
Peter B. West wrote: I suppose a lot depends on how tightly you want to try to constrain the XSL through the schema. There are many constraints which can only be tested by the processor. Do you mean constraints which are just impossible to express due to schema restrictions (cooccurence etc) or constraints which couldn't be tested on xsl-fo as xml document stage at all? -- Oleg Tkachenko Multiconn International, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: build changes
Keiron Liddle wrote: On Tue, 2002-05-21 at 05:46, Peter B. West wrote: Ladies and gentlemen, boys and girls, What's the state of play now with the changes to the build system? Has the elimination of Xalan1 been completed? Who's doing what there? I am planning to throw a branch off HEAD to tinker with at least the versioning information for the build. What exactly do you want to do with the versioning etc. Can you give us a rundown of what it will do and how? btw If you want to tinker with cvs you can do it all on your own machine. Keiron, The full range of what I want to do with versioning I am not sure of; the minimum I am sure of. I canvassed this a short time ago. That is, to eliminate the situation where the identification of a build depends on manual intervention in the build.xml file which may or may not match a tag in the CVS tree, which may or may not correspond to the full set of files in the release. I am astonished that this situation is tolerated, although I should not be astonished to be told that it is the general condition of Ant-based builds. The first thing is to get the version information returned by the Version class to match a tag. That's easy. Include $Name$ and $Header$ in Version.java as, say, private static final String fields, and include getTag() and getHeader() methods which simply return those values. Modify getVersion() to manipulate the $Name$ tag value, expressed according to the convention which I have also canvassed, without response, here earlier. If there is no $Name$ value, a default version string, something like FOP.Development (a string which could not be generated from a legitimate tag) would be returned. That, obviously, is fairly easy to do. Trickier problems include: Reporting the new getVersion() string during the build. Done fairly easily by an Ant task which simply emits the derived string to the normal verbiosity stream. Should probably involve similar labelling procedures in Version.java and build.xml. Validating that the whole source tree corresponds to the tag in Version.java. This necessarily involves the inclusion of keywords in every source file of the build. Now there's a novel idea. Another task required, and it would be useful if I could get the canonical tag value back into the build somehow, as for example with backquotes in a shell-based unix build process. I don't know how to do this in Ant. I want to look at all of these things, but clearly not all before 0.20.4. Let me say a few words about the CVS tree. It's not a sacred site. It has branches in order, among other things, to enable isolated development. IMHO, all individual development should take place on personal branches, unless multiple developers are closely co-ordinating attacks on particular pieces of code. Make changes, find out what others are up to, merge into your own branch from the trunk as necessary, and when you're ready, notify everyone that you want to merge back to the trunk. Do that. Find, and resolve with the other developers any merge conflicts. Abandon the branch. Throw another one and move on. This tool allows such things to happen and protects everybody's investment, so let's take advantage of it. If a branch is abandoned without ever being integrated into a release, so what? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: build changes
Keiron Liddle wrote: On Wed, 2002-05-22 at 17:30, Peter B. West wrote: Are you *trying* to annoy me, or does it just happen? I don't want to jump to conclusions. Relax, I'm not trying to annoy you. Keiron, Thanks for that, and my apologies for the sharp tone. I have to confess that I was in a very short mood; the Maroons had just been thrashed. That's no excuse, of course. See my earlier response. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
DO NOT REPLY [Bug 9332] - Build fails due to J:\fop-0.20.3\build.xml:293: Could not read filters from file: J:\fop-0.20.3\build\src\codegen\filter
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9332. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9332 Build fails due to J:\fop-0.20.3\build.xml:293: Could not read filters from file: J:\fop-0.20.3\build\src\codegen\filter [EMAIL PROTECTED] changed: What|Removed |Added AssignedTo|[EMAIL PROTECTED] |christian.geisert@isu- ||gmbh.de --- Additional Comments From [EMAIL PROTECTED] 2002-05-23 12:17 --- This should be fixed in CVS (read: works for me, W2K/Java 1.4.0 (build 1.4.0-b92)) Just checkout the latest maintenance branch (cvs co -r fop-0_20_2-maintain xml-fop) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
diffs and new files for tempfile-based PDFStream support
Here's the output from `cvs diff` as well as the new files (how do I get a diff or patch equivalent for files that are new? I can't `cvs add` since I don't have write access, and it ignores non-cvs files) This patch: 1) adds a new class, org.apache.fop.util.StreamUtilities, that provides some buffered stream copying routines - InputStream to OutputStream. Adapted from my own IOLib, nice and fast and clean. Used by several of the new classes. 2) modifies the current behavior of PDFFilters to operate on streams instead of byte arrays. 3) changes the type of the ByteArrayOutputStream _data field of PDFStream to a new abstract class, StreamCache 4) Added two implementations of StreamCache, InMemoryStreamCache and TempFileStreamCache. The InMemory behaves much like the current FOP implementation, with a ByteArrayOutputStream. The TempFile implementation uses temp files. 5) a static factory method, PDFStream.createStreamCache(), creates the desired type. Another static method, PDFStream.setCacheToFile(boolean), sets which to use. Other StreamCache implementations are certainly possible; perhaps a smart one that only caches to file when a certain size is reached (StreamUtilities.BUFFER_SIZE perhaps). The problem with such a solution is death-of-a-thousand-paper-cuts - you may have quite a few small StreamCaches that end up killing scalability anyway. Note that I was not able to test these changes - the current cvs fop does not run and says so plainly. Is there some way I can run some basic sanity tests at least? I would like to do some memory audits (we own a seat of OptimizeIt) but need to be able to run some real-life examples. Thanks... -- Paul Reavis [EMAIL PROTECTED] Design Lead Partner Software, Inc.http://www.partnersoft.com ? src/org/apache/fop/pdf/InMemoryStreamCache.java ? src/org/apache/fop/pdf/StreamCache.java ? src/org/apache/fop/pdf/TempFileStreamCache.java ? src/org/apache/fop/util/StreamUtilities.java Index: src/org/apache/fop/pdf/ASCII85Filter.java === RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/pdf/ASCII85Filter.java,v retrieving revision 1.3 diff -c -r1.3 ASCII85Filter.java *** src/org/apache/fop/pdf/ASCII85Filter.java 30 Jul 2001 20:29:29 - 1.3 --- src/org/apache/fop/pdf/ASCII85Filter.java 23 May 2002 16:57:08 - *** *** 9,14 --- 9,15 import java.io.ByteArrayOutputStream; import java.io.IOException; + import java.io.*; public class ASCII85Filter extends PDFFilter { private static final char ASCII85_ZERO = 'z'; *** *** 30,38 return null; } ! public byte[] encode(byte[] data) { ! ! ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int i; int total = 0; --- 31,37 return null; } ! public void encode(InputStream in, OutputStream out, int length) throws IOException { int i; int total = 0; *** *** 40,55 // first encode the majority of the data // each 4 byte group becomes a 5 byte group ! for (i = 0; i + 3 data.length; i += 4) { ! long val = ((data[i] 24) 0xff00L) // note: must have the L at the ! + ((data[i + 1] 16) 0xffL)// end, otherwise you get into ! + ((data[i + 2] 8) 0xff00L)// weird signed value problems ! + (data[i + 3] 0xffL);// cause we're using a full 32 bits byte[] conv = convertWord(val); ! buffer.write(conv, 0, conv.length); } --- 39,54 // first encode the majority of the data // each 4 byte group becomes a 5 byte group ! for (i = 0; i + 3 length; i += 4) { ! long val = ((in.read() 24) 0xff00L) // note: must have the L at the ! + ((in.read() 16) 0xffL)// end, otherwise you get into ! + ((in.read() 8) 0xff00L)// weird signed value problems ! + (in.read() 0xffL);// cause we're using a full 32 bits byte[] conv = convertWord(val); ! out.write(conv, 0, conv.length); } *** *** 57,68 // with n leftover bytes, we append 0 bytes to make a full group of 4 // then convert like normal (except not applying the special zero rule) // and write out the first n+1 bytes from the result ! if (i data.length) { ! int n = data.length - i; byte[] lastdata = new byte[4]; for (int j = 0; j 4; j++) { if (j n) { ! lastdata[j] = data[i++]; } else { lastdata[j] = 0; } --- 56,67
Re: embedded FOP from Document to PDF
ok, here's what ya want to do. when you perform a xalan xslt transform, you can specify a SaxResult as the output object. When you instantiate the SaxResult object, you pass a ContentHandler object to the constructor. Ok, so the question is, what does this have to do with you. fop's transformation engine is sax driven. we are given access to the underlying transformation engine, a SAX ContentHandler by calling getContentHandler() on the Driver object. We then pass the return value to the SAXResult constructor. the nice thing about doing it this way, is that as xalan transforms the xsl, it fires SAX events right into fop. therefore, it's essentially generating fop's output (pdf for example) at the same time the xml is transformed in xsl:fo by an xslt stylesheet. the line of code from my app looks like this: ... transformer.transform( new DOMSource( doc ), new SAXResult( driver.getContentHandler() )); ... also, by doing this, you do not need to pass any document or inputsource or even call render(), because it all done once the transform finishes. lemme know if you need an example. -- David B. Bitton [EMAIL PROTECTED] www.codenoevil.com Code Made Fresh DailyT - Original Message - From: Juergen Lippold [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 4:22 AM Subject: embedded FOP from Document to PDF Hello, I have no Problems reading the XML and the XSL-file and directly generating the PDF-output. That works fine. But in my application I'm filling the XMl-file, writing it to the harddisk and then starting the FOP-conversion. It would be nice to start the conversion directly with the org.w3c.dom.Document in memory and the XSL-File from harddisk. Does someone knows if this is possible with FOP? Thanks for Help. Regards Juergen Lippold - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
forceloading batik svg
This is probably a question for the batik list, but I'm not on that at present so thought I'd ask here. What's the best way to get an SVG loaded so I can draw it to a buffered image? I basically want to load an SVG and turn it into a raster icon. I'm trying to use JSVGComponent but the loading is so multithreaded I can't figure it out at all. Just trying to listen does nothing - I wait forever for a loaded event. It seems similar to the annoying Java default image loading behavior where it incrementally loads images - great for web-like incremental drawing effects, but annoying if you just want to load an image, right now, no questions. I think it might be waiting on something - a paint() command or similar - to actually load - lazy loading, in other words. Here's my current craptastic code. It generates the following: Loading an SVG document as a Component. Loading document from file:/bag2/test/svg/arrowhead-blue.svg Waiting on SVG to load... Waiting on SVG to load... Waiting on SVG to load... Waiting on SVG to load... Waiting on SVG to load... ERROR Exception due to java.lang.NullPointerException: null java.lang.NullPointerException at org.apache.batik.swing.svg.JSVGComponent.getSVGDocumentSize(Unknown Source) at com.PartnerSoft.gui.SVGLib.createSVGComponent(SVGLib.java:52) at com.PartnerSoft.gui.SVGLib.createImageFromSVG(SVGLib.java:28) at com.PartnerSoft.gui.LocalImageFactory.getImage(LocalImageFactory.java private static JLabel scapegoat = new JLabel(B!!); public static Image createImageFromSVG(File svgFile) { try { Component component = createSVGComponent(svgFile); Image result = scapegoat.createImage(component.getWidth(), component.getHeight()); Graphics g = result.getGraphics(); component.paint(g); g.dispose(); return result; } catch (Exception oopsie) { SystemLog.singleton().error(oopsie); return GUILib.questionMark(); } } public static Component createSVGComponent(File svgFile) { try { SystemLog.singleton().enter(Loading an SVG document as a Component.); JSVGComponent component = new JSVGComponent(); component.setProgressivePaint(false); String url = file: + svgFile.getCanonicalPath(); SystemLog.singleton().enter(Loading document from + url); component.loadSVGDocument(url); SVGEar ear = new SVGEar(); component.addSVGDocumentLoaderListener(ear); while (component.getSVGDocument() == null || component.getSVGDocumentSize() == null || component.getSVGDocumentSize().getWidth() == 0 ) { SystemLog.singleton().enter(Waiting on SVG to load...); try {Thread.sleep(100);} catch (InterruptedException oopsie) {} } Dimension2D preferred = component.getSVGDocumentSize(); SystemLog.singleton().enter(SVG is + preferred); component.setSize((int)preferred.getWidth(), (int)preferred.getHeight()); return component; } catch (Exception oopsie) { SystemLog.singleton().error(oopsie); return new JLabel(AAIIEE!!); } } private static class SVGEar extends SVGDocumentLoaderAdapter { public boolean done = false; public void documentLoadingCompleted(SVGDocumentLoaderEvent evt) { done = true; } } I was adding that SVGEar as a loaderlistener to the component but it never got an event (done was always false). -- Paul Reavis [EMAIL PROTECTED] Design Lead Partner Software, Inc.http://www.partnersoft.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Running Prefligh PDF tools on PDF files produced by FOP
I'm using FOP to produce PDF eBook files targeted for Adobe eBook Reader. It produces beautiful output, with internal links for the contents etc. These files can be viewed in both Acrobat and the eBook Reader without error. However, most eBook distributors place requirements upon submitted files and make checks with various preflight packages. PitStop by Enfocus (http://www.enfocus.com/products/overview.php?nr=3) is one of the most common tools used for this purpose. I am finding that for all PDFs produced by FOP (including those from the sample FO files) PitStop stops and complains of a 'Fatal PDF Error' on the first page. It does not provide anymore information than this. I am not experiencing the same errors with PDF files produced by XEP or Antenna. I realize that this query may be more appropriately targeted to Enfocus. However, any insights or help would be much appreciated. Regards Matt O'Donnell Publishing Dimensions - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Running Prefligh PDF tools on PDF files produced by FOP
I have run into the exact same problem. I have personally tried Pitstop and had the same error occur. Other people that have several industrial strength preflight tools said that the PDFs I made out of FOP crashed all their programs. The only preflight program I can get to read the PDF is Flightcheck. Plus, certain versions of Photoshop(5.0) and Illustrator(8,9) also do not like the file format, while Acrobat Reader reads them fine. This is a problem that I too would like to see solved. Matt Johnston Manager of Internet Content American Profile, http://www.americanprofile.com 341 Cool Springs Blvd., Ste. 400 Franklin, TN 37067 p: 615-468-6053 f: 615-468-6153 -Original Message- From: Matthew Brook O'Donnell [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 3:32 PM To: [EMAIL PROTECTED] Subject: Running Prefligh PDF tools on PDF files produced by FOP I'm using FOP to produce PDF eBook files targeted for Adobe eBook Reader. It produces beautiful output, with internal links for the contents etc. These files can be viewed in both Acrobat and the eBook Reader without error. However, most eBook distributors place requirements upon submitted files and make checks with various preflight packages. PitStop by Enfocus (http://www.enfocus.com/products/overview.php?nr=3) is one of the most common tools used for this purpose. I am finding that for all PDFs produced by FOP (including those from the sample FO files) PitStop stops and complains of a 'Fatal PDF Error' on the first page. It does not provide anymore information than this. I am not experiencing the same errors with PDF files produced by XEP or Antenna. I realize that this query may be more appropriately targeted to Enfocus. However, any insights or help would be much appreciated. Regards Matt O'Donnell Publishing Dimensions - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Sorry that I am askin here, but I couldn't find solution over the net. Please help.
Hi All. Question about my template. I am trying to create a new page for each customerrecord. And I am getting an exception that flow mast have child block. Please help me a little or point me somewhere on the web to get it working. fo:layout-master-set fo:simple-page-master master-name=engl1 /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=engl1 fo:flow flow-name=xsl-region-body xsl:apply-templates/ /fo:flow /fo:page-sequence xsl:template match=customer/record/ /xsl:template Actually I have xml file with this kind og structure: cutomer record titlea/title /record record titleb/title /record /customer Sincerely yours, Ivan Latysh. [EMAIL PROTECTED] http://ivan.yourmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Running Prefligh PDF tools on PDF files produced by FOP
Matt, Matthew, Maybe you could try generating the most minimal possible PDF file which still crashes the preflight programs. Use the same fo: source file in XEP and Antenna and compare the output. Send these PDF files to Enfocus ior Adobe for comment. If someone there can tell us exactly what constructs are causing the problem, we will have a target. Peter Matt Johnston wrote: I have run into the exact same problem. I have personally tried Pitstop and had the same error occur. Other people that have several industrial strength preflight tools said that the PDFs I made out of FOP crashed all their programs. The only preflight program I can get to read the PDF is Flightcheck. Plus, certain versions of Photoshop(5.0) and Illustrator(8,9) also do not like the file format, while Acrobat Reader reads them fine. This is a problem that I too would like to see solved. -Original Message- From: Matthew Brook O'Donnell [mailto:[EMAIL PROTECTED]] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
DO NOT REPLY [Bug 9335] - fo:basic-link generates multiple linked rectangles in PDF
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9335. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9335 fo:basic-link generates multiple linked rectangles in PDF [EMAIL PROTECTED] changed: What|Removed |Added Severity|Normal |Minor --- Additional Comments From [EMAIL PROTECTED] 2002-05-24 02:23 --- Workaround found: use -Dlinks.merge=yes on the command line. Severity of bug downgraded to Minor. Current behaviour is still incorrect. Default value for links.merge system property should be yes, not no. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]