RE: FOP 0.94 : How to increase heap size

2008-09-05 Thread Newkid

Hello Eric,

Thanks for URL.

I need to know how one can modify the FOP.BAT file. Is there any options
thru which I can reset the heap size in FOP.BAT file.

With Thanks!
Newkid


Amick, Eric wrote:
 
 http://xmlgraphics.apache.org/fop/0.94/running.html#memory 
 
 
 Eric Amick
 Legislative Computer Systems
 Office of the Clerk
 
 -Original Message-
 From: Newkid [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 4, 2008 10:25
 To: fop-users@xmlgraphics.apache.org
 Subject: FOP 0.94 : How to increase heap size
 
 
 Hi there!
 
 Could you please assist me how can I increase JVM heap size? 
 
 Please let me know what I have to modify in FOP.BAT file so that it can
 take automatically whenever I run FOP from command prompt.
 
 When I am trying to convert XML to PDF using FOP, it's showing
 java.lang:OutofMemory Java heap space error.
 
 Would appreciate your prompt response!
 
 With Thanks!
 Newkid
 --
 View this message in context:
 http://www.nabble.com/FOP-0.94-%3A-How-to-increase-heap-size-tp19309290p
 19309290.html
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FOP-0.94-%3A-How-to-increase-heap-size-tp19309290p19328398.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Trying to programmatically add fonts

2008-09-05 Thread eborisow

Hi,

I am trying to embed fonts in a program.  I was able to get my fonts to work
when I run fop.bat standalone.  Here were the relevant lines from the config
xml.

font-basefile:///C:/programs/apache/fop-0.94-bin-jdk1.3/fonts//font-base

!-- not sure if font tags will display on web site --
fonts

  font-triplet name=Verdana style=normal weight=normal/


  font-triplet name=Verdana style=normal weight=bold/


  font-triplet name=Verdana style=italic weight=bold/

/fonts

Like I said, this one works.  Now, in an application, I am trying to do the
same using the API.


// Set the Font Base URL
   
fopFactory.setFontBaseURL(file:///C:/programs/apache/fop-0.94-bin-jdk1.3/fonts/);

String font1 = verdana.xml;
String font1Url = verdana.ttf;

String font2 = verdanab.xml;
String font2Url = verdanab.ttf;

String font3 = verdanaz.xml;
String font3Url = verdanaz.ttf;

FontTriplet fontTriplet1 = new FontTriplet(Verdana,
Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);
FontTriplet fontTriplet2 = new FontTriplet(Verdana,
Font.STYLE_NORMAL, Font.WEIGHT_BOLD);
FontTriplet fontTriplet3 = new FontTriplet(Verdana,
Font.STYLE_ITALIC, Font.WEIGHT_BOLD);

List fontTriplets1 = new ArrayList();
fontTriplets1.add(fontTriplet1);

List fontTriplets2 = new ArrayList();
fontTriplets2.add(fontTriplet2);

List fontTriplets3 = new ArrayList();
fontTriplets3.add(fontTriplet3);

EmbedFontInfo verdanaFontInfo = new EmbedFontInfo(font1, true,
fontTriplets1, font1Url);
EmbedFontInfo verdanaBoldFontInfo = new EmbedFontInfo(font2,
true, fontTriplets2, font2Url);
EmbedFontInfo verdanaBoldItalicFontInfo = new
EmbedFontInfo(font3, true, fontTriplets3, font3Url);
FontCache fontCache = fopFactory.getFontCache();
fontCache.addFont(verdanaFontInfo);
fontCache.addFont(verdanaBoldFontInfo);
fontCache.addFont(verdanaBoldItalicFontInfo);
fontCache.save();

I test the cache using the following:

log.debug(Contains verdana font:  +
fontCache.containsFont(verdanaFontInfo));
log.debug(Verdana font info is:  +
fontCache.getFont(verdana.ttf).toString());

log.debug(Contains verdana-bold font:  +
fontCache.containsFont(verdanaBoldFontInfo));
log.debug(Verdana-bold font info is:  +
fontCache.getFont(verdanab.ttf).toString());

log.debug(Contains verdana-bold-italic font:  +
fontCache.containsFont(verdanaBoldItalicFontInfo));
log.debug(Verdana-bold-italic font info is:  +
fontCache.getFont(verdanaz.ttf).toString());

In the log, I get the following:

2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:153)  - Contains verdana font:
true
2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:154)  - Verdana font info is:
metrics-url=verdana.xml,embed-url=verdana.ttf, kerning=true,
font-triplet=[Verdana,normal,400], lastModified=-1
2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:156)  - Contains verdana-bold
font: true
2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:157)  - Verdana-bold font info
is: metrics-url=verdanab.xml,embed-url=verdanab.ttf, kerning=true,
font-triplet=[Verdana,normal,700], lastModified=-1
2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:159)  - Contains
verdana-bold-italic font: true
2008-09-05 12:05:12,014 [main] DEBUG
embedding.ExampleXML2PDF(ExampleXML2PDF.java:160)  - Verdana-bold-italic
font info is: metrics-url=verdanaz.xml,embed-url=verdanaz.ttf, kerning=true,
font-triplet=[Verdana,italic,700], lastModified=-1

However, when it actually tries to convert the XML to PDF, I see the
following message in the log:

2008-09-05 12:05:26,905 [main] DEBUG
org.apache.fop.fonts.FontInfo(FontInfo.java:134)  - Font lookup: Verdana
normal 400
2008-09-05 12:05:26,905 [main] WARN 
org.apache.fop.fonts.FontInfo(FontInfo.java:263)  - Font
'Verdana,normal,400' not found. Substituting with 'any,normal,400'.

So, I am obviously doing something wrong.  Can someone see what the problem
is?

