Java Mailing List Archive

http://www.java2.5341.com/

Home » fop-users-digest.xmlgraphics »

fop-users Digest 7 Jan 2013 00:15:45 -0000 Issue 2632

fop-users-digest-help

2013-01-06


Author LoginPost Reply

fop-users Digest 7 Jan 2013 00:15:45 -0000 Issue 2632

Topics (messages 36150 through 36156)

Re: FOP 1.1 embedded examples - step 3 (final step)
 36150 by: Robert Meyer

Re: FOP-Trunk revision 1428722 unit test fails
 36151 by: John Brown
 36155 by: John Brown

JFOR 0.7.1 behaving weird
 36152 by: Romit Saha
 36154 by: Robert Meyer

Re: fop-ttfreader - output bounding box information for characters?
 36153 by: Chris Bowditch
 36156 by: Alexey Neyman

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: fop-users@(protected)
To unsubscribe, e-mail: fop-users-digest-unsubscribe@(protected)
For additional commands, e-mail: fop-users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: fop-users_36150.eml (zipped)
Hi Arjan,

Its been about 10 years since I did any Delphi, so unfortunately I doubt i'll be much help. However, from looking around there does seem to be another method in the jni called FindClass.

This is a guess as I don't have Delphi to hand, but using jni.FindClass("java.io.File") should either directly or indirectly allow you to create an equivalent java file object [1]. I am guessing then you should be able to pass those objects along with the methodID (returned from GetMethodID) into the CallObjectMethod routine.

If you are still having problems, I would suggest asking this same question on a Delphi forum as they would be best suited to help you.

[1] http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

Regards,

Robert Meyer

> From: arjan.bokx@akb-ls.nl
> To: fop-users@xmlgraphics.apache.org
> Subject: RE: FOP 1.1 embedded examples - step 3 (final step)
> Date: Fri, 4 Jan 2013 07:46:11 +0000
>
> Now for step 3 of my 'calling Java from Delphi' project...
> So far, everything seems to work.
>
> Var
> Cls: JClass;
> Mid: JMethodID;
> ExampleFO2PDF: JObject;
>
> //Construct ExampleFO2PDF object
> ExampleFO2PDF := CreateJavaObject(FJNIEnv, 'embedding/ExampleFO2PDF', Cls);
> //Locate the 'convertFO2PDF' method
> Mid := FJNIEnv.GetMethodID(Cls, 'convertFO2PDF', '(Ljava/io/File;Ljava/io/File;)V');
>
>
>
> After this, I wish to actually call the method from Delphi:
> // Call the method
> FJNIEnv.CallObjectMethod(...);
>
>
> In ExampleFO2PDF.java, it says
> public void convertFO2PDF(File fo, File pdf) throws IOException, FOPException {
>
> What, now, is the type of the parameters that I should pass with FJNIEnv.CallObjectMethod()? I couldn't find any examples of this.
> I tried some Delphi file types but they didn't work.
>
>
>
> Regards,
> Arjan Bokx
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

Attachment: fop-users_36151.eml (zipped)
Hello All,

The following error occurred while building FOP-Trunk 1428722:

[junit] Testsuite: org.apache.fop.intermediate.IFTestCase
[junit] Tests run: 10, Failures: 0, Errors: 1, Time elapsed: 0.346 sec
[junit]
[junit] Testcase: runTest[5](org.apache.fop.intermediate.IFTestCase):
Caused an ERROR
[junit] Expected XPath expression to evaluate to 'true', but got '' (XPath:
/descendant::if:text[1]/@(protected))
[junit] java.lang.RuntimeException: Expected XPath expression to evaluate to
'true', but got '' (XPath: /descendant::if:text[1]/@(protected))
[junit] at org.apache.fop.layoutengine.EvalCheck.doCheck(EvalCheck.java:
86)
[junit] at org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:65
)
[junit] at org.apache.fop.intermediate.IFTester.doIFChecks(IFTester.java
:80)
[junit] at org.apache.fop.intermediate.IFTestCase.runTest(IFTestCase.jav
a:103)
[junit]
[junit]

BUILD FAILED
C:\Users\John\Downloads\Open_Source\fop-svn\build.xml:820: Tests failed

However, it seems to have built fop*.jar. What is the significance
of the failed test?

Regards,
John Brown.            

Attachment: fop-users_36155.eml (zipped)
I forgot to mention:

JDK version: jdk1.6.0_38.
O/S: Windows 8 Pro.
Ant version: 1.8.4.

Regards,
John Brown.            

Attachment: fop-users_36152.eml (zipped)

Hi All,

  My environment has been upgraded from jdk1.4 to jdk1.6  and from Solaris Unix box to Linux2.6.18-238.5.1.el5 x86_64  Box with Oracle 11g for connectivity from 10g earlier

