Re: Pushing down bottom margin for book title page

2010-07-21 Thread Pascal Sancho
Hi Akagi,

You should ask Docbook related question on Docbook list (see [1]).
Ideally, on FOP user list you should ask questions that come *after* the
XSLT transformation, and you should provide short XSL-FO snippet to arg
your question.

[1] http://www.docbook.org/guidelines

Pascal

Le 20/07/2010 19:18, Akagi Kobayashi a écrit :
 Hello FOP Users,

 I need to modify the front page of the book with an image that covers 
 the entire bottom half of the page.
 Using book.titlepage.recto.xsl, set margin right and left to negative 
 values - this works.
 To remove the margin, region-after etc at the bottom of the page, 
 created the attached user.pagemasters.xsl and put it into the custom folder.

 1. The build doesn't refer to this. What is missing?
 2. Is the attached the user.pagemasters.xsl correct, otherwise?
 Can the body.margin.bottom be set in the same area as the 
 page.margin.bottom and region.after.extent?

 Would be very grateful for your advice.

 best regards

 Akagi Kobayashi
   


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



Re: Pushing down bottom margin for book title page

2010-07-21 Thread Akagi K

Thanks Pascal and Georg for your advice. Will post to the docbook list.

akagi
 

Pascal Sancho wrote:
 
 Hi Akagi,
 
 You should ask Docbook related question on Docbook list (see [1]).
 Ideally, on FOP user list you should ask questions that come *after* the
 XSLT transformation, and you should provide short XSL-FO snippet to arg
 your question.
 
 [1] http://www.docbook.org/guidelines
 
 Pascal
 
 Le 20/07/2010 19:18, Akagi Kobayashi a écrit :
 Hello FOP Users,

 I need to modify the front page of the book with an image that covers 
 the entire bottom half of the page.
 Using book.titlepage.recto.xsl, set margin right and left to negative 
 values - this works.
 To remove the margin, region-after etc at the bottom of the page, 
 created the attached user.pagemasters.xsl and put it into the custom
 folder.

 1. The build doesn't refer to this. What is missing?
 2. Is the attached the user.pagemasters.xsl correct, otherwise?
 Can the body.margin.bottom be set in the same area as the 
 page.margin.bottom and region.after.extent?

 Would be very grateful for your advice.

 best regards

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

-- 
View this message in context: 
http://old.nabble.com/Pushing-down-bottom-margin-for-book-title-page-tp29217924p29223629.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Re: Referring to a image file in a JAR file

2010-07-21 Thread TvT
Hi,

we needed exactly that and implemented our own ResourceResolver for that.
You can register it like the following:

//Register a custom resolver
foUserAgent.setURIResolver(new ClasspathResourceResolver());