Thanks,
Eric
-- 
View this message in context: 
http://www.nabble.com/Trying-to-programmatically-add-fonts-tp19334713p19334713.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FOP 0.94 : How to increase heap size

2008-09-05 Thread Amick, Eric
There's a line in fop.bat that sets the variable JAVAOPTS; if you modify
that line and put quotes around references to that variable in the rest
of the file, it should work. 


Eric Amick
Legislative Computer Systems
Office of the Clerk

-Original Message-
From: Newkid [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 5, 2008 6:15
To: fop-users@xmlgraphics.apache.org
Subject: RE: FOP 0.94 : How to increase heap size


Hello Eric,

Thanks for URL.

I need to know how one can modify the FOP.BAT file. Is there any options
thru which I can reset the heap size in FOP.BAT file.

With Thanks!
Newkid


Amick, Eric wrote:
 
 http://xmlgraphics.apache.org/fop/0.94/running.html#memory
 
 
 Eric Amick
 Legislative Computer Systems
 Office of the Clerk
 
 -Original Message-
 From: Newkid [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 4, 2008 10:25
 To: fop-users@xmlgraphics.apache.org
 Subject: FOP 0.94 : How to increase heap size
 
 
 Hi there!
 
 Could you please assist me how can I increase JVM heap size? 
 
 Please let me know what I have to modify in FOP.BAT file so that it 
 can take automatically whenever I run FOP from command prompt.
 
 When I am trying to convert XML to PDF using FOP, it's showing 
 java.lang:OutofMemory Java heap space error.
 
 Would appreciate your prompt response!
 
 With Thanks!
 Newkid
 --
 View this message in context:
 http://www.nabble.com/FOP-0.94-%3A-How-to-increase-heap-size-tp1930929
 0p
 19309290.html
 Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

--
View this message in context:
http://www.nabble.com/FOP-0.94-%3A-How-to-increase-heap-size-tp19309290p
19328398.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NPE when rendering fo:block-container inside fo:inline

2008-09-05 Thread Frank Worsley
Hello,

I am using the Antenna House XSL stylesheets to convert XHTML to
XML-FO. This works very well in most cases. However, I have come
across a problem where a fo:block-container inside a fo:inline will
cause an NPE.

An example FO file that exhibits this problem is attached. The stack
trace is also attached. If you remove the fo:inline that encloses the
fo:block-container, then everything works fine.

I'm wondering, is it even legal to have fo:block-container inside a
fo:inline? If it is legal, any chance that this problem has been fixed
in 0.95?

Thank you for any insights.

- Frank
?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:html=http://www.w3.org/1999/xhtml; writing-mode=lr-tb hyphenate=false text-align=start role=html:html
  fo:layout-master-set
fo:simple-page-master page-width=auto page-height=auto master-name=all-pages
  fo:region-body column-gap=12pt column-count=1 margin-left=0.5in margin-bottom=0.75in margin-right=0.5in margin-top=0.75in/
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-reference=all-pages
fo:flow flow-name=xsl-region-body
  fo:block
fo:inline
  fo:block-container width=550px border=1px solid gray color=#FF2525 padding=10px text-align=left vertical-align=top
fo:block end-indent=0pt start-indent=0ptTest/fo:block
  /fo:block-container
/fo:inline
  /fo:block
/fo:flow
  /fo:page-sequence
/fo:root
5-Sep-2008 10:07:34 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.NullPointerException
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)

-

java.lang.NullPointerException
at 
org.apache.fop.layoutmgr.BlockContainerLayoutManager.getNextKnuthElements(BlockContainerLayoutManager.java:200)
at 
org.apache.fop.layoutmgr.inline.InlineLayoutManager.getNextKnuthElements(InlineLayoutManager.java:303)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:654)
at 
org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:590)
at 
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:284)
at 
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:113)
at 
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:106)
at 
org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
at 
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:551)
at 
org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:301)
at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:263)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:144)
at 
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:233)
at 
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:145)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Trying to programmatically add fonts

2008-09-05 Thread John Brown
eborisow eborisow at yahoo.com writes:

 
 
 Hi,
 
 I am trying to embed fonts in a program.  I was able to get my fonts to work
 when I run fop.bat standalone.  Here were the relevant lines from the config
 xml.
 

snip
Contents of config file
/snip
 
 Like I said, this one works.  Now, in an application, I am trying to do the
 same using the API.
 
snip
Code to do above programatically
/snip

snip
Contents of log
/snip 

 So, I am obviously doing something wrong.  Can someone see what the problem
 is?

According to the documentation at 
http://xmlgraphics.apache.org/fop/0.95/fonts.html#basics

It is currently not possible to easily configure fonts from Java code.

I assume that this means that it is not impossible, but I have no idea
how. Hopefully an expert will turn up soon.

 
 Thanks,
 Eric





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Trying to programmatically add fonts

2008-09-05 Thread eborisow


Alias John Brown wrote:
 
 
 According to the documentation at 
 http://xmlgraphics.apache.org/fop/0.95/fonts.html#basics
 
 It is currently not possible to easily configure fonts from Java code.
 
 I assume that this means that it is not impossible, but I have no idea
 how. Hopefully an expert will turn up soon.
 
 

John,

Thanks for the reply.  I have also tried specifying the config file using
the method in the docs.  Here is what I tried:

DefaultConfigurationBuilder cfgBuilder = new
DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(new File(baseDir,
Local\\personal\\durkan\\projects\\fop\\new-font.conf.xml));
fopFactory.setUserConfig(cfg);

This gives me the same result.  The fonts are not available.  So, I am
probably doing something wrong.

Thanks,
Eric
-- 
View this message in context: 
http://www.nabble.com/Trying-to-programmatically-add-fonts-tp19334713p19342339.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]