But the RTF generated by JFOR 0.7.1 is looking very different from the earlier version

The header and footer is getting enlarged and thus looking very odd..though the content is fine

While looking at the log I got this message

----------------------------------------------------------------------------------------------------------

Rendering complete : RTF_Quote  0.092 secs.

jfor.INFO:jfor V0.7.1 - setting up conversion...

jfor.INFO:Parsing xsl:fo document...

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.INFO:Writing out RTF...

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxx.jpg'.

jfor.INFO:Write bookmark 'terminator'.

jfor.INFO:Done converting xsl:fo to RTF.

jfor.DEBUG:conversion took 585 milliseconds.

-----------------------------------------------------------------------------------------------------------

 

Can you suggest any clue where I should be looking????

I have migrated all the xsl files that were used earlier

 

Thanks

Romit Saha


Attachment: fop-users_36154.eml (zipped)
Hi Romit,

I have come across something similar before when I was working on the following patch for FOP:

https://issues.apache.org/jira/browse/FOP-2104

It was caused by there being a mismatch with one of the FO table elements being converted to RTF i.e. a start table header element with no closing element. This issue though was self-induced as I was trying to manually create and force a table header into the mix without closing it off. I think if the tree structure isn't correct it gets confused down the line and starts throwing out those messages.

I am not sure what sort of FO validation JFOR used, but it might be worth just checking over the structure even if it did work before.

As a side note, from my understanding JFOR was donated to FOP a while ago so I imagine both projects were merged as FOP also has the ability to generate RTF from FO. Have you tried converting your FO using the latest version of FOP and see if you get the same thing? Maybe it was an issue which has subsequently been resolved. FOP has good FO validation so if there is something wrong I imagine it would highlight it. If it is however reproducible in FOP, we can create a bug to add to the list.

Regards,

Robert Meyer


From: romit.saha@ge.com
To: fop-users@xmlgraphics.apache.org
Subject: JFOR 0.7.1 behaving weird
Date: Fri, 4 Jan 2013 14:29:41 +0530

Hi All,

  My environment has been upgraded from jdk1.4 to jdk1.6  and from Solaris Unix box to Linux2.6.18-238.5.1.el5 x86_64  Box with Oracle 11g for connectivity from 10g earlier

But the RTF generated by JFOR 0.7.1 is looking very different from the earlier version

The header and footer is getting enlarged and thus looking very odd..though the content is fine

While looking at the log I got this message

----------------------------------------------------------------------------------------------------------

Rendering complete : RTF_Quote  0.092 secs.

jfor.INFO:jfor V0.7.1 - setting up conversion...

jfor.INFO:Parsing xsl:fo document...

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.WARNING:fo:table-column width not defined,using 200.0

jfor.INFO:Writing out RTF...

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxxx.com/images/xxxx.jpg'.

jfor.INFO:Writing image 'http://tst1-xxxxx.com/images/xxxx.jpg'.

jfor.INFO:Write bookmark 'terminator'.

jfor.INFO:Done converting xsl:fo to RTF.

jfor.DEBUG:conversion took 585 milliseconds.

-----------------------------------------------------------------------------------------------------------

 

Can you suggest any clue where I should be looking????

I have migrated all the xsl files that were used earlier

 

Thanks

Romit Saha


Attachment: fop-users_36153.eml (zipped)
Hi Alexey,

Apologies for the slow reply. I'm just catching up on e-mail after the
holidays.

On 28/12/2012 05:56, Alexey Neyman wrote:
>
> Hi all,
>
> As I mentioned in another email, I am trying to constrain FOP to use
> only local fonts (i.e. ones described in fop.cfg). For SVGs, I have a
> workaround:
>
> - Generate fonts in SVG format using ttf2svg utility from Batik;
>
> - Use an XSL stylesheet to embed all the fonts used by an SVG image
> into the image itself;
>
> - Use such "preprocessed" SVG image as the input to FOP.
>

Interesting workaround. We are trying to tackle this issue by providing
an alternative implementation of GVTFont in Batik that uses FOP's Font
Library to load the font metrics.