//The clas has to implement the URIResolver
public class ClasspathResourceResolver implements URIResolver {

//you overwrite the resolve method
public InputStream resolve(String uri){

//Resolves the path to a resource in the classpath (since that jar
should be in the classpath
this.getClass().getResourceAsStream(uri);

Regards,
ToM


2010/7/21 Bernard Giannetti thebernmeis...@hotmail.com:
 Hi,

 I am trying to refer to a graphic file within a JAR file.  The JAR file
 contains the application which is being executed along with the
 aforementioned graphic file.

 The application is launched via JNLP - so not sure if that effects what I am
 trying to do.

 If the JAR file is myapp.jar and the graphic is say image.svg then the tag

 fo:external-graphic src=file://myapp.jar!/image.svg content-width=8
 content-height=8 results in the error

 Error with opening URL 'file://myapp.jar!/image.svg'

 I have tried different variations on the src attribute, say file:/// and
 then also url('/image.svg') but with similar errors.

 Is it possible to reference an image file within the same JAR as the
 application?


 Thanks in advance,

 Bernard.

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



The Apache Software Foundation Announces Apache FOP Version 1.0

2010-07-21 Thread Simon Pepping
Redesigned, Stable Version of Pioneering XSL Formatting Objects
Processor Rounds Out Apache XML Software Stack

FOREST HILL, Md., July 21 -- The Apache Software Foundation (ASF) -
the all-volunteer developers, stewards, and incubators of nearly 150
Open Source projects and initiatives - today announced the Version 1.0
release of Apache FOP, the Open Source XSL Formatting Objects
Processor.

An Apache project since 1999, FOP is one of the industry's first print
formatters driven by W3C-standard XSL Formatting Objects created to
display, convert, and print to formats such as PDF, PostScript, SVG,
RTF, and XML. In addition, FOP is among the most commonly-used
output-independent formatters.

The Apache FOP code base has grown over the past decade under the
guidance of a Project Management Committee (PMC) who oversee its
day-to-day activities and community development.

FOP v.1.0 provides a good subset of the W3C XSL-FO 1.0/1.1
specification. Its stable, 1.0 designation provides added recognition
as the productive tool it has been for years, said Jeremias Marki,
member of the Apache XML Graphics Project Management Committee. Its
redesign and improved features in the layout engine makes it an even
better experience for the many developers and users who produce
millions of pages each year.

Apache FOP is in use at Accenture, Airbus, Australia Post, BNP
Paribas, Capgemini, Credit Suisse, CSC, Denic, European Patent Office,
FedEx, Ford, HP, IBM, IntelliData, Marriot International, Morgan
Stanley, Polaris, Siemens, Swiss Federal Institute of Intellectual
Property, Tecra, US Army, US House of Representatives, and Wyona,
among many others. In addition, FOP is the default implementation
bundled in XML editors such as XSLfast, Oxygen, and XMLSpy.

Thunderhead relies on open standards, and FOP is at the heart of our
innovative NOW platform. We are proud to have been able to play a part
in its development, said Glen Manchester, CEO of Thunderhead. As
long-time supporters of FOP, our congratulations go to the whole FOP
team at Apache on reaching the Version 1.0 milestone.

The release of FOP v.1.0 completes a free XML software stack,
comprising: Apache Xerces, Apache Xalan, and Apache FOP. The ability
to insert graphics into one's print output is possible using Apache
Batik. The Apache XML stack makes transforming and formatting XML data
(for example DocBook XML) a viable option for individual and start-up
users without business cash flow.

Some 'overnight successes' take ten years or more, said James
Governor, Analyst and Founder of RedMonk. Apache FOP seems to be one
of them.

The training wheels are long gone, said Apache XML Graphics PMC
Chair Simon Pepping. FOP's popularity is undisputed; FOP is used from
an individual developer's pet project to large-scale document
production. FOP is not yet 'feature complete', and work on it is
continuing. We hope this important step forward will motivate skilled
developers to jump in and help us make Apache FOP even better.

Availability

FOP v.1.0 is released under the Apache Software License
v2.0. Downloads, documentation, and related resources are available at
http://xmlgraphics.apache.org/fop/.

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

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



RE: XML to TIFF CITT conversion - aid requested

2010-07-21 Thread Marquart, Joshua D
Resolved. 

I walked through the Main class code and replicated the steps.

Part of my problem was I was trying to use the java code posted earlier
instead of the userconfig.xml

FOUserAgent ua = fopFactory.newFOUserAgent(); 
TIFFRenderer renderer = new TIFFRenderer(); 
renderer.setUserAgent(ua);
renderer.getWriterParams().setCompressionMethod(TIFFConstants.COMPRESSIO
N_CCITT_T6);
ua.setRendererOverride(renderer);

The above will throw the exception I had been seeing.

Thanks for all the help!  I'll see what I can do to contribute to the
group.

-Josh

-Original Message-
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, July 14, 2010 2:49 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: XML to TIFF CITT conversion - aid requested

Hi Joshua

Make the config file:

fop version=1.0
  renderers
renderer mime=image/tiff
  compressionCCITT T.6/compression
/renderer
  /renderers
/fop

...and you're there.

As for your other question, you can do something like:

FOUserAgent ua = fopFactory.newFOUserAgent();
TIFFRenderer renderer = new TIFFRenderer();
renderer.setUserAgent(ua);
renderer.getWriterParams().setCompressionMethod(TIFFConstants.COMPRESSIO
N_CCITT_T6);
ua.setRendererOverride(renderer);

...but the above only applies to FOP 0.95 or later, I think.

On 14.07.2010 00:48:13 Marquart, Joshua D wrote:
 Hello,
 
 I've been working on a project to transform XML to TIFF in the CITT G4
 Format and have read several threads regarding the conversion, which
has
 lead me to believe conversion is a common problem among users.
 
 Most of the G4 TIFF-related threads end with guru JM providing an
 explanation, but with no follow-up response from the thread-starting
 user as to whether the explanation/solution worked.  I promise if my
 issue gets resolved, I will post a success story as a follow-up to
this
 thread.
 
 Here is my situation:
 
 I am trying to convert a FOP-readable xml file into a G4 TIFF.  No
 matter what I do, it applies as PackBits.  
 
 In addition to resolving this, I am curious as to why there appears to
 be no programmatic way to set CCITT compression within the code (ex: a
 setCompression(String) method), when TIFFRenderer even contains String
 constants representing the three available compression types.
 
 Also, I could not find a sample configuration file in the
distribution;
 maybe I missed it.
 
 Any help / advice would be much appreciated, thanks.
 
 -Josh (details follow)
 
 JARS on CLASSPATH:
 avalon-framework-4.2.0.jar
 batik-all-1.6.jar
 commons-io-1.3.1.jar
 commons-logging-1.0.4.jar
 fop.jar (implementation.94)
 serializer-2.7.0.jar
 xaland-2.7.0.jar
 xercesImpl-2.7.1.jar
 xml-apis-1.3.02.jar
 xmlgraphics-commons-1.2.jar
 log4j-1.2.13.jar
 jai-imageio.jar (implementation 1.1)
 
 FILES:
 There are 3 files involved in this (contents follow)
 
 FILE 1 - testFop.xml 
 This is the fop formatted xml; I've successfully transformed it to
 PostScript and Tiff.
 
 FILE 2 - tiffFopConfig.xml
 This only contains the compression line for CCITT T.6
 
 FILE 3 - FopTiffTester.javaThis is the java file for conversion.  The
 code is abstracted from my own larger codebase where I do instantiate
a
 single fopFactory and perform best practices - no need for best
 practices on this example, IMHO.  :-)
  
