RE: Help: XSL to PCL

2011-08-26 Thread Theresa Jayne Forster
Well one of the first things you would need to do is configure the pcl
renderer in the config file.

http://xmlgraphics.apache.org/fop/0.95/configuration.html#pcl-renderer

 

and be aware of the restrictions 

 

http://xmlgraphics.apache.org/fop/0.95/output.html#pcl

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer






Re: Help: XSL to PCL

2011-08-26 Thread Chris Bowditch

On 26/08/2011 05:11, Everson Rogério wrote:

Hello
I am using a Java class to generate PDF from an XSL and XML. Now, I 
need to generate PCL with these XSL and XML files.


I read something about this in Graphic Library "fop" 
org.apache.fop.render.pcl, but I'm not succeeding.


If you are having a problem, then describing the problem would be 
helpful, e.g. if you get an error then posting the stack will help 
others to guide you.



Can anyone help me? Send examples?


The FOP distribution includes an example of how to render XML+XSL to PDF 
from a Java application in 
fop\examples\embedding\java\embedding\ExampleXML2PDF.java.


Changing this example to generate PCL is a simple one line change to the 
following line:


Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

Changing it to:

Fop fop = fopFactory.newFop(MimeConstants.MIME_PCL, foUserAgent, out);



Note that there is an image in the PDF generated, so I'm using the tag 
. and works good!


Thanks


Regards,

Chris

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



Re: Placing external graphics

2011-08-26 Thread Chris Bowditch

On 25/08/2011 22:25, Samuel Penn wrote:

Hi,


Hello,


I'm having some issues with the placement of images with external-graphic.
The graphic (a jpeg) is being inserted into a text flow in one column of
a two column page layout (i.e., it's not meant to spread across multiple
text columns). What happens, is that the correct amount of whitespace is
reserved for the image, but the bottom of the image is aligned with the
top of where it should be, so the image overwrites the text paragraph
immediately above it.

This is happening with several of the inserted images (the one that
works is quite small).

I'm using FOP 0.95 on Linux (Ubuntu 11.4). On a previous computer, using
theoretically the same stylesheets and FOP version, the images seemed to be
placed correctly, so I'm not sure what's changed.


Have you tested your XSL-FO on FOP v1.0? There have been a lot of fixes 
between 1.0 and 0.95, some of them relates to multi-column layout.



The XML looks something like this:


Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...



 



Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...
Blah blah blah blah blah blah...  Blah blah blah blah blah blah...


What renders, is the first paragraph, the image overlaid on top of
it, a chunk of whitespace (equal in size to the image), then the
second paragraph.


Difficult to tell what could be the problem from a snippet of the FO. 
You could try taking out the space-before/after attributes in case that 
causes some problems within multi-column layouts. If that still fails on 
FOP 1.0, could you send us a trimmed down XSL-FO File that demonstrates 
the issue?



There's an image of the output here:

https://picasaweb.google.com/lh/photo/-T-EK3oVgCrkfc4aUie6HQ?feat=directlink

Any ideas on what I'm doing wrong?

Thanks.

Regards,

Chris



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



Building fop from source using qdox 1.11

2011-08-26 Thread Mathieu Malaterre
Dear all,

  I am trying to build fop from source using qdox 1.11. On my debian
system here is what I did:

$ wget 
http://mir2.ovh.net/ftp.apache.org/dist//xmlgraphics/fop/source/fop-1.0-src.tar.gz
$ tar xfz fop-1.0-src.tar.gz
$ cd fop-1.0
$ export CLASSPATH=/usr/share/java/qdox.jar:/usr/share/java/commons-io.jar
$ ant resourcegen

This leads to the following error (*). I would like to know whether:

- building fop from source using qdox version != 1.6.3 is actually supported ?
- did anyone tried to compile fop with a more recent qdox version ?

If not, where can I download source code for qdox 1.6.3, I could not
find it on the official website:
http://snapshots.repository.codehaus.org/com/thoughtworks/qdox/qdox/

Thank you very much for your time,
-Mathieu

(*)
BUILD FAILED
/tmp/test/fop-1.0/build.xml:374: java.lang.NullPointerException
at 
org.apache.fop.tools.EventProducerCollector.createMethodModel(EventProducerCollector.java:142)
at 
org.apache.fop.tools.EventProducerCollector.processEventProducerInterface(EventProducerCollector.java:130)
at 
org.apache.fop.tools.EventProducerCollector.scanFile(EventProducerCollector.java:100)
at 
org.apache.fop.tools.EventProducerCollectorTask.processFileSets(EventProducerCollectorTask.java:213)
at 
org.apache.fop.tools.EventProducerCollectorTask.execute(EventProducerCollectorTask.java:69)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 13 seconds

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



