Re: Norwegian hyphenation rules

2011-09-14 Thread Lars Bjørndal
Hello, Simon, and thank you much for your valuable feedback!

You wrote:

 This should work. If you are using fop downloaded from Apache, use:

 fop --execdebug xxx.fo xxx.pdf

 to see the classpath, and check whether /home/lrs/fop/fop-hyph.jar is
 part of it. Also check if /home/lrs/fop/fop-hyph.jar exists and is
 readable.

I use Fedora 14 with a pre built RPM package, fop-0.95-5.fc14.noarch.
the fop-hyph.jar file exists, and is readable. I ended up modifying the
/usr/bin/fop shell script, by adding the path to the fop-hyph.jar file
to the CLASSPATH variable. BTW the ~/.foprc file is also read, but it
seems that putting the environment variable
FOP_HYPHENATION_PATH=/home/lrs/fop/fop-hyph.jar in it, has no effect.

I still have problems and error message, let me mention those in another
mail.

Lars

 On Sun, Sep 11, 2011 at 08:39:28PM +0200, Lars Bjørndal wrote:
 
 I then used 'unzip -v fop-hyph.jar' to list the content, and found the
 file 'hyph/no.hyp'. In ~/.foprc, I put:
 'FOP_HYPHENATION_PATH=/home/lrs/fop/fop-hyph.jar'.
 
 In the .fo file, I've tried both, language=no and language=nb. In
 both cases, I get the following output while running fop:
 
 11.sep.2011 20:14:51 org.apache.fop.hyphenation.Hyphenator
 getHyphenationTree
 SEVERE: Couldn't find hyphenation pattern no
 
 Any ideas?
 
 Lars

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



Error messages from fop

2011-09-14 Thread Lars Bjørndal
Hello

I'd like to convert the following file into PDF, using fop version 0.95.

  http://lamasti.net/filer/test.fo

The fo file is generated from an Docbook XML file with xsltproc. The
rest of this mail shows the output from fop, and I hope someon could
help me find a way out...

The CLASSPATH variable is set to:
/usr/share/java/commons-io.jar:/usr/share/java/batik-all.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/xmlgraphics-commons.jar:/usr/share/java/commons-logging.jar:/usr/share/java/fop.jar::/usr/share/java/xml-commons-apis-ext.jar:/home/lrs/fop/fop-hyph.jar

Here's the output:

14.sep.2011 11:11:14 org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'Symbol,normal,700' not found. Substituting with 
'Symbol,normal,400'.
14.sep.2011 11:11:14 org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'ZapfDingbats,normal,700' not found. Substituting with 
'ZapfDingbats,normal,400'.
14.sep.2011 11:11:15 
org.apache.fop.layoutmgr.inline.LineLayoutManager$LineBreakingAlgorithm 
updateData2
WARNING: Line 1 of a paragraph overflows the available area by 2500mpt. 
(fo:block, location: 143/242)
14.sep.2011 11:11:15 org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException
14.sep.2011 11:11:15 org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException: java.lang.NullPointerException
javax.xml.transform.TransformerException: java.lang.NullPointerException
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:196)
Caused by: javax.xml.transform.TransformerException: 
java.lang.NullPointerException
at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:720)
at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:317)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more
Caused by: java.lang.NullPointerException
at 
org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.applyChanges(InlineStackingLayoutManager.java:350)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.findHyphenationPoints(LineLayoutManager.java:1480)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.findOptimalBreakingPoints(LineLayoutManager.java:950)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.createLineBreaks(LineLayoutManager.java:917)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:607)
at 
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294)
at 
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
at 
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294)
at 
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
at 
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294)
at 
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
at 
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107)
at 
org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
at 
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552)
at 
org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302)
at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
at 
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
at 
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
at 
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:265)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:604)
at 
com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.endElement(XIncludeHandler.java:1017)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1759)
at 

Producing PDF from subset of IF file pages

2011-09-14 Thread jeanyo

Hi,

I'm new to FOP.  I could not find any discussion related to my question.

My goal is to produce a PDF that contains only a subset of pages from a FOP
intermediate (IF) file.  I thought I could manipulate the IF file, deleting
some of the page-sequence and page elements, but this does not work.  I
suspect that it fails because the IF file contains X-Y coordinates.  

Is there an obvious way to create a PDF using only a subset of pages from
an IF file?  Is there a simple option to print only certain pages?

My colleague suggested that there is a way to read the IF file into a set of
FOP objects.  He suggested that I may be able to selectively append these
objects to generate the PDF.  Does anyone know the mechanism (i.e., classes)
to accomplish this?  

Oh, and in my case, starting off with less content (i.e., in the XSL-FO) is
not an option.  I have a very specific need to eliminate just certain pages
and I have no way of determining which pages to remove/exclude until the IF
file is generated.

Thanks!!
-Melanie

Operating System: Windows XP
FOP Version: 1.0
JDK: 1.5

-- 
View this message in context: 
http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32463958.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: Producing PDF from subset of IF file pages

2011-09-14 Thread Jeremias Maerki
Hi Melanie,