 FILE CONTENT:
 
 FILE 1 - testFop.xml
 ?xml version=1.0 encoding=UTF-8?
 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
 fo:layout-master-set
 fo:simple-page-master margin-top=0.0in margin-bottom=0.0in
 page-width=8.5in page-height=11.0in master-name=single
 fo:region-body padding=0pt 0pt margin-bottom=0cm
margin-top=0.5cm
 margin-right=1cm margin-left=1cm/
 fo:region-before padding=0pt display-align=after extent=1cm
 region-name=left-top/
 fo:region-after padding=0pt display-align=before extent=1cm
 region-name=footer/
 fo:region-start padding=0pt display-align=center
precedence=true
 extent=1in region-name=outside/
 fo:region-end padding=0pt  display-align=after precedence=true
 extent=1in region-name=inside/
 /fo:simple-page-master
 fo:page-sequence-master master-name=contents
 fo:repeatable-page-master-reference master-reference=single/
 /fo:page-sequence-master
 /fo:layout-master-set
 fo:page-sequence initial-page-number=2 master-reference=contents
 fo:flow flow-name=xsl-region-body
 fo:table width=100% table-layout=fixed
 fo:table-column column-width=19cm/
 fo:table-body
 fo:table-row
 fo:table-cell font-size=9pt font-family=Helvetica
 fo:block line-height=14pt
 fo:block white-space-collapse=true
 fo:block font-family=Helvetica font-size=10ptTest test test test
 test times five./fo:block
 /fo:block
 /fo:block
 /fo:table-cell
 /fo:table-row
 /fo:table-body
 /fo:table
 /fo:flow
 /fo:page-sequence
 /fo:root
 
 FILE 2 - tiffFopConfig.xml
 fop version=1.0
   renderer mime=image/tiff
 compressionCCITT T.6/compression
   /renderer
 /fop
 
