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

[XSL-FO] problems with svg in FO

Expand Messages
  • Rolf Hustad
    I`ve been experiencing problems when using svg delivered from Adobe Illustrator 9.0 in xml documents using FOP to to produse the PDFs. I`m using FOP 0.18.1 DEV
    Message 1 of 4 , May 14, 2001
      I`ve been experiencing problems when using svg delivered from Adobe
      Illustrator 9.0 in xml documents using FOP to to produse the PDFs.
      I`m using FOP 0.18.1 DEV to produse the PDFs.
      First of all FOP requires the svg to to use xml namespace in the svg,
      which is a search and replace job, not a big deal but annoying. Then
      there is the font issue, FOP requires that you write the font in this
      manner:" font-family:Times Roman; " and of course the svg from AI 9.0
      deliveres this : " font-family:'Swiss721BT-Roman'; " and of course none
      of the fonts that are availiable in FOP, but then again it`s just a
      unnecessary but simple search and replace job.

      The Big problem comes when transforming a text matrix inside the svg to
      PDF using FOP.
      The SVG prodused from AI 9.0 looks the way it`s supposed to look in IE
      5.5 and netscape, but when the result comes out in the PDF file the text
      is screwed up. I`ve found out by doing some tests that redusing the
      value of the two last values in the text matrix to half their value, the
      svg turns out OK, but it`s a hell of jobb doing this manually. In
      addition the svg turn out bad in IE5.5 and netscape. This unables me to
      use same source of svg for web and paper rendition.
      This problem seems to be a fault in the way FOP handles textmatrixes.

      Is there anyone who has tried this and found a solution to these
      problems and has the time to help a little?
      I`ve attached some sample files of the problems I`ve described, the
      source xml file and the xsl file.

      Regards
      Rolf Hustad
    • Bryan Rasmussen
      Is there any reason you can t just batch process the svg put out by AI, use xsl:copy-of for the nodes that need to be copied and write out the nodes that need
      Message 2 of 4 , May 14, 2001
        Is there any reason you can't just batch process the svg put out by AI,
        use xsl:copy-of for the nodes that need to be copied and write out the nodes
        that need the xml namespace via template matching?
        (I'm assuming a use of saxon here)
        how about something like <xsl:choose><xsl:when test="\\svg:g\@style and
        (contains(string(), 'Swiss721BT-Roman') ">

        </xsl:when></xsl:choose>
        < for the second problem
        I'm not sure if that expression above would work right, since I'm writing
        this extempore, theat style attribute is selected wrong I think(been doing
        too much xql lately) maybe it should be test="\\svg:g[@style]", but if it
        did then I would suggest just using concat() to build your replacement
        string. and if that worked I guess it would probably be the same sort of
        thing for the big problem, with the addition of the format-number()
        function. might be able to do something like format-number(-50, #%) which if
        I remember the format-number syntax correctly should give you a result
        of -50%, if that was a variable somewhere then you could call it for the
        numbers of the text matrix.
        but don't take this as anything more than a suggestion for things to
        check out as possible solutions, we're in the area where any code coming off
        the top of my head is not going to be failure free.:)

        </xsl:template>
        -----Original Message-----
        From: Rolf Hustad [mailto:rolhusta@...]
        Sent: 14. maj 2001 10:38
        To: XSL-FO@yahoogroups.com
        Subject: [XSL-FO] problems with svg in FO


        I`ve been experiencing problems when using svg delivered from Adobe
        Illustrator 9.0 in xml documents using FOP to to produse the PDFs.
        I`m using FOP 0.18.1 DEV to produse the PDFs.
        First of all FOP requires the svg to to use xml namespace in the svg,
        which is a search and replace job, not a big deal but annoying. Then
        there is the font issue, FOP requires that you write the font in this
        manner:" font-family:Times Roman; " and of course the svg from AI 9.0
        deliveres this : " font-family:'Swiss721BT-Roman'; " and of course none
        of the fonts that are availiable in FOP, but then again it`s just a
        unnecessary but simple search and replace job.

        The Big problem comes when transforming a text matrix inside the svg to
        PDF using FOP.
        The SVG prodused from AI 9.0 looks the way it`s supposed to look in IE
        5.5 and netscape, but when the result comes out in the PDF file the text
        is screwed up. I`ve found out by doing some tests that redusing the
        value of the two last values in the text matrix to half their value, the
        svg turns out OK, but it`s a hell of jobb doing this manually. In
        addition the svg turn out bad in IE5.5 and netscape. This unables me to
        use same source of svg for web and paper rendition.
        This problem seems to be a fault in the way FOP handles textmatrixes.

        Is there anyone who has tried this and found a solution to these
        problems and has the time to help a little?
        I`ve attached some sample files of the problems I`ve described, the
        source xml file and the xsl file.

        Regards
        Rolf Hustad

        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • Bryan Rasmussen
        I started thinking about this last night about 11 o clock and I realized that there was probably a simple way to do this, it s a three step process, there s a
        Message 3 of 4 , May 15, 2001
          I started thinking about this last night about 11 o'clock and I realized
          that there was probably a simple way to do this, it's a three step process,
          there's a lot of programs out there that will convert text files to xml, I
          downloaded xml convert today from http://www.unidex.com/xflat.htm , can't
          say I'm a 100% thrilled but it demonstrates the idea.
          if you're using saxon you could use saxon:output to seperate the svg into
          an xml file and a text file, the text file contains your styles.
          you could then use one of these programs to generate xml-tags and output
          to an xml file, use the document()
          function to import the resultant xml into the third stylesheet, which
          handles everything else. I don't think xml convert is a good solution for
          this problem, but below is an example of how it works
          given a fragment as follows:
          fill-rule:nonzero;clip-rule:nonzero;stroke:#000000
          and a xml convert schema like this one:<?xml version='1.0'?>
          <XFlat Name="svg_styles" Description="CSV flat file">
          <SequenceDef Name="styles" Description="svg flat file">
          <RecordDef Name="style" FieldSep=";" RecSep="\n" MaxOccur="0">
          <FieldDef Name="field1" NullAllowed="No"
          MinValue="0"
          QuotedValue="Yes"/>
          <FieldDef Name="field2" NullAllowed="No"
          QuotedValue="Yes"/>
          <FieldDef Name="field3" NullAllowed="No"
          QuotedValue="Yes"/>
          </RecordDef>
          </SequenceDef>
          </XFlat>

          you receive back the following xml: <?xml version='1.0'?>
          <styles>
          <style>
          <field1>fill-rule:nonzero</field1>
          <field2>clip-rule:nonzero</field2>
          <field3>stroke:#000000
          </field3>
          </style>
          </styles>
          anyway thanks for the idea, it's got me interested in svg again.
          -----Original Message-----
          From: Rolf Hustad [mailto:rolhusta@...]
          Sent: 14. maj 2001 10:38
          To: XSL-FO@yahoogroups.com
          Subject: [XSL-FO] problems with svg in FO


          I`ve been experiencing problems when using svg delivered from Adobe
          Illustrator 9.0 in xml documents using FOP to to produse the PDFs.
          I`m using FOP 0.18.1 DEV to produse the PDFs.
          First of all FOP requires the svg to to use xml namespace in the svg,
          which is a search and replace job, not a big deal but annoying. Then
          there is the font issue, FOP requires that you write the font in this
          manner:" font-family:Times Roman; " and of course the svg from AI 9.0
          deliveres this : " font-family:'Swiss721BT-Roman'; " and of course none
          of the fonts that are availiable in FOP, but then again it`s just a
          unnecessary but simple search and replace job.

          The Big problem comes when transforming a text matrix inside the svg to
          PDF using FOP.
          The SVG prodused from AI 9.0 looks the way it`s supposed to look in IE
          5.5 and netscape, but when the result comes out in the PDF file the text
          is screwed up. I`ve found out by doing some tests that redusing the
          value of the two last values in the text matrix to half their value, the
          svg turns out OK, but it`s a hell of jobb doing this manually. In
          addition the svg turn out bad in IE5.5 and netscape. This unables me to
          use same source of svg for web and paper rendition.
          This problem seems to be a fault in the way FOP handles textmatrixes.

          Is there anyone who has tried this and found a solution to these
          problems and has the time to help a little?
          I`ve attached some sample files of the problems I`ve described, the
          source xml file and the xsl file.

          Regards
          Rolf Hustad

          To unsubscribe from this group, send an email to:
          XSL-FO-unsubscribe@egroups.com



          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • Rolf Hustad
          Thank you Bryan for your help so far. I`ll have something to work on now. I`ll probably send a mail to Adobe about the font problem and to Apache.org to see if
          Message 4 of 4 , May 15, 2001
            Thank you Bryan for your help so far.
            I`ll have something to work on now. I`ll probably send a mail to Adobe
            about the font problem and to Apache.org to see if they know about the
            problem with the "text matrix problem", since FOP should treat the text
            matrix the same way as IE or netscape.
          Your message has been successfully submitted and would be delivered to recipients shortly.