Re: Building fop from source on debian

2011-08-26 Thread Mathieu Malaterre
Simon,

  Thanks again for your kind response. I believe we are going away
from the actual issue I am seeing. I do not believe this is related to
the Linux distribution used but to whether or not one can use a newer
qdox version to build fop or not. See my recent post.

Thanks again

On Thu, Aug 25, 2011 at 9:09 PM, Simon Pepping  wrote:
> Hi Mathieu,
>
> I am beginning to understand that you are not reporting problems in
> FOP's build process, but in Debian's build process of the FOP package.
>
> I looked at debian bug reports 638532 and 639162 and FOP bug report
> 50575. All three reports seem to refer to binaries and sources of
> Linux distributions, viz. RHEL and Debian. The problems reported seem
> to be due to the build process in those distributions, which is
> different from the build process provided by the FOP team. Those
> problems should be solved by the maintainers of those distributions.
> The FOP team is only responsible for FOP's own build process and the
> binaries published by us. It is therefore not right report those
> problems in a FOP bug report or to forward debian bug report 639162 to
> the FOP bug report.
>
> As a debian user and fan I would be willing to help debugging the
> problem, and I would like to see fop 1.0 in the testing distribution,
> but I would rather address other priorities. I also note from the
> Debian bug report 638532 that the maintainers report the problem as
> solved, although report 639162 contradicts that.
>
> The event models, of which there are currently 16, all named
> event.xml, are generated from the java code. In FOP's own build
> process, that happens in the eventResourceGenerator task, which is run
> after the compile-java task, the compilation of
> ${src.codegen.dir}/java, and the copying of
> ${src.codegen.dir}/java/**/*.xsl. I guess that in your build process
> some of these steps were not performed successfully.
>
> Best, Simon
>
> On Tue, Aug 23, 2011 at 12:23:07PM +0200, Mathieu Malaterre wrote:
>> Hi Simon,
>>
>>   Thanks for taking the time to answer my question.
>>
>> On Mon, Aug 22, 2011 at 8:31 PM, Simon Pepping  
>> wrote:
>> > This should not happen. I looks like an error in the order of the
>> > build targets. How did you run the build? Which ant version and which
>> > java in which version are you using?
>>
>> ant is version 1.8.2-3 (debian)
>> java is:
>> java version "1.6.0_18"
>> OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2~squeeze1)
>> OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
>>
>> We are only building the following two targets:
>> DEB_ANT_BUILD_TARGET := package javadocs
>>
>> And the classpath is set to (during build):
>>
>> DEB_JARS             := $(ANT_HOME)/lib/ant-trax.jar batik-all
>> xml-apis-ext batik-libs xml-apis avalon-framework xercesImpl
>> xmlParserAPIs xalan2 junit commons-io commons-logging
>> xmlgraphics-commons servlet-api-2.4 qdox
>>
>> >> Reported as:
>> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638532
>> >
>> > Your build errors are not fop bugs, unless proven. No thanks.
>>
>> This is what surprised me when I saw a Null pointer exception being
>> raised in the code. Starring at the code I could not understand if
>> this was part of the pre-condition or if there is an issue with the
>> code which does not support null pointer.
>
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
>
>



-- 
Mathieu

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



XSL-FO to PCL

2011-08-26 Thread Everson Rogério

Hi,

I'm having problems converting PCL file created from XML and XSL files using 
FOP in JAVA.

Does anyone have examples in java? 

I am using a Java class to generate PDF from an XSL and XML. Now, I need to 
generate PCL with these XSL and XML files.

I read something about this in Graphic Library "fop" org.apache.fop.render.pcl, 
but I'm not succeeding.

Note:
1) there is an image in the PDF generated, so I'm using the tag 
. and works good!
2) I am using FOP 1.0

Thanks
Everson

Re: XSL-FO to PCL

2011-08-26 Thread Chris Bowditch

On 26/08/2011 15:06, Everson Rogério wrote:


Hi,


Hello,


I'm having problems converting PCL file created from XML and XSL files 
using FOP in JAVA.


Does anyone have examples in java?


Did you not see my earlier reply to your previous e-mail on this 
subject? You can find on the archives here:


http://marc.info/?l=fop-user&m=131435518110754&w=2

Thanks,

Chris

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



Re: Building fop from source on debian

2011-08-26 Thread Simon Pepping
On Fri, Aug 26, 2011 at 01:46:13PM +0200, Mathieu Malaterre wrote:
> Simon,
> 
>   Thanks again for your kind response. I believe we are going away
> from the actual issue I am seeing. I do not believe this is related to
> the Linux distribution used but to whether or not one can use a newer
> qdox version to build fop or not. See my recent post.

I took the source code of fop-1.0, replaced lib/build/qdox-1.6.3.jar
with lib/build/qdox-1.12.jar, and ran ant compile and ant junit. Both
were successfull. There is a warning about a deprecated method, but
that is not fatal. The answer to your question is: yes, fop-1.0 can be
successfully built with qdox-1.12.

Simon

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



Re: Building fop from source using qdox 1.11

2011-08-26 Thread Simon Pepping
Earlier I wrote:

I took the source code of fop-1.0, replaced lib/build/qdox-1.6.3.jar
with lib/build/qdox-1.12.jar from fop's development code, and ran ant
compile and ant junit. Both were successfull. There is a warning about
a deprecated method, but that is not fatal. The answer to your
question is: yes, fop-1.0 can be successfully built with qdox-1.12.

I now did as you describe below, on a debian testing system, and got
your error indeed.

>ls -l /usr/share/java/qdox.jar
lrwxrwxrwx 1 root root 13 mei  3 23:53 /usr/share/java/qdox.jar -> qdox-1.12.jar

Conclusion: There is a difference between lib/build/qdox-1.12.jar in
fop's development code and /usr/share/java/qdox-1.12.jar in debian
testing.

Looking at the code, the NPE is generated by the call
method.getReturns().isVoid(). method is not null, because it has been
referenced in the preceding line. So method.getReturns() is null.
method.getReturns() is the deprecated method, but one would expect
that such a method would always return a non-null object, since any
method has a return type, even if void.

You can check why debian's qdox-1.12 is different from fop's, or patch
fop's code at
org.apache.fop.tools.EventProducerCollector.createMethodModel(EventProducerCollector.java:142)
(src/codegen/java/org/apache/fop/tools/EventProducerCollector.java) to
use method.getReturnType() instead of method.getReturns(). FOP's
development code uses method.getReturnType() and qdox-1.12.

Simon

On Fri, Aug 26, 2011 at 01:45:04PM +0200, Mathieu Malaterre wrote:
> Dear all,
> 
>   I am trying to build fop from source using qdox 1.11. On my debian
> system here is what I did:
> 
> $ wget 
> http://mir2.ovh.net/ftp.apache.org/dist//xmlgraphics/fop/source/fop-1.0-src.tar.gz
> $ tar xfz fop-1.0-src.tar.gz
> $ cd fop-1.0
> $ export CLASSPATH=/usr/share/java/qdox.jar:/usr/share/java/commons-io.jar
> $ ant resourcegen
> 
> This leads to the following error (*). I would like to know whether:
> 
> - building fop from source using qdox version != 1.6.3 is actually supported ?
> - did anyone tried to compile fop with a more recent qdox version ?
> 
> If not, where can I download source code for qdox 1.6.3, I could not
> find it on the official website:
> http://snapshots.repository.codehaus.org/com/thoughtworks/qdox/qdox/
> 
> Thank you very much for your time,
> -Mathieu
> 
> (*)
> BUILD FAILED
> /tmp/test/fop-1.0/build.xml:374: java.lang.NullPointerException
>   at 
> org.apache.fop.tools.EventProducerCollector.createMethodModel(EventProducerCollector.java:142)
>   at 
> org.apache.fop.tools.EventProducerCollector.processEventProducerInterface(EventProducerCollector.java:130)
>   at 
> org.apache.fop.tools.EventProducerCollector.scanFile(EventProducerCollector.java:100)
>   at 
> org.apache.fop.tools.EventProducerCollectorTask.processFileSets(EventProducerCollectorTask.java:213)
>   at 
> org.apache.fop.tools.EventProducerCollectorTask.execute(EventProducerCollectorTask.java:69)
>   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
>   at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:616)
>   at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>   at org.apache.tools.ant.Task.perform(Task.java:348)
>   at org.apache.tools.ant.Target.execute(Target.java:390)
>   at org.apache.tools.ant.Target.performTasks(Target.java:411)
>   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
>   at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
>   at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>   at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
>   at org.apache.tools.ant.Main.runBuild(Main.java:801)
>   at org.apache.tools.ant.Main.startAnt(Main.java:218)
>   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> 
> Total time: 13 seconds
> 
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 

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



