The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  вход/выход  слежка  RSS
"ошибка при  конвертации fo в PDF"
Вариант для распечатки  
Пред. тема | След. тема 
Форумы WEB технологии (Public)
Изначальное сообщение [ Отслеживать ]

"ошибка при  конвертации fo в PDF"  
Сообщение от agsmorodin email(ok) on 15-Апр-08, 12:51 
добрый день. проблема в следующем.
использую конвертер html в fo  html2fo
  конвертирую файл  http://html2fo.sourceforge.net/testsuite/table.html  при помощи команды html2fo table.html  table.fo  - все ок, файл table.fo создается, аналогично как и в примере http://html2fo.sourceforge.net/testsuite/table.fo.
после этого пытаюсь перегнать его в pdf,используя
fop -fo table.fo -pdf table.pdf

и в ответ получаю
fop -fo table.fo -pdf table.pdf
15.04.2008 11:13:59 org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
        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)

---------

javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
        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)
Caused by: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
        at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
        at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
        at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
        at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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)
        ... 4 more
---------
org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
        at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
        at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
        at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
        at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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)
//
естественно файл pdf не создается.
операционная система freeBSD 6.2  
html2fo-0.4.2
fop-0.94
        спасибо

Высказать мнение | Ответить | Правка | Cообщить модератору

 Оглавление

Сообщения по теме [Сортировка по времени | RSS]


1. "ошибка при  конвертации fo в PDF"  
Сообщение от Владислав (??) on 16-Апр-08, 10:55 
Привет!

Покажи свой table.fo для начала.

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

2. "ошибка при  конвертации fo в PDF"  
Сообщение от agsmorodin (ok) on 17-Апр-08, 09:43 
>Привет!
>
>Покажи свой table.fo для начала.

  вот.   p.s.  писал разработчикам, но что-то ноль ответа.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions">
    <!-- Creator="html2fo" Version="0.4.2" -->
    <fo:layout-master-set>
        <fo:simple-page-master margin-right="2.0cm" margin-left="2.0cm" margin-bottom="1.0cm" margin-top="1.0cm" page-width="21cm" page-height="29.7cm" master-name="first">
            <fo:region-before extent="1.5cm"/>
            <fo:region-body margin-bottom="1.5cm" margin-top="1.5cm"/>
            <fo:region-after extent="1.0cm"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="first" language="de" hyphenate="true">
    
        
    
    <fo:static-content flow-name="xsl-region-before">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">Table Test Page</fo:block></fo:static-content>

<fo:static-content flow-name="xsl-region-after">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"></fo:block><fo:block line-height="12pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline font-size="10pt">Page </fo:inline><fo:inline font-size="10pt"><fo:page-number></fo:page-number></fo:inline><fo:inline font-size="10pt"> of </fo:inline><fo:inline font-size="10pt"><fo:page-number-citation ref-id="LastPage"></fo:page-number-citation></fo:inline></fo:block></fo:static-content>

<fo:flow flow-name="xsl-region-body">
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example page with a table with col- and rowspans.</fo:block>
        <fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="1.35cm"/>
<fo:table-column column-width="1.34cm"/>
<fo:table-column column-width="1.35cm"/>
<fo:table-column column-width="1.35cm"/>
<fo:table-body>
            <fo:table-row>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                    >

                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;1 1x1</fo:block>
                </fo:table-cell>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                     number-columns-spanned="2">
                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;2 1x2</fo:block>
                </fo:table-cell>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                     number-rows-spanned="3">
                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;4 3x1</fo:block>
                </fo:table-cell>
            </fo:table-row>
            <fo:table-row>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                     number-rows-spanned="2" number-columns-spanned="2">
                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">2;1 2x2</fo:block>
                </fo:table-cell>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                    >

                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">2;3 1x1</fo:block>
                </fo:table-cell>
            </fo:table-row>
            <fo:table-row>
                <fo:table-cell border-style="solid" border-color="black" border-width="1pt"
                    >

                    <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">3;3 1x1</fo:block>
                </fo:table-cell>
            </fo:table-row>
        </fo:table-body></fo:table>
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an empty example table tag</fo:block>
        <fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty row tag.</fo:block>
        <fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty cell tag.</fo:block>
        <fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline white-space-collapse="false"> </fo:inline></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table>
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty cell tag and another empty row</fo:block>
        <fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline white-space-collapse="false"> </fo:inline></fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
        <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is the last Paragraph of my test document</fo:block>
    <fo:block space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" id="LastPage" line-height="1pt" font-size="1pt"></fo:block></fo:flow>
</fo:page-sequence></fo:root>

Высказать мнение | Ответить | Правка | Наверх | Cообщить модератору

Архив | Удалить

Индекс форумов | Темы | Пред. тема | След. тема
Оцените тред (1=ужас, 5=супер)? [ 1 | 2 | 3 | 4 | 5 ] [Рекомендовать для помещения в FAQ]




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру