Re: pdfbox build?

2015-05-15 Thread Eric Douglas
Nevermind, I believe this is the wrong distribution list.

On Fri, May 15, 2015 at 9:24 AM, Eric Douglas edoug...@blockhouse.com
wrote:

 How do I build the latest pdfbox?  I downloaded the trunk using git in
 Eclipse and the maven package run says failed.

 Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.869 sec
  FAILURE! - in org.apache.pdfbox.encryption.TestSymmetricKeyEncryption
 testProtection(org.apache.pdfbox.encryption.TestSymmetricKeyEncryption)
  Time elapsed: 0.74 sec   ERROR!
 java.io.IOException: java.util.zip.DataFormatException: invalid code
 lengths set
 at java.util.zip.Inflater.inflateBytes(Native Method)
 at java.util.zip.Inflater.inflate(Inflater.java:259)
 at java.util.zip.Inflater.inflate(Inflater.java:280)
 at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
 at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
 at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
 at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
 at
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processAnnotation(PDFStreamEngine.java:301)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.showAnnotation(PDFStreamEngine.java:382)
 at
 org.apache.pdfbox.rendering.PageDrawer.showAnnotation(PageDrawer.java:812)
 at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
 at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
 at
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
 at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:69)
 at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:56)
 at
 org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.testSymmEncrForKeySize(TestSymmetricKeyEncryption.java:246)
 at
 org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.testProtection(TestSymmetricKeyEncryption.java:197)

 Tests run: 9, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 2.885 sec
  FAILURE! - in org.apache.pdfbox.rendering.TestRendering
 render[26101_Colors.ai](org.apache.pdfbox.rendering.TestRendering)  Time
 elapsed: 0 sec   ERROR!
 java.io.IOException: java.util.zip.DataFormatException: incorrect data
 check
 at java.util.zip.Inflater.inflateBytes(Native Method)
 at java.util.zip.Inflater.inflate(Inflater.java:259)
 at java.util.zip.Inflater.inflate(Inflater.java:280)
 at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
 at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
 at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
 at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
 at
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:438)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
 at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:179)
 at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
 at
 org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
 at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:69)
 at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:56)
 at org.apache.pdfbox.rendering.TestRendering.render(TestRendering.java:79)

 render[FANTASTICCMYK.ai](org.apache.pdfbox.rendering.TestRendering)  Time
 elapsed: 0.088 sec   ERROR!
 java.io.IOException: java.util.zip.DataFormatException: invalid distance
 too far back
 at java.util.zip.Inflater.inflateBytes(Native Method)
 at java.util.zip.Inflater.inflate(Inflater.java:259)
 at java.util.zip.Inflater.inflate(Inflater.java:280)
 at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
 at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
 at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
 at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
 at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
 at
 org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
 at
 org.apache.pdfbox.contentstream.PDFStreamEngine.processStream

pdfbox build?

2015-05-15 Thread Eric Douglas
How do I build the latest pdfbox?  I downloaded the trunk using git in
Eclipse and the maven package run says failed.

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.869 sec
 FAILURE! - in org.apache.pdfbox.encryption.TestSymmetricKeyEncryption
testProtection(org.apache.pdfbox.encryption.TestSymmetricKeyEncryption)
 Time elapsed: 0.74 sec   ERROR!
java.io.IOException: java.util.zip.DataFormatException: invalid code
lengths set
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:259)
at java.util.zip.Inflater.inflate(Inflater.java:280)
at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
at
org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processAnnotation(PDFStreamEngine.java:301)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.showAnnotation(PDFStreamEngine.java:382)
at
org.apache.pdfbox.rendering.PageDrawer.showAnnotation(PageDrawer.java:812)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:69)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:56)
at
org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.testSymmEncrForKeySize(TestSymmetricKeyEncryption.java:246)
at
org.apache.pdfbox.encryption.TestSymmetricKeyEncryption.testProtection(TestSymmetricKeyEncryption.java:197)

Tests run: 9, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 2.885 sec
 FAILURE! - in org.apache.pdfbox.rendering.TestRendering
render[26101_Colors.ai](org.apache.pdfbox.rendering.TestRendering)  Time
elapsed: 0 sec   ERROR!
java.io.IOException: java.util.zip.DataFormatException: incorrect data check
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:259)
at java.util.zip.Inflater.inflate(Inflater.java:280)
at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
at
org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:438)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:179)
at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:69)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:56)
at org.apache.pdfbox.rendering.TestRendering.render(TestRendering.java:79)

render[FANTASTICCMYK.ai](org.apache.pdfbox.rendering.TestRendering)  Time
elapsed: 0.088 sec   ERROR!
java.io.IOException: java.util.zip.DataFormatException: invalid distance
too far back
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:259)
at java.util.zip.Inflater.inflate(Inflater.java:280)
at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
at org.apache.pdfbox.cos.COSStream.attemptDecode(COSStream.java:405)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:381)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:319)
at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:235)
at
org.apache.pdfbox.pdfparser.PDFStreamParser.init(PDFStreamParser.java:90)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:451)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:438)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:179)
at 

RE: Merge Request - Temp_ComplexScripts into Trunk

2011-10-27 Thread Eric Douglas
There is little room for individuality in a coding community.
I'd say it doesn't matter what you call your variables as long as
someone who's never seen the code can understand the purpose through the
name and/or comments, and they conform to any predefined naming standard
for the project.
Ages ago all variables had short names because disk space and/or memory
was at a premium.  Today that shouldn't be an excuse.
Try to avoid overly simplistic names like x1 unless they have overly
simplistic purpose (create, use, destroy within a 5 line method), and
try to avoid overly verbose names.
As long as what you write makes sense I'd agree with you no one should
change the code simply for the sake of personal preference.
You should certainly change it if you don't want someone else to change
it if someone unfamiliar with it can't understand it.
If they're changing your names that should be fine as long as they're
fixing a bug or enhancing something where the name change makes sense to
go with the new logic.
 



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Thursday, October 27, 2011 3:56 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Merge Request - Temp_ComplexScripts into Trunk




On Thu, Oct 27, 2011 at 3:41 PM, Simon Pepping spepp...@leverkruid.eu
wrote:


   Ninth, spending time changing variable names is a waste of
time when I
  could
   be working on adding support for other scripts.
 
  So someone else is going to have to waste all that time
converting those
  names into more readable ones. That's a bit unfair, isn't
it?
 

 I would advise against anyone wasting their time by changing
my names.
 Indeed, I will likely react very negatively to such an
attempt. What you
 want to do in your code is your business, but don't imagine
you are going to
 start rewriting my code to meet your style. Or at least don't
do so if you
 wish me to be a part of this team.

 I would take such an action as a direct affront.


This is a big no. At the moment you hand in your code to FOP, it
belongs to the community. Anyone can touch it. That is where
team
membership kicks in. Team members trust each other not to do bad
things to the code.


 If in the indefinite future I am not working on this code,
then feel free to
 change it as you like. In the mean time, I'd appreciate a
little respect.


Respect yes, but not touching it, no.



I did not say or imply hands off, so of course I presume that anyone can
touch it. Why do you insist on reading me otherwise?

However, if someone actually renamed my variables after I have declared
my position, then I would interpret that as doing bad things to the
code. In fact, i would revert such a change.

If folks aren't willing to respect my style of coding along with my
promise to document short names, then I will withdraw my request for a
merge and abrogate my ICLA. I would not wish my work to be used in a
community that does not have sufficient respect for personal coding
styles of contributors that do not in any way vary from documented
conventions.
 


Simon Pepping





RE: Merge Request - Temp_ComplexScripts into Trunk

2011-10-26 Thread Eric Douglas
I haven't looked at the code in question on this particular discussion
so this is not to criticize.

Overly concise variables names should be acceptable within limited
scope.
Calling an ObjectOutputStream oos may be sufficient when it's created
and destroyed within one little method.
Using i or z may suffice as loop counters within a single simple method,
while you may want a longer name simply to track the loop if it gets
more complex nesting loops.
A project should have defined standards for meaningful variable naming,
particularly when they're declared at the class level or they're public,
protected, or passed in to the method.

The simplest readability standard is of course the layout.  Eclipse has
plenty of preferences and an option to export them.  Line wraps, comment
format, etc should be consistant within a project.

Of course if code must be reused it helps if standard naming can be
enforced by such as abstract methods and interfaces.

-Original Message-
From: Peter Hancock [mailto:peter.hanc...@gmail.com] 
Sent: Wednesday, October 26, 2011 9:34 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Merge Request - Temp_ComplexScripts into Trunk

 I wonder what you think about the code in 
 o.a.f.hyphenation.TernaryTree, where the author apparently did not 
 know Java, and introduces the libc functions strcmp, strcpy, and 
 strlen, and which uses the Java char type (within the String type) for
coding tree pointers!

My apprehension about certain areas of your code (and not the
majority!) stems from such examples, and the headaches theycan
bring.  This is old code that I had no influence over at the time and I
do not want it to have any bearing on where the  project is heading.

 If you wanted to make a serious case against using short names, you 
 would start first by analyzing existing FOP usage and using such an 
 analysis to establish concrete metrics.

I do not think I have focused on the length of variable or member
names have I?  I did a PhD in mathematics and I have a soft spot
for the aesthetic value of short names.  It is always pleasing to
distill a mathematical proof to the simplist form possible and
using consise variable naming is often a part of that.  That said, I
do not think that working codebenefits from this approach:
what can seem like an efficient and powerful piece of code when
written can prove to be an  overly difficult thing to read later.
Unlike yourself, apparently, my memory ain't so good and I benefit from
code that has clear intention.

Peter


org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

2011-10-24 Thread Eric Douglas
It appears the only place it sets the page size is in the setupDocument
method which also writes the characters to initialize the PDF.
I want to be able to put a portrait page and a landscape page in the
same document, which sort of works if I call that method but it has
those extra characters which messes up the text though the pages are
turned correctly.



RE: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

2011-10-24 Thread Eric Douglas
Sounds like just what I was looking for!  Thanks!

I used the TortoiseSVN to download the trunk but I still haven't figured
out how to compile it with ant.  It keeps saying it failed at least one
junit test.
I did just do File  Export in Eclipse, selecting all class files and
got a working jar.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Monday, October 24, 2011 8:46 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change page
size?

Here you go: http://svn.apache.org/viewvc?rev=1188123view=rev

In addition to nextPage(), there is now also a nextPage(width, height)
for changing the size of the following pages.

On 24.10.2011 14:29:23 Eric Douglas wrote:
 It appears the only place it sets the page size is in the 
 setupDocument method which also writes the characters to initialize
the PDF.
 I want to be able to put a portrait page and a landscape page in the 
 same document, which sort of works if I call that method but it has 
 those extra characters which messes up the text though the pages are 
 turned correctly.
 




Jeremias Maerki



RE: Merge Request - Temp_ComplexScripts into Trunk

2011-10-24 Thread Eric Douglas
Short variable names should use less memory, which is mostly irrelevant
these days.
In an open project where other people could be working on the same code
(or other code in the same package) it helps if all names are
consistant.
Personally I could never figure out what variable naming conventions
are.  Each class I write seems to provide reason to use an entirely new
convention.
As long as someone who has never seen your code before can determine the
purpose of each variable, I'd say you're good.
If that requires comments, definitely add comments.  When in doubt,
comment.



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Monday, October 24, 2011 9:06 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Merge Request - Temp_ComplexScripts into Trunk



On Mon, Oct 24, 2011 at 8:26 PM, Georg Datterl georg.datt...@geneon.de
wrote:


Hello Glenn,


 (2) there is no standard for symbol length documented in FOP
practice
 or enforced by checkstyle; I decline to exchange my choice of
symbols
 with longer symbols simply because you prefer it that way; I
have
 offered to add comments to my uses, and that is the most I'm
willing
 to do to address this matter;


You probably spent more years programming than I am alive, so
please excuse me if that's a stupid question: What is the
reasoning/advantage behind those short variable names?



First, I don't use short names everywhere. Mostly I just use in local
variables, but generally not as class variables.

Second, I was trained in Physics and Mathematics, which uses short
variable names (E = M C ^ 2).

Third, I started programming in the 1960s with BAL 360, APL, then
FORTRAN IV. We use short names there.

Fourth, I happen to have a good memory and I have no trouble remembering
the meaning of variable names.

Fifth, I find that short names prevents making lines too long and gives
me more room for comments.

Sixth, I am going to be maintaining this code. If anyone has a problem
with specific code during a merge or regression, they merely need ask
me.

Seventh, that's just my style, and I assert it is as valid as doing it
with long names.

Eighth, asking me to adhere to an undocumented convention that is not
otherwise enforced, and for which there is no evidence or analysis of
having been previously followed in FOP contributions is unwarranted.

Ninth, spending time changing variable names is a waste of time when I
could be working on adding support for other scripts.

I can probably throw in a few more random reasons, but this should be
sufficient.

I've offered to add comments, take it or leave it.



RE: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

2011-10-24 Thread Eric Douglas
I don't know.  After several failed builds and changing to make errors go away 
now I get this...
Failures: 0, Errors: 0 after every test
Only error message I see is
[junit] Oct 24, 2011 1:56:01 PM org.apache.fop.apps.FopFactory resolveURI
[junit] SEVERE: Attempt to resolve URI 
'badprotocol:test/resources/fonts/glb12.ttf.xml' failed:
[junit] javax.xml.transform.TransformerException: Error with URL; base 
'file:/C:/Java/fop-trunk/trunk/test/config/' href 
'badprotocol:test/resources/fonts/glb12.ttf.xml'

Then it ends with
BUILD FAILED
C:\Java\fop-trunk\trunk\build.xml:875: NOTE:
**
* One or more of the Junit tests had Failures or Errors or were skipped! *
* Please check the output above for relevant messages.   *
*Or use the junit-reports target to generate HTML test reports.*
**
 

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Monday, October 24, 2011 9:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

Hi Eric,

Could you put up which unit tests are failing. Another user is having a similar 
issue.

Thanks

Mehdi

On 24 October 2011 14:05, Eric Douglas edoug...@blockhouse.com wrote:
 Sounds like just what I was looking for!  Thanks!

 I used the TortoiseSVN to download the trunk but I still haven't 
 figured out how to compile it with ant.  It keeps saying it failed at 
 least one junit test.
 I did just do File  Export in Eclipse, selecting all class files and 
 got a working jar.


 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Monday, October 24, 2011 8:46 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change 
 page size?

 Here you go: http://svn.apache.org/viewvc?rev=1188123view=rev

 In addition to nextPage(), there is now also a nextPage(width, height) 
 for changing the size of the following pages.

 On 24.10.2011 14:29:23 Eric Douglas wrote:
 It appears the only place it sets the page size is in the 
 setupDocument method which also writes the characters to initialize
 the PDF.
 I want to be able to put a portrait page and a landscape page in the 
 same document, which sort of works if I call that method but it has 
 those extra characters which messes up the text though the pages are 
 turned correctly.





 Jeremias Maerki




RE: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

2011-10-24 Thread Eric Douglas
I'm not sure what it means.  It ends with build failed but it did create a jar.
Now I'm trying to test using this jar and it doesn't seem to like my set font 
commands so I need to figure that out.
 

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Monday, October 24, 2011 9:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

Hi Eric,

Could you put up which unit tests are failing. Another user is having a similar 
issue.

Thanks

Mehdi

On 24 October 2011 14:05, Eric Douglas edoug...@blockhouse.com wrote:
 Sounds like just what I was looking for!  Thanks!

 I used the TortoiseSVN to download the trunk but I still haven't 
 figured out how to compile it with ant.  It keeps saying it failed at 
 least one junit test.
 I did just do File  Export in Eclipse, selecting all class files and 
 got a working jar.


 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Monday, October 24, 2011 8:46 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change 
 page size?

 Here you go: http://svn.apache.org/viewvc?rev=1188123view=rev

 In addition to nextPage(), there is now also a nextPage(width, height) 
 for changing the size of the following pages.

 On 24.10.2011 14:29:23 Eric Douglas wrote:
 It appears the only place it sets the page size is in the 
 setupDocument method which also writes the characters to initialize
 the PDF.
 I want to be able to put a portrait page and a landscape page in the 
 same document, which sort of works if I call that method but it has 
 those extra characters which messes up the text though the pages are 
 turned correctly.





 Jeremias Maerki




RE: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

2011-10-24 Thread Eric Douglas
Of course it doesn't say there were any errors.  The error message says one or 
more...errors or were skipped

I saved the build log.  While it doesn't mention any errors aside from that 
URI, it does have this near the top:
compile-hyphenation:
 [echo] Hyphenation successful

Then this near the bottom:
hyphenation-present:
 [echo] Hyphenation Support NOT Present - Layout tests which require 
hyphenation are NOT being run!

Is that related?  The only other reference to skip is this:
[junit] WARNING: Skipping malformed value for font-family: 'Times New 
'Roman in 'Times New 'Roman, serif. 

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Monday, October 24, 2011 3:38 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

Curious... The other user was complaining of the same issue... Anyone got any 
ideas? I can't recreate this.

On 24 October 2011 19:20, Eric Douglas edoug...@blockhouse.com wrote:
 I don't know.  After several failed builds and changing to make errors go 
 away now I get this...
 Failures: 0, Errors: 0 after every test Only error message I see is
    [junit] Oct 24, 2011 1:56:01 PM org.apache.fop.apps.FopFactory 
 resolveURI
    [junit] SEVERE: Attempt to resolve URI 
 'badprotocol:test/resources/fonts/glb12.ttf.xml' failed:
    [junit] javax.xml.transform.TransformerException: Error with URL; base 
 'file:/C:/Java/fop-trunk/trunk/test/config/' href 
 'badprotocol:test/resources/fonts/glb12.ttf.xml'

 Then it ends with
 BUILD FAILED
 C:\Java\fop-trunk\trunk\build.xml:875: NOTE:
 **
 
 * One or more of the Junit tests had Failures or Errors or were 
 skipped! *
 *         Please check the output above for relevant messages.           
 *
 *    Or use the junit-reports target to generate HTML test reports.    
 *
 **
 


 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Monday, October 24, 2011 9:28 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change page size?

 Hi Eric,

 Could you put up which unit tests are failing. Another user is having a 
 similar issue.

 Thanks

 Mehdi

 On 24 October 2011 14:05, Eric Douglas edoug...@blockhouse.com wrote:
 Sounds like just what I was looking for!  Thanks!

 I used the TortoiseSVN to download the trunk but I still haven't 
 figured out how to compile it with ant.  It keeps saying it failed at 
 least one junit test.
 I did just do File  Export in Eclipse, selecting all class files and 
 got a working jar.


 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Monday, October 24, 2011 8:46 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: org.apache.fop.svg.PDFDocumentGraphics2D can't change 
 page size?

 Here you go: http://svn.apache.org/viewvc?rev=1188123view=rev

 In addition to nextPage(), there is now also a nextPage(width, 
 height) for changing the size of the following pages.

 On 24.10.2011 14:29:23 Eric Douglas wrote:
 It appears the only place it sets the page size is in the 
 setupDocument method which also writes the characters to initialize
 the PDF.
 I want to be able to put a portrait page and a landscape page in the 
 same document, which sort of works if I call that method but it has 
 those extra characters which messes up the text though the pages are 
 turned correctly.





 Jeremias Maerki





RE: Where's the class?

2011-10-19 Thread Eric Douglas
Well, as a user I was using that class to create PDFs with embedded
code.
Sometimes that user developer line is a little fuzzy.
If it's been totally redesigned I apparently need to hunt down some
documentation.
 

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Wednesday, October 19, 2011 9:49 AM
To: fop-us...@xmlgraphics.apache.org; fop-dev@xmlgraphics.apache.org
Subject: Re: Where's the class?

Sorry Eric, I meant to say, this is a developer question, could you post
questions concerning the code on fop-dev in future.

Thanks

Mehdi

On 19 October 2011 14:47, mehdi houshmand med1...@gmail.com wrote:
 Hi Eric,

 The renderers of old were removed quite a while ago in commit#989178.

 Hope that helps

 Mehdi

 On 19 October 2011 14:33, Eric Douglas edoug...@blockhouse.com
wrote:
 I downloaded fop as the latest trunk snapshot and it says you took 
 away a class?
 What happened to org.apache.fop.render.pdf.PDFRenderer?


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Example crash

2011-10-19 Thread Eric Douglas
What am I missing?
I downloaded fop.jar from yesterday's snapshot and ran the example
program at
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/ja
va/embedding/ExampleJava2D2PDF.java?view=markup
It crashed.
Stack trace shows:
java.lang.NullPointerException
at
org.apache.fop.svg.PDFGraphics2D.getString(PDFGraphics2D.java:290)
at
org.apache.fop.svg.PDFDocumentGraphics2D.closePage(PDFDocumentGraphics2D
.java:262)
at
org.apache.fop.svg.PDFDocumentGraphics2D.finish(PDFDocumentGraphics2D.ja
va:360)


RE: Example crash

2011-10-19 Thread Eric Douglas
I found the incorrect build path reference.  Now it just doesn't finish.
It gets to that statement:
configurator.configure(g2d, cfg);
Then doesn't appear to be doing anything.
It keeps running back to the call:
configure(g2d, createAutoFontsConfiguration());
Then jumps right to the finally block, then doesn't execute anything
after the finally block.
No error message, it just doesn't work.
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, October 19, 2011 12:29 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Example crash

There must be something off. Last change to PDFGraphics2D was on
2011-10-15. And in current Trunk the NPE in getString (if any) would
have to happen on line 297, not 290. I'm pretty sure you've still go a
FOP 1.0 JAR in the classpath or something like that. Please check your
classpath.

On 19.10.2011 16:46:57 Eric Douglas wrote:
 What am I missing?
 I downloaded fop.jar from yesterday's snapshot and ran the example 
 program at 
 http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/
 ja va/embedding/ExampleJava2D2PDF.java?view=markup
 It crashed.
 Stack trace shows:
 java.lang.NullPointerException
   at
 org.apache.fop.svg.PDFGraphics2D.getString(PDFGraphics2D.java:290)
   at
 org.apache.fop.svg.PDFDocumentGraphics2D.closePage(PDFDocumentGraphics
 2D
 .java:262)
   at
 org.apache.fop.svg.PDFDocumentGraphics2D.finish(PDFDocumentGraphics2D.
 ja
 va:360)




Jeremias Maerki



RE: Example crash

2011-10-19 Thread Eric Douglas
It appears that test may be hiding the error.
I tried putting your main test logic into a test program I had already
created.
Now I tried creating a new class to put that directly into the main
method and I get this crash on test.

Exception in thread main java.lang.NoSuchMethodError:
org.apache.fop.render.PrintRendererConfigurator.buildFontListFromConfigu
ration(Lorg/apache/avalon/framework/configuration/Configuration;Ljava/la
ng/String;Lorg/apache/fop/fonts/FontResolver;ZLorg/apache/fop/fonts/Font
Cache;)Ljava/util/List;
at
org.apache.fop.svg.PDFDocumentGraphics2DConfigurator.configure(PDFDocume
ntGraphics2DConfigurator.java:56)

From that statement
configurator.configure(g2d, cfg);
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, October 19, 2011 4:34 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Example crash

Works fine for me. Getting no error message is hard to believe since the
whole program is in a try..catch(Throwable t). Nothing but a JVM crash
gets around that. All assuming, of course, that you didn't change the
example program.

My console output looks like this:

FOP ExampleJava2D2PDF

Preparing...
Output: PDF (.\out\ResultJava2D2PDF.pdf)

Generating...
Success!

On 19.10.2011 22:19:35 Eric Douglas wrote:
 I found the incorrect build path reference.  Now it just doesn't
finish.
 It gets to that statement:
 configurator.configure(g2d, cfg);
 Then doesn't appear to be doing anything.
 It keeps running back to the call:
 configure(g2d, createAutoFontsConfiguration()); Then jumps right to 
 the finally block, then doesn't execute anything after the finally 
 block.
 No error message, it just doesn't work.
  
 
 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Wednesday, October 19, 2011 12:29 PM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Example crash
 
 There must be something off. Last change to PDFGraphics2D was on 
 2011-10-15. And in current Trunk the NPE in getString (if any) would 
 have to happen on line 297, not 290. I'm pretty sure you've still go a

 FOP 1.0 JAR in the classpath or something like that. Please check your

 classpath.
 
 On 19.10.2011 16:46:57 Eric Douglas wrote:
  What am I missing?
  I downloaded fop.jar from yesterday's snapshot and ran the example 
  program at 
  http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embeddin
  g/ ja va/embedding/ExampleJava2D2PDF.java?view=markup
  It crashed.
  Stack trace shows:
  java.lang.NullPointerException
  at
  org.apache.fop.svg.PDFGraphics2D.getString(PDFGraphics2D.java:290)
  at
  org.apache.fop.svg.PDFDocumentGraphics2D.closePage(PDFDocumentGraphi
  cs
  2D
  .java:262)
  at
 
org.apache.fop.svg.PDFDocumentGraphics2D.finish(PDFDocumentGraphics2D.
  ja
  va:360)
 
 
 
 
 Jeremias Maerki
 




Jeremias Maerki



RE: How to make embedded font readable?

2011-09-12 Thread Eric Douglas
I'll look into that JIRA, thanks.
The pdfbox error in the original message below shows the class and method 
producing this message in the Java log.

Digging a little deeper, this is caused by the pdfbox method:
org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()

This is trying to read the FontFile2 key which was written by FOP.
org.apache.fop.pdf.PDFFontDescriptor.setFontFile()

One of these is missing something.
 
 

-Original Message-
From: Andreas Lehmkuehler [mailto:andr...@lehmi.de] 
Sent: Monday, September 12, 2011 3:30 PM
To: us...@pdfbox.apache.org
Cc: fop-us...@xmlgraphics.apache.org
Subject: Re: How to make embedded font readable?

Hi,

Am 12.09.2011 15:31, schrieb Eric Douglas:
 FOP created the PDF.  Pdfbox is trying to read it.
 I'm not sure which end is missing what.
 I'm embedding fonts and pdfbox says there's something there it can't 
 read.
I guess it is an issue with PDFBox, but without a sample PDF it's only a guess. 
Please create an issue on JIRA [1] and attach a sample pdf to it.

 Sep 12, 2011 9:18:12 AM
 org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
 INFO: Can't read the embedded font ED+LucidaSans-Typewriter


BR
Andreas Lehmkühler

[1] https://issues.apache.org/jira/browse/PDFBOX


RE: How to translate characters?

2011-09-06 Thread Eric Douglas

Aha!
Your code was almost right.
Now, I can't put a square into the XML or I get this error.
SystemId Unknown; Line #188; Column #5; An invalid XML character
(Unicode: 0x0) was found in the element content of the document.

So I stick with putting the string value #x25a1; into my text object
I'm using to create various outputs.
For a PDF I get the text value, write it to XML, run it through the
transform to get FO, run it through FOP to get a PDF, then load it into
pdfbox to print.
The XML file contains that string.  The FO file contains the square
character.  I'm guessing the Transformer itself knows nothing about this
but something in the SAX handler converts it.
For a print preview just to display a single unicode value the simplest
way is to hardcode it.
Your String declaration was on the right track except you need a value
container.

drawText = displayText.getText();
String CHARCHECKBOX = new String(#x25a1;);
String CHARSMILEY = new String(#x263A;);
String UNICODECHARCHECKBOX = new String(new int[]{0x25a1}, 0, 1 );
String UNICODECHARSMILEY = new String(new int[]{0x263A}, 0, 1 );
drawText = drawText.replaceAll(CHARCHECKBOX, UNICODECHARCHECKBOX);
drawText = drawText.replaceAll(CHARSMILEY, UNICODECHARSMILEY);

I don't know an easy way to find and replace all possible such unicode
strings aside from creating a custom SAX handler and wrapping the text
in some default XML to recreate what the Transformer is doing.
 

-Original Message-
From: Christopher R. Maden [mailto:cr...@maden.org] 
Sent: Monday, September 05, 2011 9:32 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How to translate characters?

On 09/05/2011 06:31 PM, Eric Douglas wrote:
 So, I'm confused.  I put that exact string into an fo:inline.
 I'm running embedded code and I separated the XML-FO transform step
from the FOP step.
 I'm just running a straight Oracle transform.
 My input is an XML file containing the string #x25A1; My transformer 
 is created using an XSL file.
 My output is an FO file with that string converted to a square.
 I put that string into a Java String and get the value.  It comes out
the same as it went in.
 How do I get the value of the String as a square?

Java is not XML.  Java has no native facility for interpreting an XML
numeric character reference, so you are getting exactly the expected
results.

I don't speak Java well, but try something like this:

String square = new String( [ 0x25a1 ], 0, 1 );

Then pass that string, square, to FOP.

If that doesn't help, I'm done; I can read Java, but don't really write
it well.

~Chris
--
Chris Maden, text nerd  URL: http://crism.maden.org/  The present
tendency and drift towards the Police State gives all  free Americans
pause. - Alabama Supreme Court, 1955  (Pike v. Southern Bell Tel. 
Telegraph, 81 So.2d 254)


RE: How to translate characters?

2011-09-05 Thread Eric Douglas
So, I'm confused.  I put that exact string into an fo:inline.
I'm running embedded code and I separated the XML-FO transform step from the 
FOP step.
I'm just running a straight Oracle transform.
My input is an XML file containing the string #x25A1;
My transformer is created using an XSL file.
My output is an FO file with that string converted to a square.
I put that string into a Java String and get the value.  It comes out the same 
as it went in.
How do I get the value of the String as a square?


-Original Message-
From: Christopher R. Maden [mailto:cr...@maden.org]
Sent: Fri 9/2/2011 4:09 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How to translate characters?
 
I overlooked a couple things here... so by way of explanation:

On 09/02/2011 02:44 PM, Eric Douglas wrote:
 I see.  As I said I saw something in the FOP classes which appeared
 to be looking for such a code and translating it, but I just pulled
 up a .FO file and I see it's already translated to be
 fo:inline?/fo:inline so there must be something in the Oracle
 Transformer.

There is nothing in the Oracle Transformer doing this.  When you pass
XML+XSLT or raw FO XML to FOP, the first thing that happens is the XML
is parsed.  XML is a markup language (obviously): the information
represented by:

fo:inline?/fo:inline
fo:inline#x25a1;/fo:inline
fo:inline#x25A1;/fo:inline
fo:inline?/fo:inline

is not only identical in effect, but literally indistinguishable after
parsing.  Operating on the parsed document, you cannot tell these things
apart.  They each represent a single XML element (named inline in the FO
namespace) with a single character of content, U+25A1 WHITE SQUARE.

The Oracle Transformer is operating on that data: an element with
content that is one character long.  No lookup or mapping is done.

 So it seems FOP just gets the actual square and still has to know
 what character it maps to in the font.

FOP gets the square which *is* a character.  It knows which character it
maps to because it *is* that character.  What FOP doesn't know (at
first) is which fonts have useful glyphs for that character.  It looks
through the fonts currently in scope (as specified in the list in the
font-family property) to find the first one that does specify a useful
glyph for that character.[*]

~Chris

[*] Strictly, as I understand it, it looks for the font that best
matches an entire string, as character-by-character font selection isn't
implemented.  But for a single-character string, it's the same thing.
-- 
Chris Maden, text nerd  URL: http://crism.maden.org/ 
The present tendency and drift towards the Police State gives all
 free Americans pause. - Alabama Supreme Court, 1955
 (Pike v. Southern Bell Tel.  Telegraph, 81 So.2d 254)

winmail.dat

How to translate characters?

2011-09-02 Thread Eric Douglas
I pass a character into my XML/FO as #x25A1; and it shows on the PDF as
a square.
I'm trying to figure out what Java has for interpreting such code, and
it appears FOP just string searches and pulls out the number, in the
class org.apache.xmlgraphics.fonts.Glyphs.
Is this all it is, to search text for # and ; and find the
character value between, or is there an actual Java class/method for
translating such values?



RE: How to translate characters?

2011-09-02 Thread Eric Douglas
I see.  As I said I saw something in the FOP classes which appeared to be 
looking for such a code and translating it, but I just pulled up a .FO file and 
I see it's already translated to be fo:inline□/fo:inline so there must be 
something in the Oracle Transformer.
So it seems FOP just gets the actual square and still has to know what 
character it maps to in the font.

So I'm trying to pass in this text (#x25A1;) and get it to display with 
Java's Graphics2D.drawText().
So I'm wondering if I translate that the same way I do to create this FO, with 
an XSL file and a Transformer or if there's a simpler method.
So I'm looking at the class java.nio.charset.Charset trying to figure out if or 
how that connects to a custom font file.


-Original Message-
From: Christopher R. Maden [mailto:cr...@maden.org] 
Sent: Friday, September 02, 2011 1:56 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How to translate characters?

On 09/02/2011 01:40 PM, Eric Douglas wrote:
 I pass a character into my XML/FO as #x25A1; and it shows on the PDF 
 as a square.
 I'm trying to figure out what Java has for interpreting such code, and 
 it appears FOP just string searches and pulls out the number, in the 
 class org.apache.xmlgraphics.fonts.Glyphs.
 Is this all it is, to search text for # and ; and find the 
 character value between, or is there an actual Java class/method for 
 translating such values?

By the time FOP gets this information, the XML has been parsed.
#x25a1; is just a convenient way of entering the single character with Unicode 
value 25A1, □, WHITE SQUARE.  Equivalents would be #9633; or (with common ISO 
entity declarations) squ; - in all cases, FOP just receives a single 
character, □.

FOP then attempts to find which of the specified fonts actually has a glyph for 
that character, and does so using the numeric Unicode value of the character, 
but that is independent of how the input XML (which FOP does not see) specified 
the character.  If you’re looking at altering or overriding the code, you need 
to operate in the character domain, not the XML markup domain.

(By analogy, FOP receives elements, root-in-the-FO-namespace etc., not the 
string “fo:root ...”.  This is the same kind of thing.)

~Chris
--
Chris Maden, text nerd  URL: http://crism.maden.org/  “The present tendency 
and drift towards the Police State gives all  free Americans pause.” - Alabama 
Supreme Court, 1955  (Pike v. Southern Bell Tel.  Telegraph, 81 So.2d 254)


RE: How do you smooth fonts?

2011-08-26 Thread Eric Douglas
An independent contractor recommended FOP so that was the project I
looked at first.
I have used FOP so I know it works, though I'm sure no one else uses it
the same way.
I just create XML with data including tags to tell it specifically what
goes where on each page.
I've had 2 problems with FOP.
1) It takes too much memory to generate a really large PDF.  I've had to
break up my data and generate multiple PDFs using the initial page
sequence tag, then I used pdfbox to piece them together.
2) The AWT viewer was very inefficient, so I wrote my own.

I'm not familiar with iText so I don't know if it can generate the PDFs
like FOP with the custom embedded fonts, SVG graphics, etc.
I saw some messages recently on the pdfbox list that people were
switching from iText, something about licensing issues.


-Original Message-
From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com] 
Sent: Friday, August 26, 2011 5:52 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How do you smooth fonts?

On 22/08/2011 21:57, Eric Douglas wrote:

Hi Eric,

 When I transform XSLFO with FOP I can send the output to PDF or AWT 
 and text looks sharp.
 I'm trying to use the same fonts to generate graphics directly since 
 I'm programmatically generating the input to my FOP process and I 
 don't actually need the XSLFO process.


If you know the position of all your text in advance and don't need
XSL-FO, then FOP seems like the wrong tool for the job. Why not use
iText, which has an API for creating PDF?

 I know exactly what text I want to print, what size I want it, and 
 exactly where I want it on the page.
 I tried putting the text on an image and putting the image on a Swing 
 panel and it always comes out fuzzy.  It's even fuzzier if I try to 
 save that image to a file or send it to a printer.

 I tried using the FOP classes for loading the font, using the 
 Java2DGraphicsState, FontInfo, and FontMetricsMapper objects to 
 generate the text.  It's always rendered blurry.  What could I be
missing?


Chris


RE: How do you smooth fonts?

2011-08-26 Thread Eric Douglas
I am using pdfbox to merge and print PDFs.
Either there's a lot I don't understand about creating PDFs with pdfbox
or FOP does a lot more than pdfbox can do.
 

-Original Message-
From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com] 
Sent: Friday, August 26, 2011 11:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How do you smooth fonts?

On 26/08/2011 13:49, Eric Douglas wrote:

Hi Eric,

 An independent contractor recommended FOP so that was the project I 
 looked at first.
 I have used FOP so I know it works, though I'm sure no one else uses 
 it the same way.
 I just create XML with data including tags to tell it specifically 
 what goes where on each page.
 I've had 2 problems with FOP.
 1) It takes too much memory to generate a really large PDF.  I've had 
 to break up my data and generate multiple PDFs using the initial page 
 sequence tag, then I used pdfbox to piece them together.
 2) The AWT viewer was very inefficient, so I wrote my own.

 I'm not familiar with iText so I don't know if it can generate the 
 PDFs like FOP with the custom embedded fonts, SVG graphics, etc.
 I saw some messages recently on the pdfbox list that people were 
 switching from iText, something about licensing issues.

It could be that PDF Box is more suitable for you. iText and PDFBox are
similar libraries both targetted at creating PDFs. What is clear to me
is that FOP doesn't seem like a good fit for your requirements.

Regards,

Chris


 -Original Message-
 From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com]
 Sent: Friday, August 26, 2011 5:52 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: How do you smooth fonts?

 On 22/08/2011 21:57, Eric Douglas wrote:

 Hi Eric,

 When I transform XSLFO with FOP I can send the output to PDF or AWT 
 and text looks sharp.
 I'm trying to use the same fonts to generate graphics directly since 
 I'm programmatically generating the input to my FOP process and I 
 don't actually need the XSLFO process.

 If you know the position of all your text in advance and don't need 
 XSL-FO, then FOP seems like the wrong tool for the job. Why not use 
 iText, which has an API for creating PDF?
 I know exactly what text I want to print, what size I want it, and 
 exactly where I want it on the page.
 I tried putting the text on an image and putting the image on a Swing

 panel and it always comes out fuzzy.  It's even fuzzier if I try to 
 save that image to a file or send it to a printer.

 I tried using the FOP classes for loading the font, using the 
 Java2DGraphicsState, FontInfo, and FontMetricsMapper objects to 
 generate the text.  It's always rendered blurry.  What could I be
 missing?
 Chris





RE: How do you smooth fonts?

2011-08-25 Thread Eric Douglas
I'm using Java's print.  I thought a printer only has one resolution.
If you print something at a resolution which doesn't match the printer
resolution it just resizes.
I set the resolution on a printout once and it did that, like if the
printout says 300 dpi and the printer says 600 dpi it shrinks it.
 
First, I wrote a report writer.  The report writer object has methods
(print text, draw image, etc) which create report objects specifying
what I'm printing and where on the page it prints.
I use dynamic printing.  I specify how many columns of text to print
across the page.  Then I measure my (fixed width) font (Lucida Sans
Typewriter) to calculate the x/y in point measurement.
Then I wrote a print preview.  My preview panel extends JScrollPane.
On that pane I draw an image using it's paintComponent method.
I create an image with it's createImage method, set the size equal to a
piece of paper and draw that image on the pane's graphics (from the
paint method) with the drawImage method.
Then I just overrode it's print method to pass the printer graphics into
the paintComponent method to print the image (is there another way I
should/could do that?).
I just pass my preview panel directly into print with this generic
method:
 
(printComponent is the preview panel passed in)
 
  PrinterJob myPrinterJob = PrinterJob.getPrinterJob();
  // Possible Exception
  myPrintService = BBsPrinter.getPrintService(myPrinterName);
  PageFormat pf = myPrinterJob.defaultPage();
  Paper paper = new Paper();
  double margin = 36; // half inch
  margin = 0;
  paper.setImageableArea(margin, margin, paper.getWidth() -
margin * 2, paper.getHeight() - margin * 2);
  pf.setPaper(paper);
  try {
   myPrinterJob.setPrintable((Printable)printComponent, pf);
   BBsString.printLogMessage(Printing Printable
Component);
  } catch (Exception e) {
   myPrinterJob.setPrintable(new
PrintComponent(printComponent), pf);
   BBsString.printLogMessage(Printing NonPrintable
Component);
  }
  // Possible PrinterException
  myPrinterJob.setPrintService(myPrintService);
  myPrintRequestAttributeSet = new
HashPrintRequestAttributeSet();
  if (myCopies != null) {
   myPrintRequestAttributeSet.add(myCopies);
  }
  if (myJobName != null) {
   myPrintRequestAttributeSet.add(myJobName);
  }
  if (myPrinterResolution != null) {
   myPrintRequestAttributeSet.add(myPrinterResolution);
  }
  BBsString.printLogMessage(Printing Graphics Page);
  // Possible PrinterException
  myPrinterJob.print(myPrintRequestAttributeSet);


 public static PrintService getPrintService(String printerName)
throws Exception {
  HashPrintServiceAttributeSet myPrintServiceAttributeSet = new
HashPrintServiceAttributeSet();
  myPrintServiceAttributeSet.add(new
PrinterName(printerName,null));
  // returns sun.print.Win32PrintService implements
java.print.PrintService
  PrintService[] printServiceArray =
PrintServiceLookup.lookupPrintServices(myDocFlavor,myPrintServiceAttribu
teSet);
  if (printServiceArray.length == 1) {
   return printServiceArray[0];
  }
  throw new Exception(Printer \ + printerName + \ not
found);
 }




From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] 
Sent: Thursday, August 25, 2011 9:53 AM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: How do you smooth fonts?



Attempt to increase your outgoing resolution (dots per inch).


It may create a larger file and take slightly longer, but the resulting
text may be smoother.

 

-Josh

 

From: Eric Douglas [mailto:edoug...@blockhouse.com] 
Sent: Tuesday, August 23, 2011 7:59 AM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: How do you smooth fonts?

 

I did all those rendering hints.  It still looks like it has a shadow.

 



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, August 23, 2011 1:55 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How do you smooth fonts?

enable font aliasing in whatever layer you are using for rendering

On Mon, Aug 22, 2011 at 2:57 PM, Eric Douglas edoug...@blockhouse.com
wrote:

When I transform XSLFO with FOP I can send the output to PDF or AWT and
text looks sharp. 
I'm trying to use the same fonts to generate graphics directly since I'm
programmatically generating the input to my FOP process and I don't
actually need the XSLFO process.

I know exactly what text I want to print, what size I want it, and
exactly where I want it on the page. 
I tried putting the text on an image and putting the image on a Swing
panel and it always comes out fuzzy.  It's even fuzzier if I try to save
that image to a file or send it to a printer.

I tried using the FOP

FW: Font Graphics? solved

2011-08-25 Thread Eric Douglas
I figured out what I was missing.
You can use GraphicsConfiguration.createCompatibleImage(w,h) to create a
dummy image.
You can use that image's createGraphics() to create a dummy graphics.
You can use that graphics' getFontRenderContext() to get a dummy context
to pass in to java.awt.Font.getStringBounds() to measure a font.
The FontRenderContext by default only measures in integers.
You can set hints on the graphics for antialias and fractional metrics
before getting the context.
My confusion was in thinking the graphics object was linked to the image
object.
If you do the createGraphics, then set the hints, then call
createGraphics (or getGraphics) again it gets a new graphics.  It
doesn't keep the hints.


-Original Message-
From: Eric Douglas 
Sent: Wednesday, August 24, 2011 11:24 AM
To: 'fop-dev@xmlgraphics.apache.org'
Subject: Font Graphics?

I'm sure this is getting a bit off topic but I was wondering if someone
here could help me understand this.
I'm guessing someone here has a better understanding of font graphics
since I started trying to understand it by digging through the FOP
classes used for loading custom fonts and displaying them in the AWT
viewer.

I'm trying to use this code:
  fontGraphics.setFont(baseFont);
  frc = fontGraphics.getFontRenderContext();
  Rectangle2D r2d = baseFont.getStringBounds(A, frc);
  baseCharWidth = r2d.getWidth();

I need this value in 2 places.
The second place works fine.  baseCharWidth gets a value of 0.60253906
which is what I want.
The first place returns a value of 1.0.
The baseFont object is the same java.awt.Font object in both places.
The fontGraphics in both places is created from a
bufferedImage.getGraphics().
So the only difference is the BufferedImage.
The second one creates the image from a
javax.swing.JPanel(java.awt.Component).createImage(w,h).
The first one doesn't have any GUI yet so I created a dummy image from a
GraphicsConfiguration.createCompatibleImage(w,h).

What am I missing?


RE: How do you smooth fonts?

2011-08-25 Thread Eric Douglas
Ok, your resolution hint helped me fix the problem though I don't
particularly like the answer.
The printer doesn't render text all that well at 100% resolution.
What I did, in my panel's print method I call my paint method with a
zoom x 4, then I let the graphics engine scale it back down and it looks
sharper.
myGraphics2D.scale(.25, .25);




From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] 
Sent: Thursday, August 25, 2011 9:53 AM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: How do you smooth fonts?



Attempt to increase your outgoing resolution (dots per inch).


It may create a larger file and take slightly longer, but the resulting
text may be smoother.

 

-Josh

 

From: Eric Douglas [mailto:edoug...@blockhouse.com] 
Sent: Tuesday, August 23, 2011 7:59 AM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: How do you smooth fonts?

 

I did all those rendering hints.  It still looks like it has a shadow.

 



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, August 23, 2011 1:55 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How do you smooth fonts?

enable font aliasing in whatever layer you are using for rendering

On Mon, Aug 22, 2011 at 2:57 PM, Eric Douglas edoug...@blockhouse.com
wrote:

When I transform XSLFO with FOP I can send the output to PDF or AWT and
text looks sharp. 
I'm trying to use the same fonts to generate graphics directly since I'm
programmatically generating the input to my FOP process and I don't
actually need the XSLFO process.

I know exactly what text I want to print, what size I want it, and
exactly where I want it on the page. 
I tried putting the text on an image and putting the image on a Swing
panel and it always comes out fuzzy.  It's even fuzzier if I try to save
that image to a file or send it to a printer.

I tried using the FOP classes for loading the font, using the
Java2DGraphicsState, FontInfo, and FontMetricsMapper objects to generate
the text.  It's always rendered blurry.  What could I be missing?

 



The information in this message may be proprietary and/or confidential,
and protected from disclosure. If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering
this message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify First Data immediately by replying to this message and deleting
it from your computer. 