IF page and page-segment elements are generally self-contained. I
can imagine that there could be problems with document navigation tags,
so they might need to be filtered, too. Did you get any specific error
message? The X/Y coordinates are indendent between pages. You can filter
them using XSLT or by implementing the IFDocumentHandler interface.

Take a look at the following classes for inspiration:
- org.apache.fop.render.intermediate.util.IFConcatenator
- org.apache.fop.render.intermediate.util.IFDocumentHandlerProxy
- examples/embedding/java/embedding/intermediate/ExampleConcat.java

There is currently no convenience class (like the IFConcatenator) that
demonstrates page filtering, but it should really be easy to do. So I'm
a little surprised that removing page elements didn't work for you. It
might help if you posted a file that demonstrates your problems.

On 14.09.2011 16:30:20 jeanyo wrote:
 
 Hi,
 
 I'm new to FOP.  I could not find any discussion related to my question.
 
 My goal is to produce a PDF that contains only a subset of pages from a FOP
 intermediate (IF) file.  I thought I could manipulate the IF file, deleting
 some of the page-sequence and page elements, but this does not work.  I
 suspect that it fails because the IF file contains X-Y coordinates.  
 
 Is there an obvious way to create a PDF using only a subset of pages from
 an IF file?  Is there a simple option to print only certain pages?
 
 My colleague suggested that there is a way to read the IF file into a set of
 FOP objects.  He suggested that I may be able to selectively append these
 objects to generate the PDF.  Does anyone know the mechanism (i.e., classes)
 to accomplish this?  
 
 Oh, and in my case, starting off with less content (i.e., in the XSL-FO) is
 not an option.  I have a very specific need to eliminate just certain pages
 and I have no way of determining which pages to remove/exclude until the IF
 file is generated.
 
 Thanks!!
 -Melanie
 
 Operating System: Windows XP
 FOP Version: 1.0
 JDK: 1.5
 
 -- 
 View this message in context: 
 http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32463958.html
 Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


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



Re: Producing PDF from subset of IF file pages

2011-09-14 Thread jeanyo

Thanks for your help!

I have attached two files:
- premod.if.xml: This is the untouched IF file.
- postmod.if.xml: This is premod.if.xml, but with many of the page
elements and some page-sequence elements removed.  You will notice extra
white space where elements were deleted.  


The specific error I get when trying to generate the PDF is:
Caused by: java.lang.NullPointerException 
at
org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188)
at
org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160)
at
org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108)
at
org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186)
[rest of stack omitted] 

I believe the NullPointerException occurs on this line in
PDFDocumentNavigationHandler.java:
action.getTargetLocation().x / 1000.0,

Does target location imply a link target location?  If so, you were
correct in predicting this as an issue.  I'm not sure this version of the
publication must support linking, but I will verify.  The real purpose is to
provide a hard copy of the PDF.

Thanks again.
-- 
View this message in context: 
http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464585.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: Producing PDF from subset of IF file pages

2011-09-14 Thread jeanyo

Actually, here are the file attachments...


jeanyo wrote:
 
 I have attached two files:
 -  http://old.nabble.com/file/p32464608/premod.if.xml premod.if.xml  :
 This is the untouched IF file.
 -  http://old.nabble.com/file/p32464608/postmod.if.xml postmod.if.xml  :
 This is premod.if.xml, but with many of the page elements and some
 page-sequence elements removed.  You will notice extra white space where
 elements were deleted.  
 

-- 
View this message in context: 
http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464608.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: Producing PDF from subset of IF file pages

2011-09-14 Thread Eric Douglas
Actually, did you upload them somewhere to link?
I believe this distribution list does not allow attachments.
 

-Original Message-
From: jeanyo [mailto:melanie.dr...@gmail.com] 
Sent: Wednesday, September 14, 2011 11:43 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Producing PDF from subset of IF file pages


Actually, here are the file attachments...


jeanyo wrote:
 
 I have attached two files:
 -  http://old.nabble.com/file/p32464608/premod.if.xml premod.if.xml  :
 This is the untouched IF file.
 -  http://old.nabble.com/file/p32464608/postmod.if.xml postmod.if.xml
:
 This is premod.if.xml, but with many of the page elements and some 
 page-sequence elements removed.  You will notice extra white space 
 where elements were deleted.
 

--
View this message in context:
http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-t
p32463958p32464608.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


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



RE: Producing PDF from subset of IF file pages

2011-09-14 Thread jeanyo

Sorry, I believe these links should work:

http://old.nabble.com/file/p32464608/premod.if.xml 
http://old.nabble.com/file/p32464608/postmod.if.xml 


Eric Douglas wrote:
 
 Actually, did you upload them somewhere to link?
 I believe this distribution list does not allow attachments.
 

-- 
View this message in context: 
http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464720.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: Producing PDF from subset of IF file pages

2011-09-14 Thread Jeremias Maerki
Hmm, a NullPointerException is not a very nice way to handle this. Would
you mind creating a Bugzilla issue for this maybe?
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop

Anyway, if all you need are hard copies, you can probably just filter
all nav:* elements 
(http://xmlgraphics.apache.org/fop/intermediate/document-navigation)
and it should work.

On 14.09.2011 17:39:37 jeanyo wrote:
 
 Thanks for your help!
 
 I have attached two files:
 - premod.if.xml: This is the untouched IF file.
 - postmod.if.xml: This is premod.if.xml, but with many of the page
 elements and some page-sequence elements removed.  You will notice extra
 white space where elements were deleted.  
 
 
 The specific error I get when trying to generate the PDF is:
 Caused by: java.lang.NullPointerException 
 at
 org.apache.fop.render.pdf.PDFDocumentNavigationHandler.updateTargetLocation(PDFDocumentNavigationHandler.java:188)
 at
 org.apache.fop.render.pdf.PDFDocumentNavigationHandler.getAction(PDFDocumentNavigationHandler.java:160)
 at
 org.apache.fop.render.pdf.PDFDocumentNavigationHandler.renderLink(PDFDocumentNavigationHandler.java:108)
 at
 org.apache.fop.render.intermediate.extensions.DocumentNavigationHandler.endElement(DocumentNavigationHandler.java:186)
 [rest of stack omitted] 
 
 I believe the NullPointerException occurs on this line in
 PDFDocumentNavigationHandler.java:
 action.getTargetLocation().x / 1000.0,
 
 Does target location imply a link target location?  If so, you were
 correct in predicting this as an issue.  I'm not sure this version of the
 publication must support linking, but I will verify.  The real purpose is to
 provide a hard copy of the PDF.
 
 Thanks again.
 -- 
 View this message in context: 
 http://old.nabble.com/Producing-PDF-from-subset-of-IF-file-%3Cpage%3Es-tp32463958p32464585.html
 Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


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



Can FOP work backwards?

2011-09-14 Thread Eric Douglas
I know the intention of FOP is to create PDF, but since FOP did create
the PDF the code should be there to read the PDF.
I want to take a PDF (generated by FOP) and read it back in, to be able
to print it, or to display it in a Swing component.  I already have a
Swing component, if FOP can tell me enough information about what it put
in the PDF and where.



Re: Can FOP work backwards?

2011-09-14 Thread mehdi houshmand
On 14 September 2011 18:31, Eric Douglas edoug...@blockhouse.com wrote:
 I know the intention of FOP is to create PDF, but since FOP did create the
 PDF the code should be there to read the PDF.

No, FOP doesn't parse PDF.

 I want to take a PDF (generated by FOP) and read it back in, to be able to
 print it, or to display it in a Swing component.  I already have a Swing
 component, if FOP can tell me enough information about what it put in the
 PDF and where.

Check out PDFBox, it has PDF displaying functionality.

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



Re: Error messages from fop

2011-09-14 Thread Simon Pepping
The problem does not occur in fop-1.0, nor in the current development
version of fop. It may be bug 46386 (see 
https://issues.apache.org/bugzilla/show_bug.cgi?id=46386). That bug
report suggests that the problem is due to an empty inline with an id.
You may either remove such elements, or upgrade to fop-1.0.

We recently discussed with fedora how to solve the problem that they
had with building fop-1.0, so I hope it is now available in fedora.

Best, Simon

On Wed, Sep 14, 2011 at 11:13:42AM +0200, Lars Bjørndal wrote:
 Hello
 
 I'd like to convert the following file into PDF, using fop version 0.95.
 
   http://lamasti.net/filer/test.fo
 
 The fo file is generated from an Docbook XML file with xsltproc. The
 rest of this mail shows the output from fop, and I hope someon could
 help me find a way out...
 
 The CLASSPATH variable is set to:
 /usr/share/java/commons-io.jar:/usr/share/java/batik-all.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/xmlgraphics-commons.jar:/usr/share/java/commons-logging.jar:/usr/share/java/fop.jar::/usr/share/java/xml-commons-apis-ext.jar:/home/lrs/fop/fop-hyph.jar
 
 Here's the output:
 

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



Re: Norwegian hyphenation rules

2011-09-14 Thread Simon Pepping
Yes, I realized that FOP_HYPHENATION_PATH is used in debian and
ubuntu, and in fop's own startup script, and apparently not in fedora.
Does the fedora script have no option to add the path to the
hyphenation jar file, other than modifying the script?

Simon

On Wed, Sep 14, 2011 at 11:03:43AM +0200, Lars Bjørndal wrote:
 Hello, Simon, and thank you much for your valuable feedback!
 
 You wrote:
 
  This should work. If you are using fop downloaded from Apache, use:
 
  fop --execdebug xxx.fo xxx.pdf
 
  to see the classpath, and check whether /home/lrs/fop/fop-hyph.jar is
  part of it. Also check if /home/lrs/fop/fop-hyph.jar exists and is
  readable.
 
 I use Fedora 14 with a pre built RPM package, fop-0.95-5.fc14.noarch.
 the fop-hyph.jar file exists, and is readable. I ended up modifying the
 /usr/bin/fop shell script, by adding the path to the fop-hyph.jar file
 to the CLASSPATH variable. BTW the ~/.foprc file is also read, but it
 seems that putting the environment variable
 FOP_HYPHENATION_PATH=/home/lrs/fop/fop-hyph.jar in it, has no effect.

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