Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XSL-FO] Text vs. PDF output

Expand Messages
  • Chris Bowditch
    ... I explained the reason for this in an earlier post this morning. Basically XSL-FO formatters are geared up for Print output, which requires pint point
    Message 1 of 12 , Jan 8, 2004
      Hallman, Chuck (NIH/NIEHS) wrote:

      > I have produced 40 different reports using FO that look beautiful when
      > output as PDF. However if I take these same reports and let FOP output as
      > text they are a complete mess. You can read them but they look really bad.
      > The alignment of tables is off, lots of whitespace where there shouldn't be,
      > etc; ).

      I explained the reason for this in an earlier post this morning.
      Basically XSL-FO formatters are geared up for Print output, which
      requires pint point precision to be used during layout. The Text
      renderer in FOP must then takes these coordinates and round them to the
      nearest character position.

      > Will I be forced to write a separate stylesheet for the text version of
      > these reports or is there something ( some setting, etc; ) that will help me
      > render a text version that closely resembles the PDF version?

      This is the most elegant solution to the problem. In general XSL-FO
      formatters are the wrong tool for generating Text.

      >
      > Any help appreciated. I sure hate to think about creating new stylesheets
      > just for text output ...

      You can work around the whitespaces problems in text output to some
      extent by using a fixed width font, and fixed line height.

      Chris
    • J.Pietschmann
      ... Try fiddling with the line-per-page and characters-per-line settings to match your expected output. Images and such must be perfect multiples of the line
      Message 2 of 12 , Jan 8, 2004
        Hallman, Chuck (NIH/NIEHS) wrote:
        > I have produced 40 different reports using FO that look beautiful when
        > output as PDF. However if I take these same reports and let FOP output as
        > text they are a complete mess. You can read them but they look really bad.
        > The alignment of tables is off, lots of whitespace where there shouldn't be,
        > etc; ).

        Try fiddling with the line-per-page and characters-per-line settings to
        match your expected output. Images and such must be perfect multiples
        of the line heigth, unaligned images, different font sizes, display space,
        table borders and many other things will probably screw the output.

        J.Pietschmann
      • Victor Vishnyakov
        Why using FOP to generate text? Make a XSL Transform to generate text-like reports directly from your XML without render. Thus you can manually create any text
        Message 3 of 12 , Jan 9, 2004
          Why using FOP to generate text?
          Make a XSL Transform to generate text-like reports directly from your
          XML without render. Thus you can manually create any text layout you
          wish.

          Regards,
          Victor Vishnyakov



          > -----Original Message-----
          > From: Hallman, Chuck (NIH/NIEHS) [mailto:hallman1@...]
          > Sent: Thursday, January 08, 2004 3:19 PM
          > To: XSL-FO@yahoogroups.com
          > Subject: [XSL-FO] Text vs. PDF output
          >
          >
          > I have produced 40 different reports using FO that look
          > beautiful when output as PDF. However if I take these same
          > reports and let FOP output as text they are a complete mess.
          > You can read them but they look really bad. The alignment of
          > tables is off, lots of whitespace where there shouldn't be, etc; ).
          >
          > Will I be forced to write a separate stylesheet for the text
          > version of these reports or is there something ( some
          > setting, etc; ) that will help me render a text version that
          > closely resembles the PDF version?
          >
          > Any help appreciated. I sure hate to think about creating new
          > stylesheets just for text output ...
        • christian brugeron
          Our concern is to output formatted tables. I’m sure this has already be done. The FOP approach doens’t work at all for that. Is there any XSL around that
          Message 4 of 12 , Jan 9, 2004
            Our concern is to output formatted tables. I’m sure this has already be
            done. The FOP approach doens’t work at all for that.

            Is there any XSL around that may output spanned tables, formatted text,
            and the like ?

            Thanks

            Christian

            -----Message d'origine-----
            De : Victor Vishnyakov [mailto:tch_@...]
            Envoyé : vendredi 9 janvier 2004 13:52
            À : XSL-FO@yahoogroups.com
            Cc : hallman1@...
            Objet : RE: [XSL-FO] Text vs. PDF output

            Why using FOP to generate text?
            Make a XSL Transform to generate text-like reports directly from your
            XML without render. Thus you can manually create any text layout you
            wish.

            Regards,
            Victor Vishnyakov



            > -----Original Message-----
            > From: Hallman, Chuck (NIH/NIEHS) [mailto:hallman1@...]
            > Sent: Thursday, January 08, 2004 3:19 PM
            > To: XSL-FO@yahoogroups.com
            > Subject: [XSL-FO] Text vs. PDF output
            >
            >
            > I have produced 40 different reports using FO that look
            > beautiful when output as PDF. However if I take these same
            > reports and let FOP output as text they are a complete mess.
            > You can read them but they look really bad. The alignment of
            > tables is off, lots of whitespace where there shouldn't be, etc; ).
            >
            > Will I be forced to write a separate stylesheet for the text
            > version of these reports or is there something ( some
            > setting, etc; ) that will help me render a text version that
            > closely resembles the PDF version?
            >
            > Any help appreciated. I sure hate to think about creating new
            > stylesheets just for text output ...


            _____

            Yahoo! Groups Links
            * To visit your group on the web, go to:
            http://groups.yahoo.com/group/XSL-FO/

            * To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@yahoogroups.com
            <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

            * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            Service <http://docs.yahoo.com/info/terms/> .


            [Non-text portions of this message have been removed]
          • Dave Pawson
            ... No. If you want html. Write your own stylesheet. If you want pdf, write an xsl-fo stylesheet. If you want text, write a text stylesheet. Sorry, you ll
            Message 5 of 12 , Jan 9, 2004
              At 13:38 09/01/2004, christian brugeron wrote:
              >Our concern is to output formatted tables. I'm sure this has already be
              >done. The FOP approach doens't work at all for that.
              >
              >Is there any XSL around that may output spanned tables, formatted text,
              >and the like ?

              No.

              If you want html. Write your own stylesheet.
              If you want pdf, write an xsl-fo stylesheet.
              If you want text, write a text stylesheet.

              Sorry, you'll have to do some work.

              regards DaveP
            • christian brugeron
              Hehe, quiet there ! I understand that we need to write html and pdf stylesheets as they are very specific of the publication we want to output. But, frankly,
              Message 6 of 12 , Jan 9, 2004
                Hehe, quiet there !

                I understand that we need to write html and pdf stylesheets as they are
                very specific of the publication we want to output.

                But, frankly, text output will be always the same, or very close.

                That’s why I was asking.

                I like to do some, or more, works, but here….

                You can have a look at what can be done using pdf and html on this site:

                <http://balo.journal-officiel.gouv.fr/ListeResultBalo.asp?data=1>

                If you read French, look at any “publication périodiques” to get an idea
                of the tables.

                Christian


                -----Message d'origine-----
                De : Dave Pawson [mailto:dpawson@...]
                Envoyé : vendredi 9 janvier 2004 17:54
                À : XSL-FO@yahoogroups.com
                Objet : RE : [XSL-FO] Text vs. PDF output

                At 13:38 09/01/2004, christian brugeron wrote:
                >Our concern is to output formatted tables. I'm sure this has already be
                >done. The FOP approach doens't work at all for that.
                >
                >Is there any XSL around that may output spanned tables, formatted text,
                >and the like ?

                No.

                If you want html. Write your own stylesheet.
                If you want pdf, write an xsl-fo stylesheet.
                If you want text, write a text stylesheet.

                Sorry, you'll have to do some work.

                regards DaveP



                _____

                Yahoo! Groups Links
                * To visit your group on the web, go to:
                http://groups.yahoo.com/group/XSL-FO/

                * To unsubscribe from this group, send an email to:
                XSL-FO-unsubscribe@yahoogroups.com
                <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

                * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                Service <http://docs.yahoo.com/info/terms/> .


                [Non-text portions of this message have been removed]
              • Dave Pawson
                ... But not close enough? How about writing a java extension to do the word wrapping, call that from your stylesheet? Or better, lose the tables and present it
                Message 7 of 12 , Jan 9, 2004
                  At 18:41 09/01/2004, you wrote:
                  >Hehe, quiet there !
                  >
                  >I understand that we need to write html and pdf stylesheets as they are
                  >very specific of the publication we want to output.
                  >
                  >But, frankly, text output will be always the same, or very close.

                  But not close enough?
                  How about writing a java extension to do the word wrapping,
                  call that from your stylesheet?
                  Or better, lose the tables and present it in paragraphs
                  for the plain text version?





                  >You can have a look at what can be done using pdf and html on this site:
                  >
                  ><http://balo.journal-officiel.gouv.fr/ListeResultBalo.asp?data=1>
                  >
                  >If you read French, look at any "publication périodiques"


                  Je n'peu pas trouver "publication périodiques" ?

                  regards DaveP
                • christian brugeron
                  By contract, I can output a sentence like « see the table in the printed version ». But, an other contractor was able to output tables, and I think the
                  Message 8 of 12 , Jan 9, 2004
                    By contract, I can output a sentence like « see the table in the printed
                    version ».
                    But, an other contractor was able to output tables, and I think the
                    customer may want them sometime.

                    If I can avoid to redo some other work, not significant for me, I will
                    be more that pleased.

                    CB


                    -----Message d'origine-----
                    De : Dave Pawson [mailto:dpawson@...]
                    Envoyé : vendredi 9 janvier 2004 19:55
                    À : XSL-FO@yahoogroups.com
                    Objet : RE : RE : [XSL-FO] Text vs. PDF output

                    At 18:41 09/01/2004, you wrote:
                    >Hehe, quiet there !
                    >
                    >I understand that we need to write html and pdf stylesheets as they are
                    >very specific of the publication we want to output.
                    >
                    >But, frankly, text output will be always the same, or very close.

                    But not close enough?
                    How about writing a java extension to do the word wrapping,
                    call that from your stylesheet?
                    Or better, lose the tables and present it in paragraphs
                    for the plain text version?





                    >You can have a look at what can be done using pdf and html on this
                    site:
                    >
                    ><http://balo.journal-officiel.gouv.fr/ListeResultBalo.asp?data=1>
                    >
                    >If you read French, look at any "publication périodiques"


                    Je n'peu pas trouver "publication périodiques" ?

                    regards DaveP






                    Yahoo! Groups Sponsor


                    ADVERTISEMENT

                    <http://rd.yahoo.com/SIG=12cjaolmn/M=267637.4116730.5333196.1261774/D=eg
                    roupweb/S=1705016061:HM/EXP=1073760890/A=1853618/R=0/*http:/www.netflix.
                    com/Default?mqso=60178338&partid=4116730> click here


                    <http://us.adserver.yahoo.com/l?M=267637.4116730.5333196.1261774/D=egrou
                    pmail/S=:HM/A=1853618/rand=379460059>

                    _____

                    Yahoo! Groups Links
                    * To visit your group on the web, go to:
                    http://groups.yahoo.com/group/XSL-FO/

                    * To unsubscribe from this group, send an email to:
                    XSL-FO-unsubscribe@yahoogroups.com
                    <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

                    * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                    Service <http://docs.yahoo.com/info/terms/> .


                    [Non-text portions of this message have been removed]
                  • tokukobayashi2002
                    Hi! I may offer two methods, The first is to use text browser. Transform your XML to HTML, then use w3m. w3m is a text browser on Unix, it can save a HTML as a
                    Message 9 of 12 , Jan 9, 2004
                      Hi!

                      I may offer two methods,

                      The first is to use text browser.
                      Transform your XML to HTML, then use w3m.
                      w3m is a text browser on Unix, it can save a HTML as a text file.
                      We tried it about a half year ago, and it seemed to work.
                      (We did not used it finally).

                      XSL Formatter V3.0 has a secret function to output text.

                      Try option -p @TEXT instead of @PDF or Printer name.
                      For example,

                      XSLcmd -d foo.fo -p @TEXT -o foo.txt

                      It will generate formatted table.
                      It generates only Shift-Jis encoded text file at now.
                      Shift-JIS is a superset of ASCII, then ASCII encoded text
                      file will be output correctly.

                      One note: you MUST specify fixed pitch fonts for a table.

                      I hope the information will help.

                      Best regards,

                      Tokushige Kobayashi
                      Antenna House, Inc.
                      E-mail koba@...
                      WWW http://www.antenna.co.jp/
                      WWW http://www.antennahouse.com/ (English)
                      TEL +81-3-3234-1361(direct call)
                      FAX +81-3-3221-9975

                      --- In XSL-FO@yahoogroups.com, Dave Pawson <dpawson@n...> wrote:
                      > At 13:38 09/01/2004, christian brugeron wrote:
                      > >Our concern is to output formatted tables. I'm sure this has
                      already be
                      > >done. The FOP approach doens't work at all for that.
                      > >
                      > >Is there any XSL around that may output spanned tables, formatted
                      text,
                      > >and the like ?
                      >
                      > No.
                      >
                      > If you want html. Write your own stylesheet.
                      > If you want pdf, write an xsl-fo stylesheet.
                      > If you want text, write a text stylesheet.
                      >
                      > Sorry, you'll have to do some work.
                      >
                      > regards DaveP
                    • Franz Schmid
                      Hi, I started using xsl-fo some weeks ago when trying to write own xml and xsl file for pdf-document creation via fop . What I would like to get is a title
                      Message 10 of 12 , Jan 12, 2004
                        Hi,

                        I started using xsl-fo some weeks ago when trying to write own xml and xsl file for pdf-document creation via 'fop'.

                        What I would like to get is a title page plus the rest of a document. But I have problems to write an appropriate xsl file.
                        How can I get a title page, which contents comes from XML file in the block <titlepage> </titlepage>?
                        I don't know how to associate a 'simple-page-master' with a XML block like <titlepage> ..... </titlepage> or if it is really possible.

                        Maybe somebody of you know how the XSL semantic could be.
                        Here the the XSL-code I used so far.

                        Thanks in advance.

                        Franz

                        .....
                        <fo:layout-master-set>
                        <fo:simple-page-master master-name="first"
                        page-height="297mm" page-width="210mm"
                        margin-top="20mm" margin-bottom="20mm"
                        margin-left="25mm" margin-right="25mm">
                        <fo:region-body margin-bottom="20mm"/>
                        <fo:region-after region-name="footer-first" extent="20mm"/>
                        </fo:simple-page-master>


                        <fo:simple-page-master master-name="rest"
                        page-height="297mm" page-width="210mm"
                        margin-top="20mm" margin-bottom="20mm"
                        margin-left="25mm" margin-right="25mm">
                        <fo:region-body margin-bottom="20mm"/>
                        <fo:region-after region-name="footer-rest" extent="20mm"/>
                        </fo:simple-page-master>

                        <fo:page-sequence-master master-name="document">
                        <fo:repeatable-page-master-alternatives>
                        <fo:conditional-page-master-reference page-position="first"
                        master-reference="first"/>
                        <fo:conditional-page-master-reference page-position="rest"
                        master-reference="rest"/>
                        </fo:repeatable-page-master-alternatives>
                        </fo:page-sequence-master>

                        </fo:layout-master-set>

                        <fo:page-sequence master-reference="document">
                        <fo:static-content flow-name="footer-first">
                        <fo:block text-align="center">First page.
                        </fo:block>
                        </fo:static-content>
                        <fo:static-content flow-name="footer-rest">
                        <fo:block>
                        <xsl:text>Page </xsl:text>
                        <fo:page-number/>
                        </fo:block>
                        </fo:static-content>
                        <fo:flow flow-name="xsl-region-body">
                        <fo:block/>
                        <fo:block break-before="page"/>
                        <!-- create the table of contents -->
                        <xsl:apply-templates select="chapter/title" mode="toc"/>
                        <!-- do the document -->
                        <xsl:apply-templates/>
                        <fo:block break-before="page"/>
                        </fo:flow>
                        </fo:page-sequence>
                        </fo:root>
                        </xsl:template>
                        ........
                        ----------------------------end of XSL file ------------------------------------------
                        --------------------- part of the XML file --------------------
                        ....
                        <titlepage>
                        <title>Spanish Review Handbook</title>
                        </titlepage>
                        ........
                        ----------------- end of XML file






                        ---------------------------------
                        Gesendet von http://mail.yahoo.de
                        Schneller als Mail - der neue Yahoo! Messenger.

                        [Non-text portions of this message have been removed]
                      • G. Ken Holman
                        ... Looking at your stylesheet it would seem you are placing only an empty block on the first page before jumping to the second page. ... What I think you are
                        Message 11 of 12 , Jan 12, 2004
                          At 2004-01-12 18:48 +0100, Franz Schmid wrote:
                          >What I would like to get is a title page plus the rest of a document. But
                          >I have problems to write an appropriate xsl file.
                          >How can I get a title page, which contents comes from XML file in the
                          >block <titlepage> </titlepage>?

                          Looking at your stylesheet it would seem you are placing only an empty
                          block on the first page before jumping to the second page.

                          >I don't know how to associate a 'simple-page-master' with a XML block like
                          ><titlepage> ..... </titlepage> or if it is really possible.
                          >
                          >Maybe somebody of you know how the XSL semantic could be.

                          What I think you are missing is that you are obliged in XSLT to build the
                          result tree in result parse order. This requires you to do the <titlepage>
                          processing *at the time the title page content belongs in the flow*.

                          Remember in XSLT there is no way to "go back" and add things to the result
                          tree ... template rules are construction rules and you must always
                          construct the result tree in a single pass, even if that requires you to
                          pass over your source file many times to do so.

                          >Here the the XSL-code I used so far.
                          >...
                          > <fo:flow flow-name="xsl-region-body">
                          > <fo:block/>

                          Replace the above with your processing of the title page so that at this
                          point where you are constructing your XSL-FO result tree, you include the
                          XSL-FO of the title page.

                          > <fo:block break-before="page"/>
                          > <!-- create the table of contents -->
                          >...

                          I hope this helps.

                          ................................ Ken

                          p.s. if you are interested in XSL training, we hope to announce in a few
                          days some upcoming training in either Bremen, Hannover or Hamburg ...
                          somewhere in the north of Germany ... please keep an eye on our home page
                          for details.


                          --
                          North America (Washington, DC): 3-day XSLT/2-day XSL-FO 2004-03-15
                          Instructor-led on-site corporate, government & user group training
                          for XSLT and XSL-FO world-wide: please contact us for the details

                          G. Ken Holman mailto:gkholman@...
                          Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
                          Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
                          ISBN 0-13-065196-6 Definitive XSLT and XPath
                          ISBN 0-13-140374-5 Definitive XSL-FO
                          ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
                          ISBN 1-894049-11-X Practical Formatting Using XSL-FO
                          Member of the XML Guild of Practitioners: http://XMLGuild.info
                          Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
                        Your message has been successfully submitted and would be delivered to recipients shortly.