Font Graphics?

2011-08-24 Thread Eric Douglas
I'm sure this is getting a bit off topic but I was wondering if someone
here could help me understand this.
I'm guessing someone here has a better understanding of font graphics
since I started trying to understand it by digging through the FOP
classes used for loading custom fonts and displaying them in the AWT
viewer.

I'm trying to use this code:
  fontGraphics.setFont(baseFont);
  frc = fontGraphics.getFontRenderContext();
  Rectangle2D r2d = baseFont.getStringBounds(A, frc);
  baseCharWidth = r2d.getWidth();

I need this value in 2 places.
The second place works fine.  baseCharWidth gets a value of 0.60253906
which is what I want.
The first place returns a value of 1.0.
The baseFont object is the same java.awt.Font object in both places.
The fontGraphics in both places is created from a
bufferedImage.getGraphics().
So the only difference is the BufferedImage.
The second one creates the image from a
javax.swing.JPanel(java.awt.Component).createImage(w,h).
The first one doesn't have any GUI yet so I created a dummy image from a
GraphicsConfiguration.createCompatibleImage(w,h).

What am I missing?


RE: How do you smooth fonts?

2011-08-23 Thread Eric Douglas
I did all those rendering hints.  It still looks like it has a shadow.



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, August 23, 2011 1:55 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: How do you smooth fonts?


enable font aliasing in whatever layer you are using for rendering


On Mon, Aug 22, 2011 at 2:57 PM, Eric Douglas edoug...@blockhouse.com
wrote:




When I transform XSLFO with FOP I can send the output to PDF or
AWT and text looks sharp. 
I'm trying to use the same fonts to generate graphics directly
since I'm programmatically generating the input to my FOP process and I
don't actually need the XSLFO process.

I know exactly what text I want to print, what size I want it,
and exactly where I want it on the page. 
I tried putting the text on an image and putting the image on a
Swing panel and it always comes out fuzzy.  It's even fuzzier if I try
to save that image to a file or send it to a printer.

I tried using the FOP classes for loading the font, using the
Java2DGraphicsState, FontInfo, and FontMetricsMapper objects to generate
the text.  It's always rendered blurry.  What could I be missing?




How do you smooth fonts?

2011-08-22 Thread Eric Douglas
When I transform XSLFO with FOP I can send the output to PDF or AWT and
text looks sharp.
I'm trying to use the same fonts to generate graphics directly since I'm
programmatically generating the input to my FOP process and I don't
actually need the XSLFO process.
I know exactly what text I want to print, what size I want it, and
exactly where I want it on the page.
I tried putting the text on an image and putting the image on a Swing
panel and it always comes out fuzzy.  It's even fuzzier if I try to save
that image to a file or send it to a printer.
I tried using the FOP classes for loading the font, using the
Java2DGraphicsState, FontInfo, and FontMetricsMapper objects to generate
the text.  It's always rendered blurry.  What could I be missing?


RE: should complex script features be enabled or disabled by default?

2011-07-20 Thread Eric Douglas
I don't use command line.
I don't use a configuration file.
Effect on embedded code?



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, July 19, 2011 7:18 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: should complex script features be enabled or disabled by
default?


well, the consensus seems to enable by default, which I have now done;
to disable, there are two methods: 

(1) use '-nocs' option on command line
(2) use complex-scripts disabled=true/ in configuration file

this will go into my next patch to the Temp_ComplexScripts branch


On Tue, Jul 19, 2011 at 4:58 PM, J.Pietschmann j3322...@yahoo.de
wrote:


Am 19.07.2011 09:51, schrieb Jeremias Maerki: 


I'd enable it by default. I think that results in fewer
questions and
performance freaks can always disable it if you can make
it configurable.



I had the same thoughts.

J.Pietschmann






RE: Which came first, the chicken or the egg?

2011-07-20 Thread Eric Douglas
I don't know what you're talking about but it sounds like you don't know
what you're talking about.
AFAIK maven is a tool.  I have yet to see a source package reference
maven in build dependancies.
Ant is a dependancies.  If I don't specifically have ant in the Build
Path I can't compile FOP.  I get 55 errors on version 1.0.
Ant is open source or there wouldn't be this discussion.  I downloaded
the source to FOP to compile my own jar, initially because the compiled
jar offered didn't work because it included a classpath in the manifest
and I'm using it with other software which has it's own classpath
builder.
To compile FOP I added all the classes it needed in the build path (gets
errors without them).  I downloaded them as source if they made the
source available and for one or two old jars I couldn't find a source I
grabbed a compiled jar.  Ant has source you can download.  It is open
source.  Don't speak for the open source community.
Your response has nothing to do with the question (why the circular
reference?).  The discussion didn't need your two cents.


-Original Message-
From: Benson Margulies [mailto:bimargul...@gmail.com] 
Sent: Wednesday, July 20, 2011 2:47 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Which came first, the chicken or the egg?

 I assume either the FOP developers know why there's a circular 
 reference and have the resolution or they just use the compiled jars 
 and ignore the issue.

Just about the entire open source community disagrees with you.
Everyone treats ant, maven, and (for that matter) gcc as opaque
packages, not as source dependencies. It's a tool.


RE: should complex script features be enabled or disabled by default?

2011-07-19 Thread Eric Douglas
Good call.  You'll get more questions enabling it by default if most people 
don't need it and it has a significant performance impact.
Why is this new version so much slower?
To my users, applications not crashing is the number one priority.  Performance 
is number two.
 

-Original Message-
From: Pascal Sancho [mailto:pascal.san...@takoma.fr] 
Sent: Tuesday, July 19, 2011 4:08 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: should complex script features be enabled or disabled by default?

Hi Glenn,

IMHO, the default setting should depend on how much it affects the performances.
Can you give an approximative impact?


Le 19/07/2011 03:40, Glenn Adams a écrit :
 I'm adding a feature to allow enable/disable of complex script 
 features (bidi, complex char to glyph mapping) at runtime, using 
 either (or both) command line option and config file element; the 
 question I have is whether to enable or disable by default?
 
 If enabled by default, those who don't use complex scripts or don't 
 want advanced typography features in non-complex scripts will incur a 
 minor performance penalty.
 
 If disabled by default, then those users who use complex scripts or 
 want advanced typography features in non-complex scripts will need to 
 do something special to enable this support.
 
 What does the group think? I don't have a strong preference either way.
 
 G.
 

--
Pascal


Which came first, the chicken or the egg?

2011-07-19 Thread Eric Douglas
If I try to compile fop source it says it requires ant.
If I download the source for ant and try to compile it says it requires
bsf.
If I download the source for bsf and try to compile it says it requires
jython.
If I download the source for jython and try to compile it says it
requires ant.



RE: Which came first, the chicken or the egg?

2011-07-19 Thread Eric Douglas
The circular referencing doesn't make sense, but I'm compiling in
Eclipse Helios on Windows XP. 
I found that Eclipse does come with an ant folder under it's plugin path
so I started with the ant.jar from there.


-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Tuesday, July 19, 2011 9:08 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Which came first, the chicken or the egg?

Hi Eric,

What operating system are you working on? You probably don't need to
compile ant, there will almost definitely be binaries for your operating
system.

Mehdi

On 19 July 2011 13:58, Eric Douglas edoug...@blockhouse.com wrote:
 If I try to compile fop source it says it requires ant.
 If I download the source for ant and try to compile it says it
requires bsf.
 If I download the source for bsf and try to compile it says it 
 requires jython.
 If I download the source for jython and try to compile it says it 
 requires ant.


RE: Which came first, the chicken or the egg?

2011-07-19 Thread Eric Douglas
I've tried to reference a source project rather than a compiled jar
wherever possible.
The annoying part of referencing the compiled jar is when I run from the
IDE in debug mode and it pops up windows saying no code attached.
Plus I thought it made more sense to have the source for everything open
sourced in case there's any reusable code or any confusion on what the
methods do.


-Original Message-
From: Benson Margulies [mailto:bimargul...@gmail.com] 
Sent: Tuesday, July 19, 2011 10:49 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Which came first, the chicken or the egg?

Eric,

Unless you are working on Gentoo Linux, you should not even consider
this path. Just download ant. Ant, being a build tool, has a complex
bootstrap process. ant.apache.org will provide you with a zip file with
a perfectly working copy of Ant you can use.



On Tue, Jul 19, 2011 at 10:38 AM, Eric Douglas edoug...@blockhouse.com
wrote:
 The circular referencing doesn't make sense, but I'm compiling in 
 Eclipse Helios on Windows XP.
 I found that Eclipse does come with an ant folder under it's plugin 
 path so I started with the ant.jar from there.


 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Tuesday, July 19, 2011 9:08 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Which came first, the chicken or the egg?

 Hi Eric,

 What operating system are you working on? You probably don't need to 
 compile ant, there will almost definitely be binaries for your 
 operating system.

 Mehdi

 On 19 July 2011 13:58, Eric Douglas edoug...@blockhouse.com wrote:
 If I try to compile fop source it says it requires ant.
 If I download the source for ant and try to compile it says it
 requires bsf.
 If I download the source for bsf and try to compile it says it 
 requires jython.
 If I download the source for jython and try to compile it says it 
 requires ant.



RE: Which came first, the chicken or the egg?

2011-07-19 Thread Eric Douglas
I assume either the FOP developers know why there's a circular reference
and have the resolution or they just use the compiled jars and ignore
the issue.
Starting with the compiled ant.jar which comes with the Eclipse download
resolved the issue even though it didn't answer the question.
Thanks

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Tuesday, July 19, 2011 11:23 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Which came first, the chicken or the egg?

Hi Eric,

Well, that kind of depends on how you work. It's always good to have the
source at hand if you want to look, but realistically, you're never
going to delve into the ant code. If you want further help, could you
post on the ant forums, this isn't a FOP issue.

Sorry if not helped,

Mehdi

On 19 July 2011 16:09, Eric Douglas edoug...@blockhouse.com wrote:
 I've tried to reference a source project rather than a compiled jar 
 wherever possible.
 The annoying part of referencing the compiled jar is when I run from 
 the IDE in debug mode and it pops up windows saying no code attached.
 Plus I thought it made more sense to have the source for everything 
 open sourced in case there's any reusable code or any confusion on 
 what the methods do.


 -Original Message-
 From: Benson Margulies [mailto:bimargul...@gmail.com]
 Sent: Tuesday, July 19, 2011 10:49 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Which came first, the chicken or the egg?

 Eric,

 Unless you are working on Gentoo Linux, you should not even consider 
 this path. Just download ant. Ant, being a build tool, has a complex 
 bootstrap process. ant.apache.org will provide you with a zip file 
 with a perfectly working copy of Ant you can use.



 On Tue, Jul 19, 2011 at 10:38 AM, Eric Douglas 
 edoug...@blockhouse.com
 wrote:
 The circular referencing doesn't make sense, but I'm compiling in 
 Eclipse Helios on Windows XP.
 I found that Eclipse does come with an ant folder under it's plugin 
 path so I started with the ant.jar from there.


 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Tuesday, July 19, 2011 9:08 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Which came first, the chicken or the egg?

 Hi Eric,

 What operating system are you working on? You probably don't need to 
 compile ant, there will almost definitely be binaries for your 
 operating system.

 Mehdi

 On 19 July 2011 13:58, Eric Douglas edoug...@blockhouse.com wrote:
 If I try to compile fop source it says it requires ant.
 If I download the source for ant and try to compile it says it
 requires bsf.
 If I download the source for bsf and try to compile it says it 
 requires jython.
 If I download the source for jython and try to compile it says it 
 requires ant.




RE: Fop Memory Leak

2011-05-27 Thread Eric Douglas
That would defeat the purpose.  It appears stopRenderer gets called in
the transform method.  After the transform I need to get the Viewport
values to generate page images.
It appears the transform increases memory use temporarily, releasing it
when done.  It was just increasing my heap size on subsequent calls
because I was using additional memory between calls so I was closer to
the limit.
The additional memory was in the class I was using to call the class
doing the rendering.  I was getting a copy of the image in an array used
to display on a GUI window.  I wasn't clearing that array so it was
holding the old references.
My memory problem now is just in the proprietary API I'm using (an
extension of Oracle's webstart) where I do that rendering on a server
then serialize it to a client to display.  That render hits a memory
limit I'm not sure why.



From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] 
Sent: Friday, May 27, 2011 11:08 AM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: Fop Memory Leak



Eric-

 

On the PNGRenderer code, the method stopRenderer() does not run a
similar cleanup that TIFFRenderer (which also extends Java2DRenderer)
calls.

 

At the end of the TIFFRenderer method,   

 

clearViewportList();

 

is called.

 

Can you try extending PNGRenderer with a custom renderer that overrides
the stopRenderer() method with

 

public void stopRenderer() throws IOException {

super.stopRenderer();

clearViewportList();

}

 

And see if that helps?

 

I don't see it in trunk, and this is 100% guesswork on my part, and it
could completely screw up PNGs created, but it might work.  J

 

-Josh

 

 

From: Eric Douglas [mailto:edoug...@blockhouse.com] 
Sent: Thursday, May 26, 2011 10:03 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Fop Memory Leak

 

I could use some help tracking this down.  I created a Print Preview
program but it just runs out of memory after a dozen or two pages.

I started with a program which generates XML data, transforms it into FO
data, then transforms that. 
There are 2 transforms in it, one to create a PDF and one for Print
Preview. 
When I tried to create a large FO and generate a PDF of 1000+ pages it
crashed, out of memory. 
I changed it to break the output.  It now stores an array of FO files
for no more than 10 pages each, using XSL's intiial-page-number to store
a starting point for each document fragment.

To create a PDF I call the transformer to get the PDF from the Fop
output stream in byte format for each FO.  Then I load them into PDF
objects using the pfdbox project, create a new PDF with it and copy in
the pages to merge them.

This works great for PDF.  I was able to generate a report this way of
over 1800 pages. 
Now I try it for print preview, generating 10 pages at a time, calling
the render process again when a new size or a page from a different
block is requested.

The memory use never drops on these calls but in 2 places I see it
jumping up, whenever it calls Transformer.transform with a PNGRenderer,
and whenever I try to create a new image for a page even though I'm only
generating 10 pages and on each render I replace the previous array of
images.

If I do something as simple as this the memory jumps up sometimes on the
create. 
myBufferedImage = myImageArray.get(pageNum); 
myBufferedImage.flush(); 
myBufferedImage = new
BufferedImage(sameWidthAsOldImage,sameHeightAsOldImage); 
It does this if I call PNGRenderer.getPageImage(pageNum) (from
Java2DRenderer), so I tried creating the BufferedImage (or VolatileImage
same issue) myself and using the Java2DRenderer.print method to draw the
page on it.  Memory use keeps increasing on the image create and on the
transform.

The transform is all done in one method, with only the FopFactory and
TransformerFactory remaining (created static final to the class) after
the method so a second call shouldn't use any more than the first.



The information in this message may be proprietary and/or confidential,
and protected from disclosure. If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering
this message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify First Data immediately by replying to this message and deleting
it from your computer. 



Fop Memory Leak

2011-05-26 Thread Eric Douglas
I could use some help tracking this down.  I created a Print Preview
program but it just runs out of memory after a dozen or two pages.
I started with a program which generates XML data, transforms it into FO
data, then transforms that.
There are 2 transforms in it, one to create a PDF and one for Print
Preview.
When I tried to create a large FO and generate a PDF of 1000+ pages it
crashed, out of memory.
I changed it to break the output.  It now stores an array of FO files
for no more than 10 pages each, using XSL's intiial-page-number to store
a starting point for each document fragment.
To create a PDF I call the transformer to get the PDF from the Fop
output stream in byte format for each FO.  Then I load them into PDF
objects using the pfdbox project, create a new PDF with it and copy in
the pages to merge them.
This works great for PDF.  I was able to generate a report this way of
over 1800 pages.
Now I try it for print preview, generating 10 pages at a time, calling
the render process again when a new size or a page from a different
block is requested.
The memory use never drops on these calls but in 2 places I see it
jumping up, whenever it calls Transformer.transform with a PNGRenderer,
and whenever I try to create a new image for a page even though I'm only
generating 10 pages and on each render I replace the previous array of
images.
If I do something as simple as this the memory jumps up sometimes on the
create.
myBufferedImage = myImageArray.get(pageNum);
myBufferedImage.flush();
myBufferedImage = new
BufferedImage(sameWidthAsOldImage,sameHeightAsOldImage);
It does this if I call PNGRenderer.getPageImage(pageNum) (from
Java2DRenderer), so I tried creating the BufferedImage (or VolatileImage
same issue) myself and using the Java2DRenderer.print method to draw the
page on it.  Memory use keeps increasing on the image create and on the
transform.
The transform is all done in one method, with only the FopFactory and
TransformerFactory remaining (created static final to the class) after
the method so a second call shouldn't use any more than the first.


Trunk won't compile?

2011-05-25 Thread Eric Douglas
What is this missing?
When I right click the build.xml in Eclipse and select Run As  ant
build, I get jars created but the log ends with BUILD FAILED.
I scroll up to see some errors and there's messages like this.
[junit] Testcase:
page-number_background-image.xml(org.apache.fop.intermediate.IFParserTes
tCase): Caused an ERROR
[junit]
org.apache.fop.area.inline.TextArea.addTrait(Ljava/lang/Object;Ljava/lan
g/Object;)V
[junit] java.lang.NoSuchMethodError:
org.apache.fop.area.inline.TextArea.addTrait(Ljava/lang/Object;Ljava/lan
g/Object;)V
[junit] at
org.apache.fop.layoutmgr.inline.PageNumberLayoutManager.get(PageNumberLa
youtManager.java:87)
That doesn't make sense.  That line 87 is this.
text.addTrait(Trait.COLOR, fobj.getColor());
That looks like it's passing Object,Object.
text is a TextArea which extends AbstractTextArea which extends
InlineParent which extends InlineArea which extends Area which has a
method addTrait(Object,Object).



RE: DO NOT REPLY [Bug 51266] New: generate xsl to fo conversion problem

2011-05-25 Thread Eric Douglas
That's not a bug.  That's a normal message returned from processing.
There can be no answer unless you attach a sample of the input you
provided. 

-Original Message-
From: bugzi...@apache.org [mailto:bugzi...@apache.org] 
Sent: Wednesday, May 25, 2011 11:31 AM
To: fop-dev@xmlgraphics.apache.org
Subject: DO NOT REPLY [Bug 51266] New: generate xsl to fo conversion
problem

https://issues.apache.org/bugzilla/show_bug.cgi?id=51266

 Bug #: 51266
   Summary: generate xsl to fo conversion problem
   Product: Fop
   Version: all
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: fo tree
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: vinod.pachp...@credentek.com
Classification: Unclassified


I give the command
sh /home/vinod/FOP/fop-1.0/fop -xsl rapg_internal.xsl -xml
oldxmlformat.xml -pdf myfile.pdf

But I got error as follows :


25 May, 2011 8:56:00 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException:
First element must be the fo:root formatting object. Found (Namespace
URI: , Local
Name: head) instead. Please make sure you're producing a valid XSL-FO
document.
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: First element must be the fo:root
formatting object. Found (Namespace URI: , Local Name: head)
instead.
Please make sure you're producing a valid XSL-FO document.
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:302)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
at org.apache.fop.cli.Main.startFOP(Main.java:174)
at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: First element must be the fo:root
formatting object. Found (Namespace URI: , Local Name: head)
instead.
Please make sure you're producing a valid XSL-FO document.
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1323)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1374)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transfo
rmerImpl.java:2281)
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
pl.java:1367)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:709)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1284)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1262)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: First element must be
the fo:root formatting object. Found (Namespace URI: , Local Name:
head) instead. Please make sure you're producing a valid XSL-FO
document.
at
org.apache.fop.events.ValidationExceptionFactory.createException(Validat
ionExceptionFactory.java:38)
at
org.apache.fop.events.EventExceptionManager.throwException(EventExceptio
nManager.java:54)
at
org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroad
caster.java:175)
at $Proxy0.invalidFORoot(Unknown Source)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder
.java:261)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:171)
at
org.apache.xml.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.
java:204)
at
org.apache.xml.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:27
7)
at
org.apache.xml.serializer.ToXMLSAXHandler.startPrefixMapping(ToXMLSAXHan
dler.java:348)
at
org.apache.xml.serializer.ToXMLSAXHandler.startPrefixMapping(ToXMLSAXHan
dler.java:318)
at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1315)
... 12 more

Please give me solution.

--
Configure bugmail:
https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: --- You are the
assignee for the bug.


RE: Fop Memory Use

2011-05-20 Thread Eric Douglas
Appears to be solved.
 
I believe I've found where the memory went.
The PNGRenderer needs a lot of memory to transform large documents.
If I'm reading this right, from the results of JVisualVM, the memory use is the 
pixel size.
The PNGRender stores every page as an image, which can be retrieved with 
getPageImage(pageNumber).
That image translates to 72 pixels per inch.
For an 11 x 8.5 document that's 11 (792) x 8.5 (612) = 484704.
It appears the images contain those int[] arrays and use up that amount 
(484704) x 4 + 16 bytes ( = 1938832)
I'm saving those images for print preview and loading them into a GUI window 
with a zoom.
For the zoom I'm just resizing the image with Java's Graphics2D.drawImage.
If I redraw that to a larger size it gets a bit blurry.  To help reduce that I 
was sizing the initial image.
Fop generates a larger image if I set the methods on the FOUserAgent 
(setSourceResolution(72), setTargetResolution(144)).
Plug that into the same calculation and it quadruples the memory use ((792 * 2 
= 1584) * (612 * 2 = 1224)) * 4 + 16 = 7755280 bytes per page.
For a 100 page report that's a ton.
I am generating my own input (it's a custom report writer) so I know exactly 
what fits on a page.  I'm writing everything with hard page breaks and absolute 
positioning.
I already had a memory problem just trying to create a PDF when I got around 
150 pages so I solved that by breaking it up.
I now transform all output 10 pages at a time, creating multiple PDFs (in 
memory) with xsl's initial-page-number then use pdfbox to put the pages 
together.
The FO actually wasn't using much memory, just something Fop was doing when I 
tried to use that FO to generate a parge PDF all at once.
So, I just save my FO files in an array and generate the PNG page images no 
more than 10 at a time and I've limited memory use!
I'm using the PNG to split the process so I can generate output on one machine 
(server) and display it on another (client).
If I only need to transform part of the document, and it's not taking much more 
than the Graphics2D redraw, I can just call the render again for new page 
requests so no more fuzzy images.



From: Georg Datterl [mailto:georg.datt...@geneon.de] 
Sent: Thursday, May 19, 2011 12:22 AM
To: fop-dev@xmlgraphics.apache.org
Subject: AW: Fop Memory Use



Hi Eric,

 

That sounds interesting. If you run the transformer for each page and set a 
breakpoint after the first run, there (IMHO) should not be a reference to any 
fop object. Ignore the int[]s first, they are used everywhere. Concentrate on 
the fop objects which should not be there. You could as well run your 
transformation X times and then investigate all objects which exists exactly X 
(or Y*X) times in memory. Those  are probably accumulated over many runs and 
crash your application sooner or later.

 

Regards,

 

Georg Datterl

 

-- Kontakt --

 

Georg Datterl

 

Geneon media solutions gmbh

Gutenstetter Straße 8a

90449 Nürnberg

 

HRB Nürnberg: 17193

Geschäftsführer: Yong-Harry Steiert 

 

Tel.: 0911/36 78 88 - 26

Fax: 0911/36 78 88 - 20

 

www.geneon.de

 

Weitere Mitglieder der Willmy MediaGroup:

 

IRS Integrated Realization Services GmbH:www.irs-nbg.de 
http://www.irs-nbg.de  

Willmy PrintMedia GmbH:  www.willmy.de 
http://www.willmy.de 

Willmy Consult  Content GmbH:   www.willmycc.de 
http://www.willmycc.de  

 

Von: Eric Douglas [mailto:edoug...@blockhouse.com] 
Gesendet: Mittwoch, 18. Mai 2011 19:43
An: fop-dev@xmlgraphics.apache.org
Betreff: RE: Fop Memory Use

 

This test run isn't using SVG at all.  The PDFRenderer is working, the 
PNGRenderer runs out of memory, so it is using images but as output.

I already broke up the input to multiple FOs with multiple calls to the 
transform to generate a large document by combining small documents using the 
initial-page-number.

As the program runs it just keeps increasing memory use.

I tried running a profile with Java's VisualVM though I'm not sure what exactly 
I'm looking at or what to do with it.

The number one item showing memory hog in the profiler, as of my last snapshot 
was: class int[], live bytes 23,273,952 B, live objects 382, generations 10

After the program crashed with the profiler running I had an additional file 
opened, Java2DRenderer.class, so I'm assuming it's doing something that breaks 
PNGRenderer.

My class doesn't have any int[] references.

After that first reference the sizes drop off sharply in the profiler.  The 
next class reference is char[], then org.apache.fop.area.inline.SpaceArea.

 

 



From: Peter Hancock [mailto:peter.hanc...@gmail.com] 
Sent: Wednesday, May 18, 2011 12:05 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Fop Memory Use

Hi Eric,

Does your document contain many large SVG's?  If so take a look at  Bugzilla 
#46360.  This issue was resolved in rev 997602 of FOP trunk.

Pete

Fop Memory Use

2011-05-18 Thread Eric Douglas
I am using Fop 1.0.
I tried using Fop to transform a single document.  When I got a little
over 100 pages my FO file was over 5 MB.  The transform crashed with a
Java heap out of memory error.
I managed to break the input down, as I'm using embedded code generating
the input programmatically, and the PDF output is a lot smaller.
So I'm currently transforming 10 pages at a time, setting the
initial-page-number to the next sequence (1, 11, 21, etc).
Then I save all the generated PDFs in memory and merge them using
pdfbox.  So far this is working great.

I tried to do the same thing with the PNGRenderer, just calling a method
to transform 10 pages at a time and save the output images in an array.
The PNGRenderer is created locally in the method.  It should be getting
released when the method ends but the java process never releases any
memory.
I tested a 90 page report and the memory use was over 1 GB.  I tested on
another machine where the memory limit is apparently lower and it
crashed on page 24.
Everything about the method to render to PNG is the same as the method
to render to PDF aside from the Renderer.
Is there a problem with this renderer or something I could need to do
different?


RE: Fop Memory Use

2011-05-18 Thread Eric Douglas
I don't know when it does it's automatic garbage collection if that's
the only issue.
I tried adding the statement to tell it to garbage collect right after
calling the method to render to PNG, though I believe I heard that
doesn't actually do garbage collection right when that executes.  It
didn't appear to do anything.
I'm running Java 6 Update 24.
 
I tested it straight in Eclipse and even tried debug mode so it takes
longer and watched it create a javaw.exe process in task manager which
just kept going up on memory use.
No matter how slowly I went through the program in debug mode the memory
never went down so I expect that means it didn't garbage collect or the
PNGRenderer is preventing some garbage from getting collected.
The Renderer itself should be created and destroyed in the method that
transforms.
The transform method looks a lot like the PDFRenderer method which works
fine.
Why could I not create and save more than a couple dozen pages in PNG
when I just tested a 1986 page report to PDF?
When I render it to preview I am also rendering it to PDF so I can
generate a print preview screen and be able to send to PDF/printer
without rerunning it, but when I run a test program to generate 91 page
output from Eclipse and watch the java process it creates in the task
manager, memory use just generating a PDF got up to 294 MB while the
preview got over 1 GB.
 



From: Michael Rubin [mailto:mru...@thunderhead.com] 
Sent: Wednesday, May 18, 2011 8:24 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Fop Memory Use



Just a wild thought. But is there a way you could possibly get the JVM
to garbage collect between each run? Maybe that might free the memory
up?

Thanks.

-Mike

On 18/05/11 13:20, Eric Douglas wrote: 

I am using Fop 1.0. 
I tried using Fop to transform a single document.  When I got a
little over 100 pages my FO file was over 5 MB.  The transform crashed
with a Java heap out of memory error.

I managed to break the input down, as I'm using embedded code
generating the input programmatically, and the PDF output is a lot
smaller.

So I'm currently transforming 10 pages at a time, setting the
initial-page-number to the next sequence (1, 11, 21, etc).

Then I save all the generated PDFs in memory and merge them
using pdfbox.  So far this is working great. 

I tried to do the same thing with the PNGRenderer, just calling
a method to transform 10 pages at a time and save the output images in
an array.

The PNGRenderer is created locally in the method.  It should be
getting released when the method ends but the java process never
releases any memory.

I tested a 90 page report and the memory use was over 1 GB.  I
tested on another machine where the memory limit is apparently lower and
it crashed on page 24.

Everything about the method to render to PNG is the same as the
method to render to PDF aside from the Renderer. 
Is there a problem with this renderer or something I could need
to do different? 




Michael Rubin

Developer

 Thunderhead
Logohttp://thunderhead.com/email_signature/images/Thunderhead-logo.png
Taglinehttp://thunderhead.com/email_signature/images/make-every-communi
cation-count.png
Triangleshttp://thunderhead.com/email_signature/images/triangles.png  
 T

 F

 M

 E

 W

+44 20 8238 7400 

+44 20 8238 7401 

 

mru...@thunderhead.com 

www.thunderhead.com http://www.thunderhead.com   

Thunderhead featured in The Sunday Times Profit Track 100 league table
of companies with fastest-growing profits. Click here
http://www.fasttrack.co.uk/fasttrack/press/pt11-lon.pdf  to read more.


LinkedIn http://www.linkedin.com/companies/25033/Thunderhead  twitter
http://twitter.com/Thunderheadon RSS
http://www.thunderhead.com/rss/rss.php YouTube
http://www.youtube.com/user/ThunderheadOn
http://thunderheadinnovate.wordpress.com/  were-hiring
http://thunderhead.com/about/careers.php  
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the
named addressee or an authorized designee, you may not copy or use it,
or disclose it to anyone else. If you received it in error please notify
us immediately and then destroy it.



RE: Fop Memory Use

2011-05-18 Thread Eric Douglas
If there's no obvious answer as to what Fop might be doing wrong or what I 
might be doing wrong that would be my next guess, except I've never done that 
so I'd have to figure out how.



From: Georg Datterl [mailto:georg.datt...@geneon.de] 
Sent: Wednesday, May 18, 2011 10:25 AM
To: fop-dev@xmlgraphics.apache.org
Subject: AW: Fop Memory Use



Hi Eric,

 

I'd run a debugger (available with modern JDKs). Set a breakpoint after the 
first run and memory profiling should tell you, which objects are still in 
memory and why.

 

Regards,

 

Georg Datterl

 

-- Kontakt --

 

Georg Datterl

 

Geneon media solutions gmbh

Gutenstetter Straße 8a

90449 Nürnberg

 

HRB Nürnberg: 17193

Geschäftsführer: Yong-Harry Steiert 

 

Tel.: 0911/36 78 88 - 26

Fax: 0911/36 78 88 - 20

 

www.geneon.de

 

Weitere Mitglieder der Willmy MediaGroup:

 

IRS Integrated Realization Services GmbH:www.irs-nbg.de 
http://www.irs-nbg.de  

Willmy PrintMedia GmbH:  www.willmy.de 
http://www.willmy.de 

Willmy Consult  Content GmbH:   www.willmycc.de 
http://www.willmycc.de  

 

Von: Eric Douglas [mailto:edoug...@blockhouse.com] 
Gesendet: Mittwoch, 18. Mai 2011 16:12
An: fop-dev@xmlgraphics.apache.org
Betreff: RE: Fop Memory Use

 

When I tested over 130 pages the PNG render crashed with this dump.

 

Exception in thread main java.lang.OutOfMemoryError: Java heap space
 at java.lang.AbstractStringBuilder.init(AbstractStringBuilder.java:45)
 at java.lang.StringBuilder.init(StringBuilder.java:92)
 at org.apache.fop.area.inline.SpaceArea.init(SpaceArea.java:43)
 at org.apache.fop.area.inline.TextArea.addSpace(TextArea.java:82)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager$TextAreaBuilder.addSpaces(TextLayoutManager.java:578)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager$TextAreaBuilder.setText(TextLayoutManager.java:497)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager$TextAreaBuilder.build(TextLayoutManager.java:442)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager$TextAreaBuilder.access$1(TextLayoutManager.java:435)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager.addAreaInfoAreas(TextLayoutManager.java:369)
 at 
org.apache.fop.layoutmgr.inline.TextLayoutManager.addAreas(TextLayoutManager.java:297)
 at 
org.apache.fop.layoutmgr.inline.InlineLayoutManager.addAreas(InlineLayoutManager.java:479)
 at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.addInlineArea(LineLayoutManager.java:1561)
 at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.addAreas(LineLayoutManager.java:1430)
 at 
org.apache.fop.layoutmgr.BlockLayoutManager.addAreas(BlockLayoutManager.java:389)
 at 
org.apache.fop.layoutmgr.AreaAdditionUtil.addAreas(AreaAdditionUtil.java:121)
 at 
org.apache.fop.layoutmgr.BlockContainerLayoutManager$BlockContainerBreaker.addAreas(BlockContainerLayoutManager.java:939)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:626)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:497)
 at 
org.apache.fop.layoutmgr.BlockContainerLayoutManager$BlockContainerBreaker.addContainedAreas(BlockContainerLayoutManager.java:965)
 at 
org.apache.fop.layoutmgr.BlockContainerLayoutManager.addAreas(BlockContainerLayoutManager.java:1158)
 at 
org.apache.fop.layoutmgr.BlockLayoutManager.addAreas(BlockLayoutManager.java:389)
 at 
org.apache.fop.layoutmgr.AreaAdditionUtil.addAreas(AreaAdditionUtil.java:121)
 at 
org.apache.fop.layoutmgr.FlowLayoutManager.addAreas(FlowLayoutManager.java:342)
 at org.apache.fop.layoutmgr.PageBreaker.addAreas(PageBreaker.java:280)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:626)
 at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:497)
 at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:308)
 at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:450)
 at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85)
 at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
 at 
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
 at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120) 



 



RE: Fop Memory Use

2011-05-18 Thread Eric Douglas
This test run isn't using SVG at all.  The PDFRenderer is working, the
PNGRenderer runs out of memory, so it is using images but as output.
I already broke up the input to multiple FOs with multiple calls to the
transform to generate a large document by combining small documents
using the initial-page-number.
As the program runs it just keeps increasing memory use.
I tried running a profile with Java's VisualVM though I'm not sure what
exactly I'm looking at or what to do with it.
The number one item showing memory hog in the profiler, as of my last
snapshot was: class int[], live bytes 23,273,952 B, live objects 382,
generations 10
After the program crashed with the profiler running I had an additional
file opened, Java2DRenderer.class, so I'm assuming it's doing something
that breaks PNGRenderer.
My class doesn't have any int[] references.
After that first reference the sizes drop off sharply in the profiler.
The next class reference is char[], then
org.apache.fop.area.inline.SpaceArea.
 



From: Peter Hancock [mailto:peter.hanc...@gmail.com] 
Sent: Wednesday, May 18, 2011 12:05 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Fop Memory Use


Hi Eric,

Does your document contain many large SVG's?  If so take a look at
Bugzilla #46360.  This issue was resolved in rev 997602 of FOP trunk.

Pete





On Wed, May 18, 2011 at 5:10 PM, Adrian Cumiskey
adrian.cumis...@gmail.com wrote:


Hi Eric,

Fop calculates layout in page sequence chunks, so try breaking
up your pages into chunks of page sequences.  Pages should be available
for garbage collection once the page sequence has been rendered.

Cheers, Adrian.

On May 18, 2011, at 7:24 AM, Michael Rubin
mru...@thunderhead.com wrote:



Just a wild thought. But is there a way you could
possibly get the JVM to garbage collect between each run? Maybe that
might free the memory up?

Thanks.

-Mike

On 18/05/11 13:20, Eric Douglas wrote: 

I am using Fop 1.0. 
I tried using Fop to transform a single
document.  When I got a little over 100 pages my FO file was over 5 MB.
The transform crashed with a Java heap out of memory error.

I managed to break the input down, as I'm using
embedded code generating the input programmatically, and the PDF output
is a lot smaller.

So I'm currently transforming 10 pages at a
time, setting the initial-page-number to the next sequence (1, 11, 21,
etc).

Then I save all the generated PDFs in memory and
merge them using pdfbox.  So far this is working great. 

I tried to do the same thing with the
PNGRenderer, just calling a method to transform 10 pages at a time and
save the output images in an array.

The PNGRenderer is created locally in the
method.  It should be getting released when the method ends but the java
process never releases any memory.

I tested a 90 page report and the memory use was
over 1 GB.  I tested on another machine where the memory limit is
apparently lower and it crashed on page 24.

Everything about the method to render to PNG is
the same as the method to render to PDF aside from the Renderer. 
Is there a problem with this renderer or
something I could need to do different? 






Michael Rubin

Developer

Thunderhead Logo Tagline Triangles  
 T

 F

 M

 E

 W

+44 20 8238 7400 

+44 20 8238 7401 

 

mailto:mru...@thunderhead.com mru...@thunderhead.com 

www.thunderhead.com http://www.thunderhead.com   

Thunderhead featured in The Sunday Times Profit Track 100 league table
of companies with fastest-growing profits. Click here
http://www.fasttrack.co.uk/fasttrack/press/pt11-lon.pdf  to read more.


LinkedIn http://www.linkedin.com/companies/25033/Thunderhead  twitter
http://twitter.com/Thunderheadon RSS
http://www.thunderhead.com/rss/rss.php YouTube
http://www.youtube.com/user/ThunderheadOn
http://thunderheadinnovate.wordpress.com/  were-hiring
http://thunderhead.com/about/careers.php  
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the
named addressee or an authorized designee, you may not copy or use it,
or disclose it to anyone else. If you received it in error please notify
us immediately and then destroy it.










RE: Fop Memory Use

2011-05-18 Thread Eric Douglas
What I could find on int[] references seems to be...
org.apache.fop.render.pdf.PDFRenderer extends
AbstractPathOrientedRenderer implements PDFConfigurationConstants

 

org.apache.fop.render.bitmap.PNGRenderer extends Java2DRenderer

 

org.apache.fop.render.java2d.Java2DRenderer extends
AbstractPathOrientedRenderer implements Printable

int[] references:

public static void renderText(TextArea text, Graphics2D g2d, Font font)

private static int[] getGlyphOffsets(String s, Font font, TextArea text,
int[] letterAdjust)

 

Could this be because I'm loading in custom fonts?

Is this a bug in the Java2DRenderer?  A simple workaround?




From: Peter Hancock [mailto:peter.hanc...@gmail.com] 
Sent: Wednesday, May 18, 2011 12:05 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Fop Memory Use


Hi Eric,

Does your document contain many large SVG's?  If so take a look at
Bugzilla #46360.  This issue was resolved in rev 997602 of FOP trunk.

Pete





On Wed, May 18, 2011 at 5:10 PM, Adrian Cumiskey
adrian.cumis...@gmail.com wrote:


Hi Eric,

Fop calculates layout in page sequence chunks, so try breaking
up your pages into chunks of page sequences.  Pages should be available
for garbage collection once the page sequence has been rendered.

Cheers, Adrian.

On May 18, 2011, at 7:24 AM, Michael Rubin
mru...@thunderhead.com wrote:



Just a wild thought. But is there a way you could
possibly get the JVM to garbage collect between each run? Maybe that
might free the memory up?

Thanks.

-Mike

On 18/05/11 13:20, Eric Douglas wrote: 

I am using Fop 1.0. 
I tried using Fop to transform a single
document.  When I got a little over 100 pages my FO file was over 5 MB.
The transform crashed with a Java heap out of memory error.

I managed to break the input down, as I'm using
embedded code generating the input programmatically, and the PDF output
is a lot smaller.

So I'm currently transforming 10 pages at a
time, setting the initial-page-number to the next sequence (1, 11, 21,
etc).

Then I save all the generated PDFs in memory and
merge them using pdfbox.  So far this is working great. 

I tried to do the same thing with the
PNGRenderer, just calling a method to transform 10 pages at a time and
save the output images in an array.

The PNGRenderer is created locally in the
method.  It should be getting released when the method ends but the java
process never releases any memory.

I tested a 90 page report and the memory use was
over 1 GB.  I tested on another machine where the memory limit is
apparently lower and it crashed on page 24.

Everything about the method to render to PNG is
the same as the method to render to PDF aside from the Renderer. 
Is there a problem with this renderer or
something I could need to do different? 






Michael Rubin

Developer

Thunderhead Logo Tagline Triangles  
 T

 F

 M

 E

 W

+44 20 8238 7400 

+44 20 8238 7401 

 

mailto:mru...@thunderhead.com mru...@thunderhead.com 

www.thunderhead.com http://www.thunderhead.com   

Thunderhead featured in The Sunday Times Profit Track 100 league table
of companies with fastest-growing profits. Click here
http://www.fasttrack.co.uk/fasttrack/press/pt11-lon.pdf  to read more.


LinkedIn http://www.linkedin.com/companies/25033/Thunderhead  twitter
http://twitter.com/Thunderheadon RSS
http://www.thunderhead.com/rss/rss.php YouTube
http://www.youtube.com/user/ThunderheadOn
http://thunderheadinnovate.wordpress.com/  were-hiring
http://thunderhead.com/about/careers.php  
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the
named addressee or an authorized designee, you may not copy or use it,
or disclose it to anyone else. If you received it in error please notify
us immediately and then destroy it.










How does it work?

2011-04-07 Thread Eric Douglas
I've read the official rules
(http://apache.org/foundation/how-it-works.html) and I am aware of how
Apache projects in general work.
If I read it right, those rules are flexible and may vary by project.
It seems they're saying no one is in charge of any project, they're run
by groups of people.
Is there a list of people with rights to make changes to the FOP
project, to the program files and/or the web site?
Is there a min/max number of people for that group?
Does everyone who gets the rights to make changes have the rights to
give someone else rights (after they can pass a group vote)?


FOP Preview

2011-04-07 Thread Eric Douglas
FOP has a PreviewPanel window but it creates it's own renderer and
transformer which can run extremely slow, especially if you're running
client-server like I am where output can normally be renderered on a
server and the preview needs to display on the client PC.

I wrote my own custom preview window which I think is pretty smooth.
For the window itself I just used swing.  It uses the PNGRenderer to
create the output and gets the pages as images which are then
serializable so they can be loaded into the window which can be on
another machine, or they could still be saved as image files.  The pages
can be loaded into the preview window one at a time as needed so you
don't have to wait for them to serialize.  For a zoom I just used the
built in java.awt.Graphics2D to resize instead of generating the output
all over with the transform, so it can be a little bit blurry but is
still perfectly viewable.  If anyone is interested in seeing any code I
wrote using FOP to get any ideas for adding something to the project, or
just if it's something you might want to use yourself, let me know.  I
also wrote a custom report writer program which does a lot of cool
things, using FOP to generate output, along with pdfbox to print.


RE: 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

2011-03-18 Thread Eric Douglas
What is this color profile?  Can I get color output without it?  I am
using the PNGRenderer, currently running JDK 6u17 about to install u24
today. 

-Original Message-
From: Ognjen Blagojevic [mailto:ognjen.d.blagoje...@gmail.com] 
Sent: Friday, March 18, 2011 4:21 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: 20x slowdown in PNG processing when switching from JDK
1.6.0_17 to 1.6.0_18

On 11.3.2011 12:54, Ognjen Blagojevic wrote:
 Having said all this, my proposal is:

 1. if someone can help me to track bug further (remember, 1.6.0_17 was

 working just fine) we could file the bug report to Oracle, or 2. we 
 could just add the info in FOP/xmlgraphics docs that color profile in 
 PNG images introduces significant slowdown on JDK 1.6.0_18+.

Ok, since it seems that it is too hard to track this down, I suggest we
add to PNG Graphics page [1] something like:

Note: PNG images with color profile are on certain JDKs (most notably
Oracle JDK 6u18+) processed as much as 20 times slower than same images
without color profile. This slowdown is introduced by JDK image
manipulation classes.

Thoughts?

-Ognjen

[1] http://xmlgraphics.apache.org/fop/1.0/graphics.html#png


RE: Solving FindBugs issues [was: Re: svn commit: r1071912 - in /xmlgraphics/fop/trunk: findbugs-exclude.xml src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java]

2011-02-21 Thread Eric Douglas
I haven't looked at the trunk lately but 1.0 has a ton of warnings, at
least in my compile.
I don't know how much warnings have changed over the versions.
I think it was originally written to compile on Java 1.4 or maybe even
1.3.
1.5 shows thousands of warnings, 1.6 shows more.
Some of the warnings are quirky (raw type list?), some are just wasteful
(dead code? Local variable never referenced?).
If there's code which is actually incorrect logic it needs to be fixed.
If there's code which is just incomplete logic, maybe setting something
up for a future improvement someone wanted to add, that should be
removed and placed in a separate to do list document.


-Original Message-
From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] 
Sent: Monday, February 21, 2011 2:29 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Solving FindBugs issues [was: Re: svn commit: r1071912 - in
/xmlgraphics/fop/trunk: findbugs-exclude.xml
src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java]

On 21 Feb 2011, at 19:15, Vincent Hennebert wrote:

 If we solve issues raised by FindBugs by listing them in an ignore 
 file, is there still a point to use FindBugs at all?
 
 It seems to me that some of those issues deserve to be fixed. They 
 seem to point out genuine problems in the code.

I was about to convey a similar sentiment. 

If we are only going to ignore potential bugs, the point of the whole
exercise seems totally lost.

Some of them may be OK to ignore, as Glenn pointed out, but IIUC, one of
those potentially introduced bugs (that we are now ignoring) is likely
of the same nature as one that Chris fixed in the very same area a while
back (potentially unclosed stream, leading to a descriptor leak in the
AFP renderer)... Not very encouraging. :(

Mea culpa:
I saw one exclusion --unconfirmed cast-- that would seem to stem from my
recent refactoring in the BlockStackingLMs. Not sure why an exclusion
was chosen here, but adding an assert statement in the code avoids the
warning as well *and* has the benefit of being visible exactly at the
spot in the code where it applies. Seemed like the more proper way to
handle this.

Just my 2 cents...


Regards,

Andreas
---



PreviewPanel

2011-02-01 Thread Eric Douglas
FOP provides org.apache.fop.render.awt.viewer.PreviewPanel but it's
ugly.  I'm running a client-server program through webstart.  My
programs run on the server and of course all GUI objects need to be
created on the client.  The PreviewPanel requires a Java transformer and
a Renderer to be created on the client, both of which may take a long
time, at least the first time.  They run faster if you run them more
than once so they're cached but my goal is not to create them at all.

So I'm creating my own PreviewPanel with no transformer and no Renderer.
This will display an image, so I require a couple of enhancements.  The
first task is creating this new panel object.  So I'm looking at FOP's
PreviewPanel to copy some of that logic and I'm confused.  What is the
gridPanel object?  PreviewPanel extends JPanel but contains an object of
type JPanel?  Is it creating a panel within a panel?  What's the point
of that?  From what I've found my object should need to (extend type or
contain an object of type?) org.jdesktop.swingx.JXPanel to use an
org.jdesktop.swingx.painter.ImagePainter to draw the picture.

My second enhancement I'd like to add would be to do this without
writing any files to disk.  For the normal transform I'm generating the
entire output programatically so writing the XML, FO, or PDF files are
all optional.  I get the output from Fop in a byte stream which I can
use to either create a Pageable PDF object through pdfbox and send to
the printer without writing to disk or I can clone down to the client to
save as a PDF on their machine.  The PNGRenderer only option is to
generate each page as a physical file on disk.  I'll want to update this
renderer or write a new one based on it to be able to send the pages to
the byte stream instead, or an array of byte streams one per page.


RE: [Bug 50471] Greek Extended character throwing ArrayIndexOutOfBoundException.

2011-01-07 Thread Eric Douglas
I've been trying to see if I can modify the source to eliminate the
fonts that come packaged with it.  I'm not sure why it needs to include
Courier, Helvetica, etc.  I would think they're just a waste of space if
FOP is designed to use custom fonts or installed fonts.  I pass in
custom fonts using only Lucida which comes in one file for normal, one
for bold, one for unicode, and should be a different one for italic
which I haven't needed yet.

I'm passing in the files that came with Windows XP in the fonts folder,
l_10646.ttf for unicode.  For FOP to display a unicode character for the
'glyph not found' error rather than one of standard ascii, it should
come packaged with a unicode font set.  I print the #x25A1; character
to my reports and passing in the l_10646.ttf font that works fine.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Friday, January 07, 2011 8:44 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: [Bug 50471] Greek Extended character throwing
ArrayIndexOutOfBoundException.

I think so. The use of # is mostly historical due to lack of Unicode
support initially. At least I believe so. The first fonts were WinAnsi
only. IMO, it makes sense to make that transition. However, for
single-byte fonts, we might still need to use #. Not sure.

On 07.01.2011 14:17:42 Simon Pepping wrote:
 On Fri, Jan 07, 2011 at 07:31:07AM -0500, bugzi...@apache.org wrote:
  https://issues.apache.org/bugzilla/show_bug.cgi?id=50471
  
  --- Comment #4 from Andreas L. Delmelle adelme...@apache.org 
  2011-01-07 07:31:03 EST ---
  
  Very right indeed. 
  So, if no one objects, I will apply the patch as proposed. FOP will 
  no longer crash, but simply show a '#' for such unassigned
codepoints in the output.
  Treating them as regular alphabetic characters seems to be safe 
  enough for the time being.
 
 Would it not be better to use character FFFD, 'Replacement Character',

 ?, for this?
 
 Simon




Jeremias Maerki



Custom FOP

2011-01-07 Thread Eric Douglas
That seems odd, to include information for fonts which are never used.
I'll just ignore that then.  It just seemed like that would be putting a
lot into the jar which will never be needed.  I'm running in webstart,
referencing fop.jar in the jnlp, so anything in the jar has to be copied
to the client.

My next task is print preview.  I'm using custom windows and embedding
org.apache.fop.render.awt.viewer.PreviewPanel.  That works except I have
to create it with a useragent and a renderer which takes forever.  I'm
wondering if I can use a version of this class without a useragent or a
renderer.  If I can pass in a rendered document as an array of pages as
images instead of a renderable object, can I still do the scale
resizing?  Other than the zoom in the preview there's no reason I need a
renderable object here.  I'm keeping a copy of the renderable source on
the server while displaying the preview.  Sending the output to a
printer or generating a PDF can be done on the server.  I'm saving the
PDF to the client but I'm getting the output from FOP as the byte stream
so I just copy bytes to the client and save them.  The renderer,
transformer, etc should never have to exist on the client.
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Friday, January 07, 2011 9:35 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: [Bug 50471] Greek Extended character throwing
ArrayIndexOutOfBoundException.

On 07.01.2011 15:06:19 Eric Douglas wrote:
 I've been trying to see if I can modify the source to eliminate the 
 fonts that come packaged with it.  I'm not sure why it needs to 
 include Courier, Helvetica, etc.

The PDF specification requires support for the so-called Base 14 fonts.
And so does the PostScript spec. We don't actually include the fonts,
just the font metrics. So this hardly needs any space.


RE: DO NOT REPLY [Bug 49186] Empty fo:inline objects with id attribute generate blank line

2011-01-07 Thread Eric Douglas
I try not to let it do anything by default so I don't have to worry
about anything changing in a future version.
I write programs which create my xml input, I'm not trying to read in
text like a book, so I don't have any linefeeds.  All text blocks fit on
one line.
I don't worry about where text ends up on the page because I've already
calculated that.  All my blocks use absolute positioning.
Sometimes blocks have automatic stuff like padding, like this line
spacing you describe.  I get around it with code like this.
 fo:block-container
  xsl:attribute name=text-alignstart/xsl:attribute
  xsl:attribute name=padding-top0px/xsl:attribute
  xsl:attribute name=padding-bottom0px/xsl:attribute
  xsl:attribute name=padding-right0px/xsl:attribute
  xsl:attribute
name=linefeed-treatmentpreserve/xsl:attribute
For a block with no text in it, for other purposes, you can throw in one
of these.
  fo:block
   xsl:attribute name=line-height0/xsl:attribute

A lot of people put xsl tags in line as you've done there with
white-space-treatment, but I think it's easier to read if you split them
out to their own tags.

-Original Message-
From: bugzi...@apache.org [mailto:bugzi...@apache.org] 
Sent: Friday, January 07, 2011 12:18 PM
To: fop-dev@xmlgraphics.apache.org
Subject: DO NOT REPLY [Bug 49186] Empty fo:inline objects with id
attribute generate blank line

https://issues.apache.org/bugzilla/show_bug.cgi?id=49186

--- Comment #2 from Andreas L. Delmelle adelme...@apache.org
2011-01-07 12:18:10 EST ---

Not immediately dismissing this, but it did get me wondering which
situation is wrong.
FOP does not generate an area for empty inlines if they have no id or
markers that should be tracked, which is why there is a difference
between the two cases.
Now, if we have:

fo:block white-space-treatment=preserve
  fo:blockThere should be a blank line between this block/fo:block
  fo:blockand this block/fo:block
/fo:block

The output is rendered, as expected, with a line in between both blocks
containing only a single space character.

Same without white-space preservation, but only a zero-width space

fo:block
  fo:blockThere should be a blank line between this block/fo:block
  #x200B;
  fo:blockand this block/fo:block
/fo:block

Checking http://www.w3.org/TR/xsl/#area-inline, it seems like even empty
inlines are in fact supposed to generate an area (= content/allocation
rectangle), regardless of whether an id or marker is present (?). If
that is so, then /that/ would be the case that needs fixing, contrary to
what the bug description indicates.

The only way to really avoid that spurious blank space, would be to set
the font-size of the empty inline to 0pt.

--
Configure bugmail:
https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: --- You are the
assignee for the bug.


RE: DO NOT REPLY [Bug 49186] Empty fo:inline objects with id attribute generate blank line

2011-01-07 Thread Eric Douglas
Interesting.  I write it out neatly in the xsl.  I don't normally look
at the fo.  I run embedded code where I normally run a transform with an
output result created from the FOP handler so I get out a document and
any fo generated would stay within the transformer.  If I run that same
transform with an empty byte stream result it gets the fo, so I have
done that a few times and saved the fo code to files which I never look
at unless there's an error to debug.  I see that fo does combine the
attributes.  Of course writing code in fo wouldn't make much sense since
it has the xml input in it unless you're printing a document where
nothing changes.


-Original Message-
From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] 
Sent: Friday, January 07, 2011 4:28 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: DO NOT REPLY [Bug 49186] Empty fo:inline objects with id
attribute generate blank line

On 07 Jan 2011, at 20:13, Eric Douglas wrote:

Hi

 snip /
 A lot of people put xsl tags in line as you've done there with 
 white-space-treatment, but I think it's easier to read if you split 
 them out to their own tags.

Actually, I was just writing plain FO (= what results after applying the
XSLT).


Regards,

Andreas
---



RE: FOP build

2010-12-22 Thread Eric Douglas
I don't know why my ant builds always seems to fail junit tests, but it appears 
most if not all of those tests are for the custom fonts it includes for 
whatever reason.  I print everything in one font (Lucida Typewriter) so it's 
readable and fixed width, so I'll just create my own version and hack out 
everything to do with specific fonts including the junit tests. 

-Original Message-
From: Pascal Sancho [mailto:pascal.san...@takoma.fr] 
Sent: Thursday, December 09, 2010 8:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP build

Hi,
Junit tests are for pre-commit purpose.
You can easily avoid them by running the right ant option:
 ant package.

see [1] for further info on running ant with fop.

[1] http://xmlgraphics.apache.org/fop/1.0/compiling.html#env-ant

Le 09/12/2010 14:08, Eric Douglas a écrit :
 Is there a way to simplify FOP?  I have the 1.0 source.  I can run the 
 ant build and it creates a new jar.  Now I tried excluding a font 
 class I don't need, and it failed the build on a junit test.  I tried 
 commenting that test out and it failed a different test.  I excluded a 
 few tests and it succeeded but it didn't create the jar.  It should 
 still be executing that step which creates the jar.  I'm passing in 
 custom fonts so I'd like to be able to save some overhead by removing 
 all of those base 14 fonts.
 

--
pascal


RE: Question on MimeConstants

2010-12-22 Thread Eric Douglas
public interface MimeConstants extends
org.apache.xmlgraphics.util.MimeConstants {

Check out the other class(es).  There's more than one set of
MimeConstants combined here.




From: Dickson Robert [mailto:dickson.rob...@ag.ny.gov] 
Sent: Wednesday, December 22, 2010 10:16 AM
To: 'fop-dev@xmlgraphics.apache.org'
Subject: Question on MimeConstants


Hello All,
I just downloaded the FOP jar file. Our Project involves Converting XML
to PDF...So, while compiling your examples...we found out that 
 
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
 
Mime-PDF was not defined in MimeConstants.java
 
 
Please help with this one
 
 
Thank You,
 
Dickson Robert
518-402-5404
 


RE: Ant Hangs

2010-12-21 Thread Eric Douglas
I put a junit jar in the fop lib directory.  Without it the fop ant build tells 
me junit support is not present even if I have junit in the project build path.
I found the last message it gives me in the build file.  Is it possible this 
step is just taking a really long time?  I'm not sure what all it's supposed to 
do.  I believe I left it running when I went to lunch yesterday and that was 
still the last message showing when I got back.

  target name=junit-userconfig depends=junit-compile if=junit.present 
description=Runs FOP's user config JUnit tests
echo message=Running user config tests/
junit dir=${basedir} haltonfailure=${junit.haltonfailure} 
fork=${junit.fork} errorproperty=fop.junit.error 
failureproperty=fop.junit.failure
  sysproperty key=basedir value=${basedir}/
  sysproperty key=jawa.awt.headless value=true/
  sysproperty key=fop.layoutengine.disabled 
value=${layoutengine.disabled}/
  sysproperty key=fop.layoutengine.testset value=standard/
  formatter type=brief usefile=false/
  formatter type=plain usefile=true/
  formatter type=xml usefile=true/
  classpath
pathelement location=${build.dir}/test-classes/
path refid=libs-run-classpath/
  /classpath
  test name=org.apache.fop.config.UserConfigTestSuite 
todir=${junit.reports.dir} outfile=TEST-userconfig/
/junit
  /target 

-Original Message-
From: Peter Hancock [mailto:peter.hanc...@gmail.com] 
Sent: Tuesday, December 21, 2010 6:22 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Ant Hangs

Hi Eric,

You can  add the junit jar to Ant's lib directory - see 
http://ant.apache.org/manual/install.html and look for ANT_HOME + lib
+ Windows.

I hope that helps,


Pete
On Mon, Dec 20, 2010 at 9:24 PM, mehdi houshmand med1...@gmail.com wrote:
 I'm no Windows expert by any stretch of the imagination, but have you 
 tried adding the JUnit jar to the build XML, add the Ant jar to the 
 Environment variables and try running it from the command line. I 
 think you may have more luck there.

 Mehdi

 On 20 December 2010 21:12, Eric Douglas edoug...@blockhouse.com wrote:
 Windows XP

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Monday, December 20, 2010 4:11 PM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 What OS are you using? If you're using Linux there are packages for 
 installing the Ant and JUnit libraries which may avoid these issues.
 This I think is a config issue.

 Mehdi

 On 20 December 2010 20:28, Eric Douglas edoug...@blockhouse.com wrote:
 I compiled FOP 1.0 using the Ant build in Eclipse.  It completed 
 successfully saying Junit support not present.
 Then I downloaded the Junit source, imported it as a project, put it 
 on the FOP Build Path, and copied the junit-4.8.2.jar into the FOP lib 
 folder.

 Now the ant task shows Junit support present and the build never 
 stops running.  The last thing displayed on the Console message tab is this.

 junit-userconfig:
  [echo] Running user config tests




RE: Ant Hangs

2010-12-21 Thread Eric Douglas
I'm not sure what you mean.  My ant in this case doesn't have a lib folder.  I 
did copy a junit.jar into fop's lib folder.  To resolve the references to ant 
in fop I just put an ant.jar in the fop lib folder and put it on fop's build 
path.  The project builds without errors if I select Build from the Eclipse 
Project menu, and it builds without errors if I select run as ant build on 
the build.xml file in the fop project with no junit support.  Then if I copy 
junit.jar into the lib folder of the fop project it just hangs on this task.
Am I missing something?  Am I explaining this well enough?

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Tuesday, December 21, 2010 10:00 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Ant Hangs

Hi Eric,

Peters method is less hacky than mine since it means you don't change the 
build.xml. Basically, you download the junit jar from and add it to the lib 
folder in your ant file and that will ensure that you can run junit with ant 
with any project (not just FOP). You'll also need to add the bin folder to your 
PATH (if you already haven't).

Mehdi

On 21 December 2010 13:51, Eric Douglas edoug...@blockhouse.com wrote:
 I put a junit jar in the fop lib directory.  Without it the fop ant build 
 tells me junit support is not present even if I have junit in the project 
 build path.
 I found the last message it gives me in the build file.  Is it possible this 
 step is just taking a really long time?  I'm not sure what all it's supposed 
 to do.  I believe I left it running when I went to lunch yesterday and that 
 was still the last message showing when I got back.

  target name=junit-userconfig depends=junit-compile 
 if=junit.present description=Runs FOP's user config JUnit tests
    echo message=Running user config tests/
    junit dir=${basedir} haltonfailure=${junit.haltonfailure} 
 fork=${junit.fork} errorproperty=fop.junit.error 
 failureproperty=fop.junit.failure
      sysproperty key=basedir value=${basedir}/
      sysproperty key=jawa.awt.headless value=true/
      sysproperty key=fop.layoutengine.disabled 
 value=${layoutengine.disabled}/
      sysproperty key=fop.layoutengine.testset value=standard/
      formatter type=brief usefile=false/
      formatter type=plain usefile=true/
      formatter type=xml usefile=true/
      classpath
        pathelement location=${build.dir}/test-classes/
        path refid=libs-run-classpath/
      /classpath
      test name=org.apache.fop.config.UserConfigTestSuite 
 todir=${junit.reports.dir} outfile=TEST-userconfig/
    /junit
  /target

 -Original Message-
 From: Peter Hancock [mailto:peter.hanc...@gmail.com]
 Sent: Tuesday, December 21, 2010 6:22 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 You can  add the junit jar to Ant's lib directory - see 
 http://ant.apache.org/manual/install.html and look for ANT_HOME + lib
 + Windows.

 I hope that helps,


 Pete
 On Mon, Dec 20, 2010 at 9:24 PM, mehdi houshmand med1...@gmail.com wrote:
 I'm no Windows expert by any stretch of the imagination, but have you 
 tried adding the JUnit jar to the build XML, add the Ant jar to the 
 Environment variables and try running it from the command line. I 
 think you may have more luck there.

 Mehdi

 On 20 December 2010 21:12, Eric Douglas edoug...@blockhouse.com wrote:
 Windows XP

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Monday, December 20, 2010 4:11 PM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 What OS are you using? If you're using Linux there are packages for 
 installing the Ant and JUnit libraries which may avoid these issues.
 This I think is a config issue.

 Mehdi

 On 20 December 2010 20:28, Eric Douglas edoug...@blockhouse.com wrote:
 I compiled FOP 1.0 using the Ant build in Eclipse.  It completed 
 successfully saying Junit support not present.
 Then I downloaded the Junit source, imported it as a project, put 
 it on the FOP Build Path, and copied the junit-4.8.2.jar into the FOP lib 
 folder.

 Now the ant task shows Junit support present and the build never 
 stops running.  The last thing displayed on the Console message tab is 
 this.

 junit-userconfig:
  [echo] Running user config tests





RE: Ant Hangs

2010-12-21 Thread Eric Douglas
I'm not using FOP\lib\ant.jar to integrate to ant (at least I don't
think I am).  Could it be a problem to put that jar there?
I put a copy of the jar in the lib folder (maybe I need it in a
different folder?) to resolve imports to compile.
I'm using the Eclipse ant plugin to run the ant build.
FOP requires ant such as package org.apache.fop.tools.anttasks class
FileCompare import org.apache.tools.ant.BuildException.

If I try to download the ant source and create a project to reference
for fop to validate these imports, I have to setup it's build path which
requires bcel, apache commons, log4j, javax.mail, netrexx,
javax.media.jai, jai.codec, jdepend, etc.
I'll see if there's an easier way.
 

-Original Message-
From: Chris Bowditch [mailto:bowditch_ch...@hotmail.com] 
Sent: Tuesday, December 21, 2010 10:59 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Ant Hangs

On 21/12/2010 15:07, Eric Douglas wrote:

Hi Eric,
 I'm not sure what you mean.  My ant in this case doesn't have a lib
folder.  I did copy a junit.jar into fop's lib folder.  To resolve the
references to ant in fop I just put an ant.jar in the fop lib folder and
put it on fop's build path.  The project builds without errors if I
select Build from the Eclipse Project menu, and it builds without errors
if I select run as ant build on the build.xml file in the fop project
with no junit support.  Then if I copy junit.jar into the lib folder of
the fop project it just hangs on this task.
 Am I missing something?  Am I explaining this well enough?

I don't think copying ant.jar into FOP\lib is the correct way to
integrate with Ant. Most people I know install ant somewhere on their
harddisk and then add ant/bin directory into the PATH environment
variable. Then to build FOP you invoke Ant from the FOP root directory
and Ant finds build.xml and runs the build. There's a lot more to Ant
than ant.jar

Thanks,

Chris

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Tuesday, December 21, 2010 10:00 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 Peters method is less hacky than mine since it means you don't
change the build.xml. Basically, you download the junit jar from and add
it to the lib folder in your ant file and that will ensure that you can
run junit with ant with any project (not just FOP). You'll also need to
add the bin folder to your PATH (if you already haven't).

 Mehdi

 On 21 December 2010 13:51, Eric Douglasedoug...@blockhouse.com
wrote:
 I put a junit jar in the fop lib directory.  Without it the fop ant
build tells me junit support is not present even if I have junit in the
project build path.
 I found the last message it gives me in the build file.  Is it
possible this step is just taking a really long time?  I'm not sure what
all it's supposed to do.  I believe I left it running when I went to
lunch yesterday and that was still the last message showing when I got
back.

   target name=junit-userconfig depends=junit-compile
 if=junit.present description=Runs FOP's user config JUnit tests
 echo message=Running user config tests/
 junit dir=${basedir} haltonfailure=${junit.haltonfailure}
 fork=${junit.fork} errorproperty=fop.junit.error
 failureproperty=fop.junit.failure
   sysproperty key=basedir value=${basedir}/
   sysproperty key=jawa.awt.headless value=true/
   sysproperty key=fop.layoutengine.disabled
 value=${layoutengine.disabled}/
   sysproperty key=fop.layoutengine.testset value=standard/
   formatter type=brief usefile=false/
   formatter type=plain usefile=true/
   formatter type=xml usefile=true/
   classpath
 pathelement location=${build.dir}/test-classes/
 path refid=libs-run-classpath/
   /classpath
   test name=org.apache.fop.config.UserConfigTestSuite
 todir=${junit.reports.dir} outfile=TEST-userconfig/
 /junit
   /target

 -Original Message-
 From: Peter Hancock [mailto:peter.hanc...@gmail.com]
 Sent: Tuesday, December 21, 2010 6:22 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 You can  add the junit jar to Ant's lib directory - see 
 http://ant.apache.org/manual/install.html and look for ANT_HOME + lib
 + Windows.

 I hope that helps,


 Pete
 On Mon, Dec 20, 2010 at 9:24 PM, mehdi houshmandmed1...@gmail.com
wrote:
 I'm no Windows expert by any stretch of the imagination, but have 
 you tried adding the JUnit jar to the build XML, add the Ant jar to 
 the Environment variables and try running it from the command line. 
 I think you may have more luck there.

 Mehdi

 On 20 December 2010 21:12, Eric Douglasedoug...@blockhouse.com
wrote:
 Windows XP

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: Monday, December 20, 2010 4:11 PM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: Ant Hangs

 Hi Eric,

 What OS are you using? If you're using Linux there are packages for
installing the Ant and JUnit

Ant Hangs

2010-12-20 Thread Eric Douglas
I compiled FOP 1.0 using the Ant build in Eclipse.  It completed
successfully saying Junit support not present.
Then I downloaded the Junit source, imported it as a project, put it on
the FOP Build Path, and copied the junit-4.8.2.jar into the FOP lib
folder.
Now the ant task shows Junit support present and the build never stops
running.  The last thing displayed on the Console message tab is this.
junit-userconfig:
 [echo] Running user config tests


RE: Ant Hangs

2010-12-20 Thread Eric Douglas
Windows XP 

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: Monday, December 20, 2010 4:11 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Ant Hangs

Hi Eric,

What OS are you using? If you're using Linux there are packages for installing 
the Ant and JUnit libraries which may avoid these issues.
This I think is a config issue.

Mehdi

On 20 December 2010 20:28, Eric Douglas edoug...@blockhouse.com wrote:
 I compiled FOP 1.0 using the Ant build in Eclipse.  It completed 
 successfully saying Junit support not present.
 Then I downloaded the Junit source, imported it as a project, put it 
 on the FOP Build Path, and copied the junit-4.8.2.jar into the FOP lib folder.

 Now the ant task shows Junit support present and the build never stops 
 running.  The last thing displayed on the Console message tab is this.

 junit-userconfig:
  [echo] Running user config tests


FOP build

2010-12-09 Thread Eric Douglas
Is there a way to simplify FOP?  I have the 1.0 source.  I can run the
ant build and it creates a new jar.  Now I tried excluding a font class
I don't need, and it failed the build on a junit test.  I tried
commenting that test out and it failed a different test.  I excluded a
few tests and it succeeded but it didn't create the jar.  It should
still be executing that step which creates the jar.  I'm passing in
custom fonts so I'd like to be able to save some overhead by removing
all of those base 14 fonts.


RE: FOP build

2010-12-09 Thread Eric Douglas
I tried commenting out the base 14 collection statement here and it created 
fop.jar but I've set it up differently than on my hone PC.
Here my ant build starts out telling me this.
 [echo] --- Apache FOP 1.0 [1999-2010] 
 [echo] See build.properties and build-local.properties for additional 
build settings
 [echo] Apache Ant version 1.7.1 compiled on June 27 2008
 [echo] VM: 14.3-b01, Sun Microsystems Inc.
 [echo] JAVA_HOME: ${env.JAVA_HOME}
 [echo] JAI Support PRESENT
 [echo] JCE Support PRESENT
 [echo] JUnit Support NOT Present - Committers are required to have JUnit 
working
 [echo] XMLUnit Support NOT Present - you can get it from 
http://xmlunit.sourceforge.net

On my home PC I believe it's saying JAI Support is not present, I'm not sure 
what that's looking for, but it says JUnit and XMLUnit support are present.  I 
can test again to let you know exactly what it complains about when JUnit is 
working but the fop.jar stops getting updated if you have the JUnit and just 
comment out this one line.

package org.apache.fop.render;
...
public abstract class PrintRenderer extends AbstractRenderer
...
public void setupFontInfo(FontInfo inFontInfo) throws FOPException {
this.fontInfo = inFontInfo;
FontManager fontManager = userAgent.getFactory().getFontManager();
FontCollection[] fontCollections = new FontCollection[] {
//new 
Base14FontCollection(fontManager.isBase14KerningEnabled()),
new CustomFontCollection(getFontResolver(), getFontList())
};
fontManager.setup(getFontInfo(), fontCollections);
}

For my purpose I shouldn't need any code referencing the base 14 fonts.  I'm 
passing in custom fonts.  I assume CustomFontCollection here will handle that.

-Original Message-
From: Pascal Sancho [mailto:pascal.san...@takoma.fr] 
Sent: Thursday, December 09, 2010 8:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP build

Hi,
Junit tests are for pre-commit purpose.
You can easily avoid them by running the right ant option:
 ant package.

see [1] for further info on running ant with fop.

[1] http://xmlgraphics.apache.org/fop/1.0/compiling.html#env-ant

Le 09/12/2010 14:08, Eric Douglas a écrit :
 Is there a way to simplify FOP?  I have the 1.0 source.  I can run the 
 ant build and it creates a new jar.  Now I tried excluding a font 
 class I don't need, and it failed the build on a junit test.  I tried 
 commenting that test out and it failed a different test.  I excluded a 
 few tests and it succeeded but it didn't create the jar.  It should 
 still be executing that step which creates the jar.  I'm passing in 
 custom fonts so I'd like to be able to save some overhead by removing 
 all of those base 14 fonts.
 

--
pascal


Serializable

2010-11-30 Thread Eric Douglas
So I'm trying to make my program run faster by doing as much as possible
on the server and copying the end result to the client.  I'm trying to
create a PreviewPanel.  PreviewPanel extends JPanel which implements
Serializable.  However, PreviewPanel contains an object of the
FOUserAgent class which is not Serializable.  Is there any reason any
variable in the PreviewPanel should not be Serializable?


What is Renderable?

2010-11-18 Thread Eric Douglas
So I sent a message to the fop-users list yesterday because there's
something I can't figure out how to do, but it might belong on the dev
list if there actually isn't a way to do it?  So I'm a little
confused...

Here's my case.

I'm using FOP 0.95 jars for reporting with embedded code in
client-server programs using webstart.  I start with an XML file and an
XSL file on the server.  I can transform these on the server and get the
results in an output stream which I can send to a printer or copy to the
client and save as a PDF on their local machine.  That works great.

Now I have an option to send the output to a custom print preview window
using the PreviewPanel object.  That of course has to be created on the
client.  I don't see any way to use the output stream from the transform
on the server as input to that object.  The only way I currently have it
working is to stream down the XML and XSL files and do the transform on
the client.  It seems this loads the data into the PreviewPanel object
because the PreviewPanel constructor passes in the FOUserAgent, which is
also the input parameter to the FopFactory.newFop() method, the
Fop.getDefaultHandler method is the input to the SAXResult constructor,
and the SAXResult is the input to the transform so they're all linked.
This takes a lot longer than transforming on the server and getting the
output stream which can either be printed or saved as a PDF.  Am I
missing something?  Does all of this processing have to be done on the
client to use the PreviewPanel?  It has a third input parameter of class
Renderable.  It seems this refers to an interface, but I don't see
anything which implements it or returns an object of this class.  Do I
need to create my own custom class to use it?  Does this need to be
connected to the FOTreeBuilder or DefaultHandler class?  Why does
AWTRenderer have a setRenderable method but no getRenderable method?



RE: TrueType Font Embedding

2010-11-11 Thread Eric Douglas
If using installed fonts is an option to save space in the file / data
stream, using embedded fonts still needs to be an option.
I am assigning specific fonts from specific files to get consistent
output so everything must be embedded.  I don't want to have to care
what is installed where.  I am glad to fix this headache I've had with
Windows 98 trying to use Courier New fonts and different PCs with the
same OS had a different font file, and trying to render on the server
versus the client having one not installed or different fonts installed
with the same name.

The problem I'm currently having with output is rendering special
unicode glyphs.  I sent one unicode as a 25AB with the font file
LTYPE.TTF which came installed with Windows XP.  In FOP 0.95 it produced
a square which is what I want.  That character is supposed to be a
square.  If I'm wrong and that character is not in the font then the
square was the default print for character not found.  I'd like to be
able to run a routine through FOP to get out a list of all unicodes and
what characters they go with for a particular font.  When I tried FOP
1.0, that same code produced a pound #.

The biggest problem I'm having running FOP 0.95 is the threading.  I've
tried calling it from a Java SwingWorker and it's not resolving the
issue.  I'm running a javax.swing.JProgressBar as indeterminate and it
freezes while I'm transforming FOP output, so the users think the
program is just stuck and I have to explain to them it's supposed to do
that the first time.  If they run it twice in a row the second one is
much smoother.

Getting smaller results is nice but not necessarily a priority.
Reducing a 2 MB file to 35 K is high priority.  Reducing a 46 K file to
35 K is not a big deal.  Getting consistent output is top priority.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Thursday, November 11, 2010 3:35 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: TrueType Font Embedding

Hi Chris

I fully understand the desire to install the font on a PostScript
printer to keep the PS files smaller. To answer your question: I did not
ask for the business use case. The problem I'm struggling with in this
context is how to know about the CID meaning of the font, i.e. the
multi-byte encoding of the font.

When we do subsets in FOP, we re-index the glyphs starting with index 1
(or 3) by occurrence in the document. Only FOP knows which Unicode
character is represented by which CID. That's why we need the ToUnicode
CMap in PDF. Otherwise, text extraction would not be so easy.

In single-byte mode, the whole font is embedded (right now probably with
the same problems I've just fixed with rev1034094 for the TTF subset).
In this mode the Adobe character names map into the font, so 8-bit
encodings can be built to properly address the right characters even if
the font is not embedded. That's also how we currently do referenced TTF
fonts for PDF output.

If we fully embed the font as a CID font, we currently lose the
knowledge about which index represents which Unicode character.
Combining the font with a suitable CMap resolves the problem but at the
moment we only use Identity-H which is a 1:1 mapping. One solution would
be to turn the Unicode cmap table in the TrueType font into a custom
PS CMap and then use 16-bit Unicode characters directly. FOP currently
doesn't support that.

Also, if some PS platform allows to upload naked TrueType fonts, how
will they be represented in the PS VM? Are they CID fonts then or
single-byte fonts? If they are CID fonts, which CID system are they
following? I have no idea. The only way to be sure about this is by
installing a CID font plus CMap that is generated by FOP (which can be
done by extracting these resources from one of the PS streams. After
that, the font can be referenced, but it may not be portable to other
PS-generating applications.

And then, as Glen mentioned we have to have a strategy to deal with
glyphs with no representation in Unicode. I think I get where he goes
with that and it seems to be close to the CMap I mentioned above that is
derived from the Unicode cmap table in the TrueType font. At any rate,
FOP then has to learn to output Unicode characters (including private
area chars) instead of arbitrary CIDs coming from subsetting.

In the end, I'm not 100% I've understood all implications here. I hope
we'll get there soon. I guess a Wiki page would do us good here.



Jeremias Maerki



RE: DO NOT REPLY [Bug 49687] [PATCH] Complex Script Support

2010-11-05 Thread Eric Douglas
Are you using embedded code?

If it helps, I had issues with the PrintRenderer, so I ended up using
the PDFRenderer, getting the output from the transform in a
ByteArrayOutputStream, passing that output to pdfbox, and printing with
the standard Java print classes.

I also found there is a change to rendering the font from 0.95 to 1.0.
I don't know if that change broke something, or if there's something
broken in my code which is producing the output I want but is actually
incorrect output and they fixed that, so that might be my problem..
 

-Original Message-
From: bugzi...@apache.org [mailto:bugzi...@apache.org] 
Sent: Thursday, November 04, 2010 6:18 PM
To: fop-dev@xmlgraphics.apache.org
Subject: DO NOT REPLY [Bug 49687] [PATCH] Complex Script Support

https://issues.apache.org/bugzilla/show_bug.cgi?id=49687

--- Comment #23 from Imad Daou imad_d...@hotmail.com 2010-11-04
18:17:31 EDT --- Dear all,

I was using FOP for more than 1 year and it's a great tool for printing
and creating PDF files and now I have problem printing ARABIC Text.

I downloaded and tested the FO-PDF converted and it rendered the text
correctly, but this does not fix my problem since I was using the
PrintRenderer to directly print an FO file.

My question is, when can I expect a new patch or release of FOP with
Arabic print-rendering support.

Best regards,
Imad Daou

--
Configure bugmail:
https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: --- You are the
assignee for the bug.


RE: TODO tag [was: Re: svn commit: r990148 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: area/ fo/ fo/flow/ fo/flow/table/ fo/pagination/ fo/properties/ hyphenation/ layoutmgr/ layoutmgr/inline

2010-09-08 Thread Eric Douglas
I agree.  TODO should be something for the developer of the objects.
Javadoc should be something for the developer of something which
implements those objects.  They don't really belong together.  I'd keep
separate documentation if you want to let the implementing programmer
know what the developing programmer is planning to do next.  I think
taking the @ off the TODO makes sense.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, September 08, 2010 8:19 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: TODO tag [was: Re: svn commit: r990148 - in
/xmlgraphics/fop/trunk/src/java/org/apache/fop: area/ fo/ fo/flow/
fo/flow/table/ fo/pagination/ fo/properties/ hyphenation/ layoutmgr/
layoutmgr/inline/ layoutmgr/table/]

+1!

On 08.09.2010 13:02:29 Vincent Hennebert wrote:
 Ok, let me summarise this:
 
 * a @[asf.]todo tag marginally improves the formatting of a javadoc
   comment
 * nobody really likes the idea of using a namespaced version of todo
   (@asf.todo)
 * it is possible to tweak Checkstyle and the javadoc command to enable
   the use of @todo
 
 That said:
 * todo statements generally have little to do (sic) in a javadoc
comment
   anyway
 * TODO keywords are easily indexable by modern IDEs
 
 Jeremias recommends the Felix way: using //TODO comments below the 
 javadoc. I'm also strongly in favour of this convention. OTOH, if I'm 
 correct nobody strongly feels that @todo tags are necessary.
 
 So I think we have a consensus:
 * from now on we stop using @todo in favour of the Felix convention; *

 we will progressively remove TODO statements from javadoc comments and
   move them below in their own Java // comments * I remove the 
 definition of the custom tag from build.xml
 
 Let me know if I missed anything.
 
 Thanks,
 Vincent
snip/ 



Jeremias Maerki



RE: findbugs results

2010-08-17 Thread Eric Douglas
I figured out how to use the ant tool to build the jars and it seems
fairly simple.  I downloaded one project which was using maven and it
seemed fairly ugly.  I installed the Eclipse maven plugin and haven't
figured out how to compile it.  Jeremias also recently said he doesn't
like maven.



From: Benson Margulies [mailto:bimargul...@gmail.com] 
Sent: Monday, August 16, 2010 5:29 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: findbugs results


Simon, 

The people who make Sonar host Apache projects for free. Many Apache
projects have Sonar set up there, and can get findbugs and all sorts of
other useful data without individual contributors running these tools.

Having written that ...

for what it's worth, I am personally opposed to taking the default
output of 'findbugs' as gospel. Many of the things that it reports are
'bugs' only in the eyes of its authors or the religious.

On other projects I've worked on, the project has come up with an
agreeable set of checkstyle and/or PMD rules that are treated as
'normative', but findbugs output is hard to treat as anything except a
report that you can read and consider whether any particular item
deserves to be addressed. Aiming for a perfect score there seems
unrealistic.

Meanwhile, I am, completely off to one side, curious as to why you think
that maven is a 'big' solution. Sheer disk space of the downloaded
components? Something else? I build CXF on a rather wimpy MacMini at
home from time to time. It is thirsty for permgen space when you use
certain plugins, but plain old compiling has never struck me as that
different from ant.

--benson


On Mon, Aug 16, 2010 at 9:34 AM, Simon Pepping spepp...@leverkruid.eu
wrote:


Glenn,

Thanks for this interesting report.

I noted that the problems reported here are harder to fix. They
often
touch upon design issues. See my efforts on the warnings for
clone,
https://issues.apache.org/bugzilla/show_bug.cgi?id=49754.
Probably,
when a codebase has no findbugs problems, it has a clean OO
design.
But for a code base with a long history and many authors, that
is
hardly feasible. Moreover, where would we find the time and
budget to
do all this work?

I also noted that findbugs is too big for my simple machine. I
do not
develop FOP as a profession, so I do not have a larger machine
for
this purpose alone. There goes findbugs into the same corner as
maven:
for professionals only.

Simon

On Sun, Aug 15, 2010 at 04:40:47AM +0800, Glenn Adams wrote:
 First, I wish to express my pleasure that checkstyle (5.1 at
least) now
 reports zero warnings/errors, and that only four deprecation
warnings are
 present at compile time. This is a significant improvement in
code
 cleanliness, and I hope that all committers will take the time
to run
 checkstyle and resolve new warnings before performing new
commits.

 However, as I mentioned in a previous messge, there remain a
fairly large
 number of warnings/errors reported by findbugs: 922 of them to
be exact. I
 don't plan to take any action myself on these at the present
time, since
 I've managed to stir up the pot (and emotions) quite
adequately with my
 prior patch. However, if others wish to start addressing these
issues,
 perhaps incrementally over time, then we can move the code
base even closer
 to a zero warning state, or at least a state where we've
audited all the
 warnings adequately. To this end, I am attaching the current
findbugs report
 as a matter of interest. Because findbugs reports more
potentially serious
 semantic problems in the code, it is also likely that more
potential real
 bugs will be uncovered and addressed.

--
Simon Pepping
home page: http://www.leverkruid.eu





RE: Build errors

2010-08-16 Thread Eric Douglas
There is a file linkmap.xml but not in the source download.  Maybe this
is my problem.  I downloaded both and unzipped fop-1.0-bin.zip, then
unzipped fop-1.0-src.zip to the same root path, telling it to replace
any duplicate file names.  I'll try wiping out the files and unzipping
just the src again.  It would seem they might just conflict each other.
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Thursday, August 12, 2010 8:35 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Build errors

linkmap.xml? I don't think we have a file with that name in FOP. Could
that be coming from Apache Forrest somehow, maybe due to a buggy XML
parser maybe? Maybe putting a current Xerces and Xalan in the JRE's
lib/endorsed directory may change something. Otherwise, please provide a
snippet from the output log.

On 10.08.2010 17:27:00 Eric Douglas wrote:
 When I download the source for fop 1.0, the ant build shows 
 successful, but if I try a regular build just to check for errors 
 before running the ant build I get a bunch of error messages such as 
 the content of element type li must match... (on linkmap.xml).  Is

 this normal or am I missing something?




Jeremias Maerki



RE: [Bug 49733] [PATCH] resolve compilation, checkstyle, javadoc warnings

2010-08-16 Thread Eric Douglas
I am in favor of clean code.  You can live with code that has warnings
as long as it compiles, runs, and doesn't crash, but it can be annoying
to other developers and should surely be removed by the time you're
calling it 1.0.
 
Important warnings like calls to deprecated methods and dead code should
be cleaned up.  Code should not give insificant warnings like an
arbitrary maximum line length.  Surely it's bad practice to make lines
unnecessarily long if they can reasonably be broken up, but it is often
easier and possibly more efficient for someone to code a line longer
than you would prefer.
 
Fleas on the couch should make the couch unusable.  Those would be your
errors.  Warnings are the stains.  You can sit on a stained couch with
no harm to yourself, though others would see your couch as less than
desirable, and if everyone allows new stains it would make your couch so
ugly that only the most desperate would bother to use it and they would
likely cringe in doing so.  I was a bit puzzled and annoyed when I first
tried to get the source and test an update, wondering why anyone would
publish code with so many reported problems, though I chose to ignore
the problem as others apparently had done since it seems to be the best
program available to do what I wanted to do and it worked despite the
problems.



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Wednesday, August 11, 2010 8:06 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: [Bug 49733] [PATCH] resolve compilation, checkstyle,
javadoc warnings


Inline below.

On Wed, Aug 11, 2010 at 7:45 PM, Vincent Hennebert
vhenneb...@gmail.com wrote:


Suppressing all the warnings at build time is a great goal that
I would
love to see achieved eventually. This gives us an automatic way
to spot
violations introduced in new code, which is better than the
informal
check that developers do (or not...) before committing. But as I
said
trying to achieve that goal now is premature.




once again, i disagree with your reasoning; i heard unanimous support
for this patch from other commenters, your reticence does not seem
warranted; Jeremias and Simon have both stated their support for taking
action to clean up the code base;

it is not premature to rid the codebase of warnings; in fact, one might
argue that it was premature to release FOP 1.0 with the existing
warnings;
 

More or less everyone agrees that the current checkstyle file is
not
satisfying. Jeremias says that he doesn't apply some rules
sometimes.
I've done the same myself in a few occasions. So new warnings
are bound
to appear shortly after this patch is applied.




to translate lack of satisfaction with the current checkstyles to mean
lack of acceptance is unwarranted; there have been no objections to it
as far as I can tell, so it is effectively accepted; I haven't heard you
or others proposing any concrete chantes to it, so it is accepted by
lazy consensus; moreover, you appear to believe (wrongly in my opinion),
that there could exist some future checkstyle rules set that was
uniformly satisfactory to all; that will never happen, and for you to
claim it should occur before taking action is nothing more than an
excuse to delay taking action;
 

Once we agree on a new checkstyle file two things will happen:
Some
rules may be removed and that may result into clutter CSOK
comments in
the code; Are you happy to re-visit the code and remove them
afterwards?
Some new rules may be put in place and that will result into a
whole
bunch of new warnings, and we're back to square one.

Globally disabling some Checkstyle rules by using CSOFF comments
is not
an option to me. This kills the very purpose of a Checkstyle
file, which
is to have a consistent coding style within the project and no
distracting variations.



who said anything about using CSOFF to globally disable options? warning
suppression is a reasonable tool when used with appropriately, and
developers should be able to override rules as needed; the fact that the
comment remains in the code means it is easy to audit for these, and use
that information to evaluate divergence from norm and practice;
 

We've been living with loads of Checkstyle warnings for years,
now what
is this sudden urge to wipe off them all? If the goal is to
achieve and
enforce zero warning, then I don't think this is doable in the
short
term. If the goal is to improve the quality of the software,
then
I don't see how putting unhelpful javadoc comments or even
disabling
Checkstyle in some places will allow to achieve that.



 
You say it is not doable in the short term, but it would take you no
more than five minutes to apply and commit this patch. Instead of
offering excuses, why don't you 

RE: Build errors

2010-08-16 Thread Eric Douglas
It appears that was the case.  I was confused because my setup has a
build folder under every project source folder, or at least it creates
it there after the first compile, so I thought the src.zip could be
extracted right over the bin.zip since the bin.zip has a build folder
and the src.zip doesn't.

I deleted my project, removed the files on disk, and extracted just the
src.zip to recreate the project.  Then I compiled and got some errors in
the Eclipse Problems tab, though none such as what I was getting
previously.  There is an error that it can't find javax.crypto because
the package added the Java libraries as some sort of specific reference
to rt.jar.  I deleted that from the build path and added a reference to
the JRE System Library and that error went away.  All other errors in
the Eclipse Problems tab appear to be expected errors, font related,
from classes with no source which are created from the ant build such as
org.apache.fop.fonts.CodePointMapping.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Thursday, August 12, 2010 8:35 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Build errors

linkmap.xml? I don't think we have a file with that name in FOP. Could
that be coming from Apache Forrest somehow, maybe due to a buggy XML
parser maybe? Maybe putting a current Xerces and Xalan in the JRE's
lib/endorsed directory may change something. Otherwise, please provide a
snippet from the output log.

On 10.08.2010 17:27:00 Eric Douglas wrote:
 When I download the source for fop 1.0, the ant build shows 
 successful, but if I try a regular build just to check for errors 
 before running the ant build I get a bunch of error messages such as 
 the content of element type li must match... (on linkmap.xml).  Is

 this normal or am I missing something?




Jeremias Maerki



RE: Build errors

2010-08-16 Thread Eric Douglas
What am I missing now on this Java build?

Running the ant script shows me a Build Successful message, though the
Problems tab in the Eclipse IDE shows missing classes for all the font
references, on the CodePointMapping and the Courier, Helvetica, etc.
These classes have no source in the IDE.  They have class files in the
jar.  I try to call the jar methods and I get errors.
A call to PDFRenderer.setupFontInfo(new FontInfo()) gives me a
compilation error message on the invalid class reference.
A call to setFontBaseURL(Fonts\) gives me an invalid path error
(trying to find syntax to point to custom font files I put in a Fonts
folder in another jar on the classpath).
I take those out to see if it just works with no reference to my custom
fonts, if it can just automatically find them in the classpath, and my
program just hangs on the FopFactory.newFop(FOUserAgent) statement. 


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Thursday, August 12, 2010 8:35 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Build errors

linkmap.xml? I don't think we have a file with that name in FOP. Could
that be coming from Apache Forrest somehow, maybe due to a buggy XML
parser maybe? Maybe putting a current Xerces and Xalan in the JRE's
lib/endorsed directory may change something. Otherwise, please provide a
snippet from the output log.

On 10.08.2010 17:27:00 Eric Douglas wrote:
 When I download the source for fop 1.0, the ant build shows 
 successful, but if I try a regular build just to check for errors 
 before running the ant build I get a bunch of error messages such as 
 the content of element type li must match... (on linkmap.xml).  Is

 this normal or am I missing something?




Jeremias Maerki



RE: Eclipse Build - fail?

2010-08-10 Thread Eric Douglas
I did figure out why I kept getting build successful without getting a
new fop.jar.  Apparently the ant script was telling it not to update the
jar when it already exists.  I worked around it by adding a delete
method in the script before the part where it gets initially created. 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Tuesday, August 10, 2010 5:17 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Eclipse Build - fail?

I don't use the Ant script to compile FOP inside Eclipse. I only use
ant resourcegen on the command-line for code generation. From there I
set up a normal Eclipse Java project.

And besides, IMO the Maven Eclipse plugin is trouble. I've uninstalled
it long ago and I'm using mvn eclipse:eclipse where I have no other
choice than to use Maven.

On 05.08.2010 16:24:53 Eric Douglas wrote:
 I have FOP source in an Eclipse Ant project.  I right click on the 
 build.xml file and select run as ant build.  This used to work.  Now I

 get messages in the console and it tells me build successful but the 
 jar doesn't update.  What could I be missing?  The most significant 
 change I have that could have broken it is I installed the maven
eclipse plugin.



Jeremias Maerki



RE: Embedding font from jar

2010-08-10 Thread Eric Douglas
If you prefer I can send coding issues to fop-users.  I'm aware of the
auto detect.  I'm just not aware of how it works, if it will find the
file I'm specifically trying to reference or if it might use a search
path which would refer to a different file.  I was trying to pass it a
specific path to the font file I put in a jar rather than use the auto
detection and it doesn't seem to handle specific paths to files inside
jars unless I'm missing something.  It appears the EmbedFileInfo string
path parameter gets used to create a StreamSource for
CustomFontMetricsMapper and doesn't like that StreamSource as a
sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Tuesday, August 10, 2010 5:21 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Embedding font from jar

Eric,
once again, a post that should have gone to fop-users.

Please see:
http://xmlgraphics.apache.org/fop/latest/fonts.html#autodetect
It will tell you how to create a JAR with fonts that FOP will
automatically detect. No Java code necessary.

On 06.08.2010 17:58:55 Eric Douglas wrote:
 I created some embedded code using EmbedFontInfo to load custom font 
 files into the Renderer setFontList and setupFontInfo methods.
 I have a program with embedded Java running on the server which is 
 working fine for creating a PDF and getting output to a printer.
 Now I'm trying to use client Java through Webstart to get the awt 
 PreviewPanel working and it doesn't like the file path to the fonts.
 I'm trying to simplify file references by putting fonts, images in a 
 jar.  That jar should be on the classpath and the server and client 
 should be able to reference the files in it the same way.
 I recompiled my FOP 0.95 jar to embed those files.  I can put them in 
 a separate jar if it makes more sense.
 Is there a simple way to reference the jar font file from embedded
code?
 I tried creating an EmbedFontInfo object using 
 jar:file:c:/web/public/fop.jar!/Fonts/LTYPEB.TTF for the embedFile 
 parameter, and it crashes on the createFont method in the 
 CustomFontMetricsMapper object.
 
 WARNING: Unable to load custom font from file 
 'jar:file:c:/web/public/fop.jar!/Fonts/LTYPEB.TTF'
 java.io.IOException: Problem reading font data.
   at java.awt.Font.createFont(Unknown Source)
   at
 org.apache.fop.render.java2d.CustomFontMetricsMapper.initialize(Custom
 Fo
 ntMetricsMapper.java:109)
 ...




Jeremias Maerki



RE: [Bug 49733] [PATCH] resolve compilation, checkstyle, javadoc warnings

2010-08-10 Thread Eric Douglas
I believe English has more words than any other language, which is why
they say it's the easiest language to learn and the hardest language to
master.
I would think warnings like calls to deprecated methods should be fixed
asap.
Other warnings like dead code and unused variables I would guess were
left in for future reference, such as methods planned to be added later
or methods removed leaving code in place in case they need added back in
later.  These should be removed if there's another way to document notes
for potential future enhancements.  If they were just sloppy coding,
putting in or leaving in stuff that has no reason to be, I agree with
Glenn it should be cleaned out.
While high quality might refer more to making a program that does what
the users need and doesn't crash, I'd agree coding should still need
some standard of quality to include error free code.  It could
discourage new developers from joining the project if they get a copy of
the Trunk and see all those warnings even if it does run despite them.

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Tuesday, August 10, 2010 9:09 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: [Bug 49733] [PATCH] resolve compilation, checkstyle,
javadoc warnings

Well, I'm not a native English-speaker, so maybe my choice of the word
rant was too much. Anyway, Glenn, we're not too far apart. I try to
remove warnings whenever I change a class, i.e. gradual improvement as
time allows. Sometimes CheckStyle would bark at something that I didn't
consider a problem so I ignored it. That's why I mentioned that
fine-tuning CheckStyle is probably a good thing. From time to time,
people would fix a bunch of classes, but a thorough attempt such as
yours hasn't happened, yet. So this is a chance for us and your work is
definitely appreciated.

I don't think we've had any voice, yet, who said that fixing the issues
was a bad idea.

On 10.08.2010 14:46:28 Glenn Adams wrote:
 my apologies if my statement appeared to be a rant, as it was not 
 intended as such;
 
 perhaps my emphasis was an exaggeration, but if one goes through the 
 trouble to add build rules for style checking, bug finding, and code 
 quality reporting, then it does appear odd to ignore them, which was 
 my reaction to the current code base and vincent's response;
 
 i admit that i prefer a zero warning policy, and i have attempted at 
 every opportunity to introduce or enforce such policy on the many dev 
 projects I've managed or participated in over four decades; in 
 general, i find it helps me and other devs, particularly as a way of 
 finding new noise we are introducing; if there is already a lot of 
 noise in the system, it is easy to ignore new noise, which is 
 precisely what i would like to avoid in my own
 contributes: contributing to the noise level;
 
 note that i am not arguing for or against a specific set of policy 
 rules, just that whatever they are, they get implemented and enforced,

 while knowing at the same time that every rule has exceptions, and 
 that mechanisms to provide filtering adequately address this point; 
 furthermore, arguing over which a particular exception is justified or

 not can become a great waste of time; as I've stated previously, if a 
 contributor or committer has made the conscious choice to disable a 
 warning, then I'm happy to accept their judgement, as long as it is 
 done in a thoughtful way, and not merely as a way of ignoring rules;
 
 if the majority of committers feel it best not to patch these warnings

 and move on from there, then i'll readily submit to that consensus; my

 hope, however, is that this contribution can positively contribute to 
 FOP and the community, so it is natural that I would prefer it not be 
 delayed for some unknown process to create a new consensus on style 
 rules;
 
 regards,
 glenn
 
 On Tue, Aug 10, 2010 at 8:07 PM, Jeremias Maerki
d...@jeremias-maerki.chwrote:
 
  I kind of agree with Glenn that we have a de-facto agreement on the 
  Checkstyle rules. We've adjusted them in the past and there's no 
  reason why we can't change it in the future. If Glenn's patch gets 
  the issue count down significantly so we can start to enforce the 
  rules, then I'm fine with it. But I don't doubt that the checkstyle 
  file may profit from some fine-tuning.
 
  Right now, I have a couple of things that I need to commit and I 
  basically don't dare commit them as people may come screaming at me 
  in that case. So I want this resolved quickly. Vincent, are going to

  process the patch? I have to do a few things first, but if you don't

  have a chance to handle it by then, I'll take a look myself.
 
  What I have a little problem with is Glenn's rant in the last
paragraph.
  Some Apache project don't even have Checkstyle rules. Furthermore, 
  having no Checkstyle issues doesn't equal high quality. High quality

  is the result of an open process of developing software (The Apache

Embedding font from jar

2010-08-06 Thread Eric Douglas
I created some embedded code using EmbedFontInfo to load custom font
files into the Renderer setFontList and setupFontInfo methods.
I have a program with embedded Java running on the server which is
working fine for creating a PDF and getting output to a printer.
Now I'm trying to use client Java through Webstart to get the awt
PreviewPanel working and it doesn't like the file path to the fonts.
I'm trying to simplify file references by putting fonts, images in a
jar.  That jar should be on the classpath and the server and client
should be able to reference the files in it the same way.
I recompiled my FOP 0.95 jar to embed those files.  I can put them in a
separate jar if it makes more sense.
Is there a simple way to reference the jar font file from embedded code?
I tried creating an EmbedFontInfo object using
jar:file:c:/web/public/fop.jar!/Fonts/LTYPEB.TTF for the embedFile
parameter, and it crashes on the createFont method in the
CustomFontMetricsMapper object.

WARNING: Unable to load custom font from file
'jar:file:c:/web/public/fop.jar!/Fonts/LTYPEB.TTF'
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont(Unknown Source)
at
org.apache.fop.render.java2d.CustomFontMetricsMapper.initialize(CustomFo
ntMetricsMapper.java:109)
...


XSL Page Variable

2010-08-05 Thread Eric Douglas
If the shell of my XSL looks like this: 
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format
http://www.google.com/url?sa=Dq=http://www.w3.org/1999/XSL/Formatusg=
AFQjCNHZhPMfx2p6D5n2w5qLURB5k932Cw  
fo:layout-master-set 
fo:simple-page-master 
xsl:attribute name=master-nameSTANDARD_PAGE/xsl:attribute 
xsl:attribute name=margin-bottomxsl:value-of 
select=PAGE_DATA/MARGIN_BOTTOM//xsl:attribute 
fo:region-body 
/fo:region-body 
/fo:simple-page-master 
/fo:layout-master-set 
fo:page-sequence 
xsl:attribute name=master-referenceSTANDARD_PAGE/xsl:attribute 
fo:flow 
xsl:attribute name=flow-namexsl-region-body/xsl:attribute 
xsl:for-each select=PAGE_DATA 
fo:block 
xsl:attribute name=break-beforepage/xsl:attribute 
xsl:for-each select=* 
... 
/xsl:for-each 
/fo:block 
/xsl:for-each 
/fo:flow 
/fo:page-sequence 
/fo:root 
So I have all my data grouped by what to print on each page, under a 
PAGE_DATA tag in the XML. Now I'm trying to put a tag under the 
PAGE_DATA tag to specify different attributes for each page, such as 
the margin-bottom mentioned here. As it is written here, it is using 
the value of the MARGIN_BOTTOM tag for the margin-bottom attribute, 
but it's only taking the last tag in the XML and applying it to all 
pages. How do I change the attributes for each page? 
Is there a place where I can set a variable from the XML tag value 
which can be processed after the for-each statement and before the 
page attributes? 


RE: XSL Page Variable

2010-08-05 Thread Eric Douglas
Hi Pascal,
 
If I'm understanding you correctly I think this could work.  I realize it's for 
FOP development and it may not be an FOP issue, but it's not a pure XSLT issue. 
 The XSLT handles HTML style formatting.  The FOP is the paging formatter.  
This is a page issue.  As you say try 2 passes I'm thinking I just need to 
separate the tags, that I'm trying to break on PAGE_DATA which triggers the new 
page call to the simple-page-master, then I'm trying to find the page layout 
data under the PAGE_DATA.  I should be able to get the page layout data before 
I find the PAGE_DATA tag to start the new pages..



From: Pascal Sancho [mailto:pascal.san...@takoma.fr] 
Sent: Thursday, August 05, 2010 8:52 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: XSL Page Variable


Hi Eric,

this list is about FOP development, not XSLT or XSL-FO questions.
That said:
 - all pages features are nested in the fo:root/fo:layout-master-set element,
 - while content is nested in fo:root/fo:page-sequence.

Therefore you should process your XML in a 2 passes XSLT:
 - 1 template for page masters,
 - 1 template for content.

Pascal


Le 05/08/2010 14:26, Eric Douglas a écrit : 

If the shell of my XSL looks like this: 
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format 
http://www.google.com/url?sa=Dq=http://www.w3.org/1999/XSL/Formatusg=AFQjCNHZhPMfx2p6D5n2w5qLURB5k932Cw
 
fo:layout-master-set
fo:simple-page-master
xsl:attribute name=master-nameSTANDARD_PAGE/xsl:attribute
xsl:attribute name=margin-bottomxsl:value-of
select=PAGE_DATA/MARGIN_BOTTOM//xsl:attribute
fo:region-body
/fo:region-body
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence
xsl:attribute name=master-referenceSTANDARD_PAGE/xsl:attribute
fo:flow
xsl:attribute name=flow-namexsl-region-body/xsl:attribute
xsl:for-each select=PAGE_DATA
fo:block
xsl:attribute name=break-beforepage/xsl:attribute
xsl:for-each select=*
...
/xsl:for-each
/fo:block
/xsl:for-each
/fo:flow
/fo:page-sequence
/fo:root 
So I have all my data grouped by what to print on each page, under a
PAGE_DATA tag in the XML. Now I'm trying to put a tag under the
PAGE_DATA tag to specify different attributes for each page, such as
the margin-bottom mentioned here. As it is written here, it is using
the value of the MARGIN_BOTTOM tag for the margin-bottom attribute,
but it's only taking the last tag in the XML and applying it to all
pages. How do I change the attributes for each page?
Is there a place where I can set a variable from the XML tag value
which can be processed after the for-each statement and before the
page attributes? 




Eclipse Build - fail?

2010-08-05 Thread Eric Douglas
I have FOP source in an Eclipse Ant project.  I right click on the
build.xml file and select run as ant build.  This used to work.  Now I
get messages in the console and it tells me build successful but the jar
doesn't update.  What could I be missing?  The most significant change I
have that could have broken it is I installed the maven eclipse plugin.



RE: fixing and maintaining zero reported warnings policy?

2010-08-03 Thread Eric Douglas
I've wondered about that myself.  I tried working with the Trunk and got
countless warnings.  They included dead code, deprecated methods, and
unused assigned variables among other things.  To sift through you could
go into project specific compile options in Eclipse and tell it to
ignore them if you have the project created as source.  There may be an
option to ignore on the ant build that's not as obvious but clean code
would be appreciated, even as much as I appreciate the dirty code if the
warnings don't crash anything and it got some useful features
implemented faster.  I would hope there's less urgency to implement now
that the project has passed the 1.0 mark and code can be kept clean.
 



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, August 03, 2010 4:27 AM
To: FOP Developers
Subject: fixing and maintaining zero reported warnings policy?


Would anyone mind if I submit a patch that fixes all the outstanding
warnings, etc., reported during the build process and by checkstyles and
findbugs on the trunk? More importantly, if I do this, is it possible to
adhere to a zero tolerance policy on warnings for future commits? 

I find the 3000 or so warnings currently produced to be a rather
significant impediment to doing work on this code base, or at least, in
preventing an avalanche of new warnings upon future commits, given the
trouble required to determine the diffs between new warnings and old
warnings. Perhaps this isn't a problem for changes to one file, but for
changes to a hundred files, it is a major headache. Anyway, some of
these 3000 are actually real, lurking bugs.

I'm willing to do the cleanup work if others will help maintain
cleanliness going forward.

Regards,
Glenn



Files in Jar

2010-08-03 Thread Eric Douglas
I'm using Eclipse if that matters.
I'm trying to create a jar file containing my TTF files, so I can load
them in at runtime from the classpath rather than worry about physical
file paths.
I would like to do the same for images.
When I create a project it lets me put in any file type, but when I try
to create a JAR from it, those files don't get into that JAR.
I've tried a new regular Project with the Export as JAR option.  I've
tried modifying the build.xml for the FOP project.  I can't seem to get
it to include the files.
How should I go about doing this?


RE: Font Glyph?

2010-07-21 Thread Eric Douglas
I like your idea of the 'last resort' font, though I didn't like the
configuration file to begin with.
You could add an option to the configuration file also if you like the
configuration file, but I think when the program allows integration
using embedded code, there should be an option for all custom font setup
in the API.



From: Glenn Adams [mailto:gl...@skynav.com] 
Sent: Tuesday, July 20, 2010 8:59 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Font Glyph?


Comment inline. Note that I have assigned the new bug to myself, so I
will undertake the work to satisfy this.


On Wed, Jul 21, 2010 at 1:25 AM, Vincent Hennebert
vhenneb...@gmail.com wrote:


Hi,

I'm not keen on adding Yet Another configuratin option to the
config
file, there are more than enough already.



What's the purpose in having a configuration file if it isn't used for
configuration information?



Landscape

2010-07-21 Thread Eric Douglas
How do I print Landscape?
I tried just telling my XSL to swap the values of page-height and
page-width.
I'm using embedded code, passing the FOP transformed output to a
ByteArrayOutputStream, and passing those bytes into pdfbox.
I then get the PageFormat of the document and it has the correct width
and height for landscape, but the orientation value is returning
portrait.
I save the output to a pdf and open it and it appears to be landscaped,
but I try to print it and get a warning light on the printer asking what
paper it should be printing to.
Am I missing something in my FOP code or might I be missing something in
the pdfbox code?
I set the portrait print to 8.5 x 11 and everything works fine.  I set
the landscape print to 11 x 8.5 and it doesn't seem to be recognizing
it correctly.


RE: Font Glyph?

2010-07-19 Thread Eric Douglas
Thanks, I'll look into that.
Yes, FOP does print a # with the Trunk, at least as it was last I
compiled it.
FOP prints a square with the 2611, which could be some sort of default
invalid?
Windows apps (Notepad, Wordpad?) print squares whenever they load a file
with an unrecgnized character.
I'll have to see what that unicode is all about.
If it's supposed to load those chars listed on that unicode.org website,
and they're supposed to be in the font file, I may need to load in
another font file to get those.
I'm still working on installing that font editor to see if it says the
font contains those glyphs.
 

-Original Message-
From: J.Pietschmann [mailto:j3322...@yahoo.de] 
Sent: Saturday, July 17, 2010 11:20 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Font Glyph?

On 15.07.2010 22:44, Eric Douglas wrote:
 Then I pass a text value of #x2611; in my XML.  When the 
 transformer uses FOP to translate the XML into output, this prints a
square.
Have a look at http://www.unicode.org/charts/charindex.html
U2611 is BALLOT BOX WITH CHECK, i.e. not a square (U2610 should be a
square, are you sure about the entity?) If FOP couldn't find the glyph,
it would have printed a # instead.
You could use one of the font editors to check whether your font
actually has a glyph for the U2611 character (try
http://fontforge.sourceforge.net/)


 I tried replacing my fop.jar with one that I compiled from the Trunk, 
 and instead of printing the square it printed an error message to the 
 Java Console that the font doesn't contain the specified glyph.
That's mildly odd, I'd guess your method for telling FOP about your font
doesn't work as in Trunk.

J.Pietschmann


RE: Font Glyph?

2010-07-19 Thread Eric Douglas
I don't understand what unicode.org is saying if it's just referring to
what characters the codes should reference if they have to be in the
font.  Fontforge says U2610 and U2611 are not in the font.

Fontforge is an ugly program.  It runs within Cygwin, where it displays
a window showing the characters in the font, but it doesn't show them
all and doesn't have a scrollbar..
I would like an easy way to view the characters in the font to see if I
have something available that looks like a square/checkbox.
I can only assume the square I'm getting is a default in FOP 0.95 for
all missing glyphs. 

-Original Message-
From: J.Pietschmann [mailto:j3322...@yahoo.de] 
Sent: Saturday, July 17, 2010 11:20 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Font Glyph?

On 15.07.2010 22:44, Eric Douglas wrote:
 Then I pass a text value of #x2611; in my XML.  When the 
 transformer uses FOP to translate the XML into output, this prints a
square.
Have a look at http://www.unicode.org/charts/charindex.html
U2611 is BALLOT BOX WITH CHECK, i.e. not a square (U2610 should be a
square, are you sure about the entity?) If FOP couldn't find the glyph,
it would have printed a # instead.
You could use one of the font editors to check whether your font
actually has a glyph for the U2611 character (try
http://fontforge.sourceforge.net/)


 I tried replacing my fop.jar with one that I compiled from the Trunk, 
 and instead of printing the square it printed an error message to the 
 Java Console that the font doesn't contain the specified glyph.
That's mildly odd, I'd guess your method for telling FOP about your font
doesn't work as in Trunk.

J.Pietschmann


Font Glyph?

2010-07-15 Thread Eric Douglas
I'm running FOP 0.95 with embedded code.

I'm loading my font in using EmbedFontInfo with font file lucon.ttf
(copied from with Windows XP system font folder), using a file:///
reference to point to the ttf, passing in null for the first parameter
(metrics file), then adding the EmbedFontInfo to a java.util.ArrayList
to pass in to the PDFRenderer (setFontList) which I use on my
FOUserAgent with setRendererOverride.

Maybe this isn't the best or proper way to load in a custom embedded
font but it's working.
Then I pass a text value of #x2611; in my XML.  When the transformer
uses FOP to translate the XML into output, this prints a square.
I tried replacing my fop.jar with one that I compiled from the Trunk,
and instead of printing the square it printed an error message to the
Java Console that the font doesn't contain the specified glyph.
I haven't checked if the 1.0 is available for download to test with
that.
I don't remember where I came up with this character value.  Is this
supposed to print a square, which would be an error in the Trunk, or was
this an error in the 0.95 and it was actually supposed to say it
couldn't find the glyph?


RE: Purpose of IFRenderer.TextUtil.combined?

2010-07-07 Thread Eric Douglas
Last I attempted to build the Trunk I got a ton of warnings, including
the Serializable class without serialVersionUID, The field __ is
never read locally, and Dead code..

It seems whomever is putting in such code is either using a different
compiler, is ignoring the warnings, or has the warnings disabled.
I don't know how much the serialization error means.  Those other errors
are just clutter code (won't crash anything, should cause the compiled
jar to be a bit larger than necessary).

I've written some clutter code myself.  Sometimes it's a method I've
removed all reference to but leave it in just in case it is still useful
and I want to add a reference from something later.  Sometimes it's test
code that I've written a different way and left it around in case the
other way doesn't come out right.  Sometimes it's future code, adding a
flag to remind of a feature to be added later..

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, July 07, 2010 9:02 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: Purpose of IFRenderer.TextUtil.combined?

Vincent,

that's from when I implemented the IF format. I experimented to get the
word and letter spaces right. Obviously, that's a left-over by mistake
that can be removed now.

On 07.07.2010 13:38:40 Vincent Hennebert wrote:
 Hi,
 
 what was that boolean supposed to do, given that it's set to false by 
 default, never set to true and results into dead code in renderSpace 
 and renderText?
 
 Thanks,
 Vincent




Jeremias Maerki



Invalid Javadoc

2010-07-06 Thread Eric Douglas
Is this a correct website for the Javadoc?  Was it given docs for an
invalid version?  I notice it's path shows beta, but it appears this
class is invalid..
http://docjar.com/docs/api/org/apache/fop/render/pdf/fonts/LazyFont.html


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-23 Thread Eric Douglas
What path?
What version fop are you using?
I downloaded the source and rebuilt the jar without any classpath in it because 
we use it embedded in another language which has it's own classpath setup where 
I reference all required jars, but I haven't sent that version out yet.  Our 
live system is still using the fop.jar from the 0.95 binary download.  If I 
open that jar in 7-zip, I can see it contains a folder called META-INF.  In 
that folder is a file called MANIFEST.MF.  Within that file is this statement:
Class-Path: avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar 
commons-logging-1.0.4.jar serializer-2.7.0.jar servlet-2.2.jar xalan-2.7.0.jar 
xercesImpl-2.7.1.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar 
xmlgraphics-commons-1.3.1.jar fop-hyph.jar jai_codec.jar jai_core.jar 
jai_imageio.jar jimi-1.0.jar xmlunit1.0.jar 

So you can see there is no path.  That path would use I assume any path already 
assigned to the JVM, or it would expect all those jars to exist in the same 
path as fop.jar.

-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Wednesday, June 23, 2010 7:45 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Tue, Jun 22, 2010 at 15:50, Eric Douglas edoug...@blockhouse.com wrote:
 You can view the files in a jar including classes with a jar viewer 
 program.  A jar is just a form of compressed file like zip or rar.  I 
 use 7-zip to view it.

Using: jar -tvf fop-hyph.jar I get (other languages deleted from the list):

    0 Mon Apr 14 13:32:22 CDT 2008 META-INF/
   71 Mon Apr 14 13:32:22 CDT 2008 META-INF/MANIFEST.MF
    0 Mon Apr 14 13:31:24 CDT 2008 hyph/
74672 Mon Apr 14 13:25:02 CDT 2008 hyph/en_US.hyp 126340 Mon Apr 14 13:25:02 
CDT 2008 hyph/en_GB.hyp
67983 Mon Apr 14 13:25:02 CDT 2008 hyph/en.hyp

Using cat on the manifest file shows:

Manifest-Version: 1.0
Created-By: 1.5.0_14 (Sun Microsystems Inc.)

(blank line at the end)

So, assuming the jar file is physically in dir /usr/local/share/fop, should 
the CLASSPATH read:

  export CLASSPATH=/usr/local/share/fop/fop-hyph.jar

or something else, i.e., how is the path inside the manifest handled?

Or should I manually repack the jar file without the subdirectory hyph?

Thanks,

-Tom


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-23 Thread Eric Douglas
What do you mean install after a build?  Fop is not an application to be 
installed.  It's a Java program, which you can run from a command line or embed 
in another application.

The ant classpath arguments are in the build.xml.  I only vaguely know ant to 
tell what that code is doing but there seems to be one classpath ant needs to 
be able to compile the fop.jar and another classpath ant uses to build the 
runtime path as the classpath statement in the manifest.mf text file in the 
jar.  To build of course requires downloading the fop source, then downloading 
some other required jars from other sites.

To 'install' as in to be able to run from a command line, simply requires 
having all required jars in the classpath.  If you use the binary download, the 
classpath is built into the jar's manifest.  Just read the classpath statement 
there and have all those jars in the same path as the fop jar.

What else are you trying to do, or where exactly are you getting an error?

-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Wednesday, June 23, 2010 8:38 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Wed, Jun 23, 2010 at 06:45, Tom Browder tom.brow...@gmail.com wrote:
 On Tue, Jun 22, 2010 at 15:50, Eric Douglas edoug...@blockhouse.com wrote:
...
 So, assuming the jar file is physically in dir /usr/local/share/fop, 
 should the CLASSPATH read:

  export CLASSPATH=/usr/local/share/fop/fop-hyph.jar

By experiment, that method worked for the build directory, but not for my 
installed fop 0.95.

I also tried using the environment variable FOP_HYPHENATION_PATH again (after 
unsetting CLASSPATH).

I tried it two ways: (1) setting it to point the file and (2) setting it to 
point to the parent directory of the file.

Both worked for the installed fop 0.95.

I would like to try all that with the trunk version, but nowhere on the fop 
site does it tell how to install after a build.  The closest thing I found is 
the package argument to ant.

What should I do to install, please?

Thanks.

-Tom


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-23 Thread Eric Douglas
The binary download is the same as the source download should be if you compile 
it.
That's not a standalone package.  It doesn't install as an application in 
Windows.

I don't know anything about Ubuntu, but to distribute it you would just get the 
binary jar and package it into an msi, zip, or other such format yourself, to 
include the jars referenced in the classpath.  Some required jars must be 
downloaded from other sites.
Do you have a need to send the fop program to someone else to run on their 
local machine?  Can you just set it on a server and have them connect to run it 
ie webstart? 

-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Wednesday, June 23, 2010 9:33 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Wed, Jun 23, 2010 at 08:06, Eric Douglas edoug...@blockhouse.com wrote:
 What do you mean install after a build?
...
 To 'install' as in to be able to run from a command line, simply 
 requires having all required jars in the classpath.  If you use the 
 binary download, the classpath is built into the jar's manifest.  Just 
 read the classpath statement there and have all

Well then how does a developer build the installation package (i.e., the 
binary download)?

I want  to install the trunk build just as, say, Ubuntu does to ensure all 
dependencies, etc., work outside the build environment.

And I want to be able to distribute the run package to others.

-Tom


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-23 Thread Eric Douglas
Of course the 0.95 is not the same as the trunk.
There is a binary download and a source download for 0.95.  If you compile that 
source, you should get a binary which matches the binary download.  The trunk 
is only available in source form.

To produce a binary from source you have to do the Ant build.  Supposedly this 
can be done from a command prompt.  I use Eclipse.  To compile with Ant in 
Eclipse, you just create a new project using Ant, then open that project, find 
the build.xml file and right click on it.  Select Run As Ant.

In order to compile the source either for 0.95 or the trunk, you have to add 
the missing jars.  If you attempt to build it you should get errors which 
should tell you which jars it's missing.  Some jars are not included because 
the license doesn't allow.
Once it's compiled, open the jar as an archive and you can view the manifest.mf 
file which has a classpath statement with the list of other jars needed to run 
it.
 

-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Wednesday, June 23, 2010 11:09 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Wed, Jun 23, 2010 at 09:04, Eric Douglas edoug...@blockhouse.com wrote:
 The binary download is the same as the source download should be if you 
 compile it.
 That's not a standalone package.  It doesn't install as an application in 
 Windows.

I'm not trying to be difficult here, Eric, just trying to figure the fop system 
out.

I compared the fop 0.95 binary download with the trunk build and they are not 
the same--extra stuff in the trunk (not counting subversion files), extra stuff 
in the binary.  Obviously there is either manual intervention or a packaging 
script to produce the bin package for download.  If there is not a script, 
there should be.  If there is a script, where is it?

-Tom


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-23 Thread Eric Douglas
You have to use Subversion to download the trunk source.
There is a Subversion program which you can run from a command prompt, and 
there's an extension for Eclipse.  Either way works. 

-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Wednesday, June 23, 2010 12:01 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Wed, Jun 23, 2010 at 10:52, Eric Douglas edoug...@blockhouse.com wrote:
 Of course the 0.95 is not the same as the trunk.
 There is a binary download and a source download for 0.95.  If you compile 
 that source, you should get a binary which matches the binary download.  The 
 trunk is only available in source form.

Then how is the source download package produced from the trunk?

-Tom


RE: SEVERE: Couldn't find hyphenation pattern en_US

2010-06-22 Thread Eric Douglas
You can view the files in a jar including classes with a jar viewer
program.  A jar is just a form of compressed file like zip or rar.  I
use 7-zip to view it.

You can get the manifest.mf file from the jar to check for a classpath
being referenced by the jar.  If the classpath just has the jar names,
it's assumed they're in the same path as the fop.jar.  Make sure you
have all the jars referenced in the classpath.  Some of them you have to
download elsewhere and you may need to rename.

The classpath within the jar may interfere with programs which embed the
jar and assign their own classpath.  I had that problem, so I downloaded
the source, removed the classpath from the manifest, and recompiled it
myself.


-Original Message-
From: Tom Browder [mailto:tom.brow...@gmail.com] 
Sent: Tuesday, June 22, 2010 4:43 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: SEVERE: Couldn't find hyphenation pattern en_US

On Tue, Jun 22, 2010 at 15:29, J.Pietschmann j3322...@yahoo.de wrote:
 On 22.06.2010 19:02, Tom Browder wrote:

 I have tried to explicitly point to the fop-hyph.jar file with the 
 FOP_HYPHENATION_PATH environment variable but that doesn't seem to 
 work.

So should I file a bug for that?

 The fop-hyph.jar must be in the classpath, putting it into the fop/lib

 directory should be sufficient if FOP is run using one of the scripts 
 as they pick up any jar there.

 I'm not sure whether the fop-hyph.jar from the OFFO project contains 
 an en_US hyphenation class, maybe there is only an en_UK class there. 
 Check using jar -tvf lib/fop-hyph.jar

Note that I tried the CLASSPATH trick before with fop 0.95 and it didn't
work, but I'll try again.  Is there any way (tool or utility) to read a
jar file to see if a particular hyphenation class is there?

Thanks,

-Tom


AWT SVG Error

2010-06-17 Thread Eric Douglas
I can run my program with the output going to PDF and it looks fine.  If
I run the same exact program except send the output to the
org.apache.fop.render.awt.viewer.PreviewPanel using
MIME_FOP_AWT_PREVIEW, I get these and many more related lines in my Java
Console:

Jun 17, 2010 4:04:16 PM org.apache.fop.render.AbstractRenderer renderXML
SEVERE: Some XML content will be ignored. Could not render XML
java.lang.ExceptionInInitializerError
at
org.apache.fop.render.AbstractRenderer.renderXML(AbstractRenderer.java:8
06)

I searched the web and it opints to
http://xmlgraphics.apache.org/fop/0.95/graphics.html, suggesting the
Batik doesn't recognize a graphical environment.  Is there something I
need to add to the (FOP 0.95) code to recognize the graphics?  The
PreviewPanel is a graphical object and it does display fine except for
the image which is being drawn using SVG.  I tried adding the jars to
the classpath, for an X server
(http://sourceforge.net/projects/weirdx/files/WeirdX/1.0.32/weirdx-1.0.3
2.zip/download) and for the PJA ToolKit, and that alone didn't fix it.

What am I missing?


RE: FOP Trunk

2010-06-08 Thread Eric Douglas
I solved the issues this morning.
I looked up Eclipse and ant building and determined that build project
doesn't work.
Instead of using the normal Build Project option, I have to open the
project, find the build.xml, right click it, and select Run As ant
build.
Of course to make that work I had to download 3 jars separately and add
them to the build path.
ant.jar
http://ant.apache.org/bindownload.cgi
fop-hyph.jar
http://cdnetworks-us-2.dl.sourceforge.net/project/offo/offo-hyphenation/
1.2/offo-hyphenation-fop-stable_v1.2.zip
jai-core-1.1.3-alpha.jar
http://mirrors.ibiblio.org/pub/mirrors/maven/geoserver/maven/jai/jars/ja
i-core-1.1.3-alpha.jar

Ant was the easiest to find.  The others took a bit of digging. I'm not
sure that's the official location for the jai but that jar works.
I got a warning on a jre reference in the build path so I removed that
and added the JRE System Library.
Adding the 3 jars and using the ant option on the build.xml worked for
the 0.95 source and the trunk.

Now the question is, where's the what's new?  What's the difference
between 0.95 and the trunk?


-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Thursday, May 27, 2010 10:52 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP Trunk

On 27.05.2010 16:36:53 Eric Douglas wrote:
 I'm not sure what ran that through ant means.  That is likely the
problem.

Apache Ant is our build tool used to compile FOP. http://ant.apache.org
See also: http://xmlgraphics.apache.org/fop/trunk/compiling.html

 I'll try the Eclipse setup.  Thanks Jeremias for this:
 http://wiki.apache.org/xmlgraphics-fop/FOPIDESetupGuide should help
here.
 
 I tried that link and it says I need Subclipse.  I try the link to
download on this site:
 http://subclipse.tigris.org/subclipse/changes.html
 It says I need a username and password to login to their server. 

Just use http://subclipse.tigris.org/update_1.6.x as Eclipse Update Site
to install the Subclipse plug-in. No login required.

But you can also skip Subclipse and set up your Eclipse project from
another FOP working copy made with some other SVN client. Using
Subclipse is just one way to do it.

 I did identify the jai jars I need.  I just don't know where to find
them.  I tried downloading them from here:
 https://jai-imageio.dev.java.net/binary-builds.html#Stable_builds
 Using the link to the file jai_imageio-1_1-lib-windows-i586-jar.zip I 
 just get a zip file containing one jar which contains an exe which 
 wants to install tools.  Is there a place to download those 2 jars or 
 do I find them from that install?

I don't think so. The installation executable is there because they
install a native DLL alongside the JARs. You could install it, copy away
the two JARs and then uninstall it again. The native part is not
strictly required.

Feel free to improve the Wiki page as you see fit.


RE: FOP Trunk

2010-06-08 Thread Eric Douglas
Jeremias, my project isn't currently setup like that.  I haven't
installed Subclipse yet.  I wasn't planning on making any real changes
at this time.  I just used the DOS svn checkout command to retrieve the
trunk files at a point in time, then used the Eclipse create new project
from existing Ant buildfile option, just to build a working jar.  Since
I was only planning to build it once, or a few times maybe for testing,
a few seconds or a minute extra to build is not a problem for efficient
work.  I'm a novice at Java programming, so the only changes I would
make for testing would be to add log statements to verify in the Java
Console what it's doing.

I will consider switching the setup to match yours with the link to the
http repository.  For now I'm just wondering about the what's new.  What
functional differences should I note between FOP 0.95 and Trunk?
I'm guessing there's a bit more than bug fixes, since I notice some new
classes, and the jar went from 2315KB to 3110KB.

FYI, maybe it's just me but I had issues with the 0.95 trying to send
output directly to a printer, to use the same code to send to multiple
printers and get it using the proper paper tray.. But I did find a
workaround.  Instead of trying to use the MIME_FOP_PRINT, I just use the
MIME_PDF and get the PDF formatted output, then add a
ByteArrayOutputStream object.  The transform puts the output in the
object instead of creating a physical PDF, and I pass it to Apache's
pdfbox program to print.  This is working great.
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Tuesday, June 08, 2010 11:08 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP Trunk

Eric, resorting to the Ant Builder in Eclipse shouldn't be necessary.
It's just too slow for efficient work. I'm attaching a screenshot from
one of my working copies so you can see what needs to be set up. Before
doing that, just execute ant resourcegen once and that should set up
all generated files you'll need.

Note that the jimi-1.0.jar is not really necessary. It's there for
historical reasons. And XMLUnit can be found at
http://xmlunit.sourceforge.net/

On 08.06.2010 16:29:34 Eric Douglas wrote:
 I solved the issues this morning.
 I looked up Eclipse and ant building and determined that build project

 doesn't work.
 Instead of using the normal Build Project option, I have to open the 
 project, find the build.xml, right click it, and select Run As ant 
 build.
 Of course to make that work I had to download 3 jars separately and 
 add them to the build path.
 ant.jar
 http://ant.apache.org/bindownload.cgi
 fop-hyph.jar
 http://cdnetworks-us-2.dl.sourceforge.net/project/offo/offo-hyphenatio
 n/ 1.2/offo-hyphenation-fop-stable_v1.2.zip
 jai-core-1.1.3-alpha.jar
 http://mirrors.ibiblio.org/pub/mirrors/maven/geoserver/maven/jai/jars/
 ja
 i-core-1.1.3-alpha.jar
 
 Ant was the easiest to find.  The others took a bit of digging. I'm 
 not sure that's the official location for the jai but that jar works.
 I got a warning on a jre reference in the build path so I removed that

 and added the JRE System Library.
 Adding the 3 jars and using the ant option on the build.xml worked for

 the 0.95 source and the trunk.
 
 Now the question is, where's the what's new?  What's the difference 
 between 0.95 and the trunk?
 
 
 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Thursday, May 27, 2010 10:52 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: FOP Trunk
 
 On 27.05.2010 16:36:53 Eric Douglas wrote:
  I'm not sure what ran that through ant means.  That is likely the
 problem.
 
 Apache Ant is our build tool used to compile FOP. 
 http://ant.apache.org See also: 
 http://xmlgraphics.apache.org/fop/trunk/compiling.html
 
  I'll try the Eclipse setup.  Thanks Jeremias for this:
  http://wiki.apache.org/xmlgraphics-fop/FOPIDESetupGuide should help
 here.
  
  I tried that link and it says I need Subclipse.  I try the link to
 download on this site:
  http://subclipse.tigris.org/subclipse/changes.html
  It says I need a username and password to login to their server. 
 
 Just use http://subclipse.tigris.org/update_1.6.x as Eclipse Update 
 Site to install the Subclipse plug-in. No login required.
 
 But you can also skip Subclipse and set up your Eclipse project from 
 another FOP working copy made with some other SVN client. Using 
 Subclipse is just one way to do it.
 
  I did identify the jai jars I need.  I just don't know where to find
 them.  I tried downloading them from here:
  https://jai-imageio.dev.java.net/binary-builds.html#Stable_builds
  Using the link to the file jai_imageio-1_1-lib-windows-i586-jar.zip 
  I just get a zip file containing one jar which contains an exe which

  wants to install tools.  Is there a place to download those 2 jars 
  or do I find them from that install?
 
 I don't think so. The installation executable is there because they 
 install a native DLL alongside

RE: FOP Trunk

2010-06-08 Thread Eric Douglas

Jeremias, my project isn't currently setup like that.  I haven't
installed Subclipse yet.  I wasn't planning on making any real changes
at this time.  I just used the DOS svn checkout command to retrieve the
trunk files at a point in time, then used the Eclipse create new project
from existing Ant buildfile option, just to build a working jar.  Since
I was only planning to build it once, or a few times maybe for testing,
a few seconds or a minute extra to build is not a problem for efficient
work.  I'm a novice at Java programming, so the only changes I would
make for testing would be to add log statements to verify in the Java
Console what it's doing.

I will consider switching the setup to match yours with the link to the
http repository.  For now I'm just wondering about the what's new.  What
functional differences should I note between FOP 0.95 and Trunk?
I'm guessing there's a bit more than bug fixes, since I notice some new
classes, and the jar went from 2315KB to 3110KB.

FYI, maybe it's just me but I had issues with the 0.95 trying to send
output directly to a printer, to use the same code to send to multiple
printers and get it using the proper paper tray.. But I did find a
workaround.  Instead of trying to use the MIME_FOP_PRINT, I just use the
MIME_PDF and get the PDF formatted output, then add a
ByteArrayOutputStream object.  The transform puts the output in the
object instead of creating a physical PDF, and I pass it to Apache's
pdfbox program to print.  This is working great.
 

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
Sent: Tuesday, June 08, 2010 11:08 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP Trunk

Eric, resorting to the Ant Builder in Eclipse shouldn't be necessary.
It's just too slow for efficient work. I'm attaching a screenshot from
one of my working copies so you can see what needs to be set up. Before
doing that, just execute ant resourcegen once and that should set up
all generated files you'll need.

Note that the jimi-1.0.jar is not really necessary. It's there for
historical reasons. And XMLUnit can be found at
http://xmlunit.sourceforge.net/

On 08.06.2010 16:29:34 Eric Douglas wrote:
 I solved the issues this morning.
 I looked up Eclipse and ant building and determined that build project

 doesn't work.
 Instead of using the normal Build Project option, I have to open the 
 project, find the build.xml, right click it, and select Run As ant 
 build.
 Of course to make that work I had to download 3 jars separately and 
 add them to the build path.
 ant.jar
 http://ant.apache.org/bindownload.cgi
 fop-hyph.jar
 http://cdnetworks-us-2.dl.sourceforge.net/project/offo/offo-hyphenatio
 n/ 1.2/offo-hyphenation-fop-stable_v1.2.zip
 jai-core-1.1.3-alpha.jar
 http://mirrors.ibiblio.org/pub/mirrors/maven/geoserver/maven/jai/jars/
 ja
 i-core-1.1.3-alpha.jar
 
 Ant was the easiest to find.  The others took a bit of digging. I'm 
 not sure that's the official location for the jai but that jar works.
 I got a warning on a jre reference in the build path so I removed that

 and added the JRE System Library.
 Adding the 3 jars and using the ant option on the build.xml worked for

 the 0.95 source and the trunk.
 
 Now the question is, where's the what's new?  What's the difference 
 between 0.95 and the trunk?
 
 
 -Original Message-
 From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch]
 Sent: Thursday, May 27, 2010 10:52 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: FOP Trunk
 
 On 27.05.2010 16:36:53 Eric Douglas wrote:
  I'm not sure what ran that through ant means.  That is likely the
 problem.
 
 Apache Ant is our build tool used to compile FOP. 
 http://ant.apache.org See also: 
 http://xmlgraphics.apache.org/fop/trunk/compiling.html
 
  I'll try the Eclipse setup.  Thanks Jeremias for this:
  http://wiki.apache.org/xmlgraphics-fop/FOPIDESetupGuide should help
 here.
  
  I tried that link and it says I need Subclipse.  I try the link to
 download on this site:
  http://subclipse.tigris.org/subclipse/changes.html
  It says I need a username and password to login to their server. 
 
 Just use http://subclipse.tigris.org/update_1.6.x as Eclipse Update 
 Site to install the Subclipse plug-in. No login required.
 
 But you can also skip Subclipse and set up your Eclipse project from 
 another FOP working copy made with some other SVN client. Using 
 Subclipse is just one way to do it.
 
  I did identify the jai jars I need.  I just don't know where to find
 them.  I tried downloading them from here:
  https://jai-imageio.dev.java.net/binary-builds.html#Stable_builds
  Using the link to the file jai_imageio-1_1-lib-windows-i586-jar.zip
  I just get a zip file containing one jar which contains an exe which

  wants to install tools.  Is there a place to download those 2 jars 
  or do I find them from that install?
 
 I don't think so. The installation executable is there because they 
 install a native DLL alongside

FOP Trunk

2010-05-27 Thread Eric Douglas
Hi,
I downloaded the FOP Trunk using the svn checkout, then tried to create
a project and import it into Eclipse and compile it, and got all sorts
of errors.  Am I missing something?
First it said it was missing classes.  I selected edit build path and
added external jars ant.jar and junit-4.8.2.jar I found and downloaded
seperately.  That fixed a lot of the errors.  It's still saying it can't
find classes from javax.media.jai.*, org.apache.fop.fonts.base14.*, and
org.apache.fop.fonts.CodePointMapping, and it lists errors in XML files
and the properties.dtd file (which starts a !DOCTYPE tag and never
closes it).


RE: FOP Trunk

2010-05-27 Thread Eric Douglas
yes 

-Original Message-
From: Venkat Reddy [mailto:vanukuri.ven...@googlemail.com] 
Sent: Thursday, May 27, 2010 9:28 AM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: FOP Trunk

Hi, Are you in Windows environment?

Eric Douglas wrote:

 Hi,
 I downloaded the FOP Trunk using the svn checkout, then tried to 
 create a project and import it into Eclipse and compile it, and got 
 all sorts of errors.  Am I missing something?

 First it said it was missing classes.  I selected edit build path and 
 added external jars ant.jar and junit-4.8.2.jar I found and downloaded

 seperately.  That fixed a lot of the errors.  It's still saying it 
 can't find classes from javax.media.jai.*, 
 org.apache.fop.fonts.base14.*, and 
 org.apache.fop.fonts.CodePointMapping, and it lists errors in XML 
 files and the properties.dtd file (which starts a !DOCTYPE tag and 
 never closes it).




  1   2   >