Re: Building fop from source using qdox 1.11

2011-08-26 Thread Mathieu Malaterre
Hi Simon,

  Great we are making some progress. Since you are using debian, this
will be even easier. Try the attached script.

  If you are on a debian machine with:

$ apt-cache policy libqdox-java
libqdox-java:
  Installed: 1.12-1

  You should quickly discover that indeed qdox-1.12 from debian allows
proper compilation of fop, *if and only if* copied to lib/build.

  When using the second version (via export CLASSPATH), one indeed get
the error you have seen. I could even reproduce the error using some
precompile qdox jar file:

mkdir /tmp/cp
cd /tmp/cp
wget 
http://mirrors.ibiblio.org/pub/mirrors/maven2/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar
export CLASSPATH=/tmp/cp/qdox-1.12.jar

leads also to the exact same error (*).

So now the question, is how did I misread the instructions from:

http://xmlgraphics.apache.org/fop/1.0/compiling.html#env-classpath

How should I be setting up my CLASSPATH to compile fop ?

Thanks again very much for your time,


(*)
BUILD FAILED
/tmp/clean/fop-1.0/build.xml:374: java.lang.NullPointerException
at 
org.apache.fop.tools.EventProducerCollector.createMethodModel(EventProducerCollector.java:142)
at 
org.apache.fop.tools.EventProducerCollector.processEventProducerInterface(EventProducerCollector.java:130)
at 
org.apache.fop.tools.EventProducerCollector.scanFile(EventProducerCollector.java:100)
at 
org.apache.fop.tools.EventProducerCollectorTask.processFileSets(EventProducerCollectorTask.java:213)
at 
org.apache.fop.tools.EventProducerCollectorTask.execute(EventProducerCollectorTask.java:69)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


On Fri, Aug 26, 2011 at 8:09 PM, Simon Pepping  wrote:
> Earlier I wrote:
>
> I took the source code of fop-1.0, replaced lib/build/qdox-1.6.3.jar
> with lib/build/qdox-1.12.jar from fop's development code, and ran ant
> compile and ant junit. Both were successfull. There is a warning about
> a deprecated method, but that is not fatal. The answer to your
> question is: yes, fop-1.0 can be successfully built with qdox-1.12.
>
> I now did as you describe below, on a debian testing system, and got
> your error indeed.
>
>>ls -l /usr/share/java/qdox.jar
> lrwxrwxrwx 1 root root 13 mei  3 23:53 /usr/share/java/qdox.jar -> 
> qdox-1.12.jar
>
> Conclusion: There is a difference between lib/build/qdox-1.12.jar in
> fop's development code and /usr/share/java/qdox-1.12.jar in debian
> testing.
>
> Looking at the code, the NPE is generated by the call
> method.getReturns().isVoid(). method is not null, because it has been
> referenced in the preceding line. So method.getReturns() is null.
> method.getReturns() is the deprecated method, but one would expect
> that such a method would always return a non-null object, since any
> method has a return type, even if void.
>
> You can check why debian's qdox-1.12 is different from fop's, or patch
> fop's code at
> org.apache.fop.tools.EventProducerCollector.createMethodModel(EventProducerCollector.java:142)
> (src/codegen/java/org/apache/fop/tools/EventProducerCollector.java) to
> use method.getReturnType() instead of method.getReturns(). FOP's
> development code uses method.getReturnType() and qdox-1.12.
>
> Simon
>
> On Fri, Aug 26, 2011 at 01:45:04PM +0200, Mathieu Malaterre wrote:
>> Dear all,
>>
>>   I am trying to build fop from source using qdox 1.11. On my debian
>> system here is what I did:
>>
>> $ wget 
>> http://mir2.ovh.net/ftp.apache.org/dist//xmlgraphics/fop/source/fop-1.0-src.tar.gz
>> $ tar xfz fop-1.0-src.tar.gz
>> $ cd fop-1.0
>> $ export CLASSPATH=/usr/share/java/qdox.jar:/usr/share/java/commons-io.jar
>> $ ant resourcegen
>>
>> This leads to the following error (*). I would like to know whether:
>>
>> - building fop from source using qdox version != 1.6.3 is actually supported 
>> ?
>> - did anyone tried to compile fop with a mor