> This does not work well with JEuclid, though. When JEuclid generates
> SVG from MathML, it performs font rendering - that is, replaces
> characters by actual paths. And again, it uses system fonts, not the
> fonts available in FOP - even if running as FOP plugin.
>
> To work around this issue for MathML, I am currently switching from
> JEuclid to pMML2SVG (http://pmml2svg.sourceforge.net). It generates
> SVGs with text characters, not paths. But in order to do so, it needs
> font metrics. Unfortunately, font metrics produced by stock FOP
> TTFReader are not sufficient - this stylesheet also needs bounding box
> for each glyph. To obtain these, pMML2SVG currently packages an
> augmented TTFReader Java sources which are to be compiled and used in
> lieu of the stock one.
>
> Given that the patch is very small and as far as I can tell,
> compatible with current users of font metrics (it just adds 4
> attributes to glyph description), is it possible to integrate this
> support into stock FOP?
>
> Patch from pMML2SVG, slightly modified to apply to FOP 1.1 sources,
> attached.
>

Thanks for the patch. To get this added to the code base please raise an
issue in JIRA, add the diff as an attachment and include [PATCH] in the
subject line. A committer will then review the patch before applying it.

I know Peter Hancock is looking into doing something similar as he is
working on getting Batik to use FOP configured fonts instead of the
system ones. Peter mentioned to me offlist that he was going to need to
expose a few extra things in TTFReader to facilitate this, could be you
are covering similar ground here.

Anyway, please raise the JIRA issue otherwise your patch could get lost.

Thanks,

Chris

> Regards,
>
> Alexey.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)



Attachment: fop-users_36156.eml (zipped)
Hi Chris,

On Friday, January 04, 2013 06:50:30 am Chris Bowditch wrote:
> Hi Alexey,
>
> Apologies for the slow reply. I'm just catching up on e-mail after the
> holidays.

No problem and Happy New Year!

>
> On 28/12/2012 05:56, Alexey Neyman wrote:
> > Hi all,
> >
> > As I mentioned in another email, I am trying to constrain FOP to use
> > only local fonts (i.e. ones described in fop.cfg). For SVGs, I have a
> > workaround:
> >
> > - Generate fonts in SVG format using ttf2svg utility from Batik;
> >
> > - Use an XSL stylesheet to embed all the fonts used by an SVG image
> > into the image itself;
> >
> > - Use such "preprocessed" SVG image as the input to FOP.
>
> Interesting workaround. We are trying to tackle this issue by providing
> an alternative implementation of GVTFont in Batik that uses FOP's Font
> Library to load the font metrics.

First, as I was told on the list previously, it is not a small feat and it
would take some time before this fix is released.

Then, even though it would solve the issue for SVGs, it won't help with font
selection for MathML. As I explained below, JEuclid pre-renders the glyphs
into paths.

And as far as I can tell, JEuclid project is all but dead: the last non-
trivial commit was 16 months ago, and the last release 30 months ago. I don't
think it is likely JEuclid will catch up with FOP improvements, even when
they're available.

> > This does not work well with JEuclid, though. When JEuclid generates
> > SVG from MathML, it performs font rendering - that is, replaces
> > characters by actual paths. And again, it uses system fonts, not the
> > fonts available in FOP - even if running as FOP plugin.
> >
> > To work around this issue for MathML, I am currently switching from
> > JEuclid to pMML2SVG (http://pmml2svg.sourceforge.net). It generates
> > SVGs with text characters, not paths. But in order to do so, it needs
> > font metrics. Unfortunately, font metrics produced by stock FOP
> > TTFReader are not sufficient - this stylesheet also needs bounding box
> > for each glyph. To obtain these, pMML2SVG currently packages an
> > augmented TTFReader Java sources which are to be compiled and used in
> > lieu of the stock one.
> >
> > Given that the patch is very small and as far as I can tell,
> > compatible with current users of font metrics (it just adds 4
> > attributes to glyph description), is it possible to integrate this
> > support into stock FOP?
> >
> > Patch from pMML2SVG, slightly modified to apply to FOP 1.1 sources,
> > attached.
>
> Thanks for the patch. To get this added to the code base please raise an
> issue in JIRA, add the diff as an attachment and include [PATCH] in the
> subject line. A committer will then review the patch before applying it.

Created an issue:
https://issues.apache.org/jira/browse/FOP-2180

> I know Peter Hancock is looking into doing something similar as he is
> working on getting Batik to use FOP configured fonts instead of the
> system ones. Peter mentioned to me offlist that he was going to need to
> expose a few extra things in TTFReader to facilitate this, could be you
> are covering similar ground here.

Maybe. Then again, the root of the issue is not Batik - that issue I work
around by embedding fonts. It is JEuclid's use of system fonts which is why I
am switching to pMML2SVG - which needs bounding box information for glyphs.

BTW, another useful feature in pMML2SVG that was not available in JEuclid is
that pMML2SVG outputs baseline position information in the generated SVG - so
that inline equations can be properly positioned on the line.

Regards,
Alexey.

>
> Anyway, please raise the JIRA issue otherwise your patch could get lost.
>
> Thanks,
>
> Chris
>
> > Regards,
> >
> > Alexey.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> > For additional commands, e-mail: fop-users-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@(protected)
> For additional commands, e-mail: fop-users-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.