RE: MalformedURLException when using relative paths

2008-05-21 Thread Ted Young
I know it works with FOP .94 since I am doing exactly this right now.  :-)

Ted

-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 21, 2008 3:11 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: MalformedURLException when using relative paths

Ted Young wrote:
 Yes, it supports relative, but relative URLs not relative file paths.  So,
 what you want it:
 file:pdf_test

Everything starting with file: (or anything else which looks like
an URI scheme) is by specification an absolute URL. The string
file:pdf_test is not a valid URL at all, although some libraries
will try to interpret it the way you do. I'm not sure whether FOP
does it, and I'm too tired to check the URI resolver class right
now.

J.Pietschmann


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Making a Large Dictionary

2008-05-18 Thread Ted Young
Greetings to the list,

 

I am using FOP version 0 .94 under Java 1.6 update 6.

 

I am using FOP to create a PDF dictionary from a source XML file.  There are
only 12,000 entries in this dictionary.  The tricky bit is that the words
being defined are in Ancient Egyptian Hieroglyphs.  Each word (or phrase) is
stored in SVG format.  So ultimately my FO document contains 12,000
instream-foreign-object tags each containing SVG.  This configuration alone
taxes the 1 GB memory limit I am able to give to my virtual machine (a known
issue with running Java under Windows).

 

Each dictionary entry would like to contain zero or more alternative words
and phrases (think thesaurus).  This increases the number of
instream-foreign-object tags containing SVG to the order of 30,000 or
40,000.  Even breaking this up into individual chapters I have a very hard
time rendering these documents.  They consume vast amounts of memory and
bring my system to a halt even under Linux.

 

So I was wondering if anyone had any suggestions on how I could optimize my
FO document and use of SVG.  Since all of the see also words and phrases
can be found elsewhere in my document is there a way to generate a PDF-layer
reference to content located at another part of a document? I am thinking of
something analogous to symbols in Flash; a way of having FOP render the SVG
word or phrase once and have it instruct the PDF to reuse that content in
many locations.

 

Converting these to images is less than ideal since ancient Egyptian
hieroglyphs contain a lot of fine detail that would be lost or blurred if
rasterized.  One of my main reasons for choosing this approach was that I
knew FOP would preserve the hieroglyphs in vector format.

 

For what it is worth without the SVG content FOP runs fantastically.  So
this seems to be due to the sheer volume of vector data added to the
rendering process by the inclusion of all of these SVG elements.

 

Since this is my first time ever mailing and FOP related mailing list when
they take this opportunity to say that I have been using FOP for over seven
years now and have enjoyed every minute of it.  This is a fantastic product
and I think the improvements in this new branch in performance and API are
nothing less than spectacular!  Thank you to everyone contributing to this
project.

 

Ted young



RE: Making a Large Dictionary

2008-05-18 Thread Ted Young
Thank you to all who have replied.  The answer by Andreas Delmelle was right
on!  I switched over to using external-graphic and not only can I render
within my 1 GB memory limit, my PDF files seem to display faster.

Today I was thinking that if this worked, it would be neat to be able to use
the same technique to embed PDF data; effectively creating content which can
be efficiently repeated throughout the document.  That is when I came home
to find Peter Coppens's email regarding his extension to do just that:

http://www.jeremias-maerki.ch/development/fop/

You seem to be on the right track my friend.

And finally to Mr. Pietschmann's statement:

 In any case, I'm always amazed by the applications people find
 for XSLFO in general and FOP in particular.

Oh yeah!  This is a fantastic tool and anyone with a little programming
experience and a little imagination can really go to town.

I once had to generate API documentation for a large system of code (many
languages) that was documented by several developers (it took 5.5 man-years
to document).  I took their documentation, plus some software analysis
tools, graphviz, and FOP and ended up with over 5,000 pages of documentation
(which the customer required to be printed). 

I love the fact that I can take a Java object modal, and use JAX-B to
serialize it to XML, which is then forwarded to an XSLT transformer which
converts it into XSLFO, which is rendered to PDF by FOP.  And all of this is
done entirely in SAX!!!  Using the Collection and Iterator interfaces, one
can load large datasets into JAX-B lazily.  So, at no point in time is the
entire dataset (in any format) ever in memory.  And all in only in a dozen
lines of code!!!

Adding in the Ancient Egyptian is a synch with the JSesh library that
converts MDC (a standard transcription system for AE hieroglyphs) to SVG.

The only difficult part was taking the source of the dictionary which laid
out the hieroglyphs using absolute coordinates and converting that to MDC
(which doesn't use coordinates at all, but rather logical associations
between glyphs; such as A is on top of B, etc.).  This required the
development of a layout analysis engine, which will need some more tweaking
apparently.

Anyway, when I put the dictionary online I hope to document the whole
process (including code) when I get done with this (this is all
open-source/free-to-abuse stuff).  I think there are some really good FOP
tutorials in this.

Ted


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]