 FILE 3 - FopTiffTester.java
 import java.io.BufferedOutputStream;
 import java.io.File;
 import 

RE: Referring to a image file in a JAR file

2010-07-21 Thread Bernard Giannetti






I already have a URIResolver implemented to resolve the something such as

xsl:include href=pagesetup.xsl /

which is what the Javadoc says it's used for:

http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/transform/URIResolver.html

Unfortunately, the fo:external-graphic src=file://myapp.jar!/image.svg 
content-width=8 content-height=8 does not trigger the call to my URI 
resolver.  I have tried src=url() etc with no luck.  So either I've got the 
wrong format of the URL or it cannot be done this way.

I don't see how to use xls:include, xsl:import and document (as per the 
Javadoc) to refer to the graphic file.  In your example, did you refer to 
images using fo:external-graphic or using some other tag?

The other thing I noticed is I set my URIResolver on the TransformerFactory:

SAXTransformerFactory saxTransformerFactory = 
(SAXTransformerFactory)TransformerFactory.newInstance();
saxTransformerFactory.setURIResolver( myURIResolver );

instead of on the foUserAgent which you did...so dunno if that makes a 
difference.


 Date: Wed, 21 Jul 2010 17:16:03 +0200
 Subject: Re: Referring to a image file in a JAR file
 To: fop-users@xmlgraphics.apache.org
 
 Hi,
 
 we needed exactly that and implemented our own ResourceResolver for that.
 You can register it like the following:
 
 //Register a custom resolver
 foUserAgent.setURIResolver(new ClasspathResourceResolver());
 
 //The clas has to implement the URIResolver
 public class ClasspathResourceResolver implements URIResolver {
 
 //you overwrite the resolve method
 public InputStream resolve(String uri){
 
 //Resolves the path to a resource in the classpath (since that jar
 should be in the classpath
 this.getClass().getResourceAsStream(uri);
 
 Regards,
 ToM
  
_
Need a new place to live? Find it on Domain.com.au
http://clk.atdmt.com/NMN/go/157631292/direct/01/

Re: Referring to a image file in a JAR file

2010-07-21 Thread Jeremias Maerki
No URIResolver should be necessary in this case. I think you simply need
to add jar: in front and it should work, i.e.:

jar:file://myapp.jar!/image.svg

On 22.07.2010 03:05:42 Bernard Giannetti wrote:
 
 
 
 
 
 
 I already have a URIResolver implemented to resolve the something such as
 
 xsl:include href=pagesetup.xsl /
 
 which is what the Javadoc says it's used for:
 
 http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/transform/URIResolver.html
 
 Unfortunately, the fo:external-graphic src=file://myapp.jar!/image.svg 
 content-width=8 content-height=8 does not trigger the call to my URI 
 resolver.  I have tried src=url() etc with no luck.  So either I've got 
 the wrong format of the URL or it cannot be done this way.
 
 I don't see how to use xls:include, xsl:import and document (as per the 
 Javadoc) to refer to the graphic file.  In your example, did you refer to 
 images using fo:external-graphic or using some other tag?
 
 The other thing I noticed is I set my URIResolver on the TransformerFactory:
 
 SAXTransformerFactory saxTransformerFactory = 
 (SAXTransformerFactory)TransformerFactory.newInstance();
 saxTransformerFactory.setURIResolver( myURIResolver );
 
 instead of on the foUserAgent which you did...so dunno if that makes a 
 difference.
 
 
  Date: Wed, 21 Jul 2010 17:16:03 +0200
  Subject: Re: Referring to a image file in a JAR file
  To: fop-users@xmlgraphics.apache.org
  
  Hi,
  
  we needed exactly that and implemented our own ResourceResolver for that.
  You can register it like the following:
  
  //Register a custom resolver
  foUserAgent.setURIResolver(new ClasspathResourceResolver());
  
  //The clas has to implement the URIResolver
  public class ClasspathResourceResolver implements URIResolver {
  
  //you overwrite the resolve method
  public InputStream resolve(String uri){
  
  //Resolves the path to a resource in the classpath (since that jar
  should be in the classpath
  this.getClass().getResourceAsStream(uri);
  
  Regards,
  ToM
 
 _
 Need a new place to live? Find it on Domain.com.au
 http://clk.atdmt.com/NMN/go/157631292/direct/01/




Jeremias Maerki


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