Hi, I think the way to go about that is to use a PDF post-processor that would convert the PDF into plain text.
Checkout the pdftotext utility commonly found on Linux-based systems (formerly developped within Xpdf [1], now taken over by Poppler [2]). [1] http://www.foolabs.com/xpdf/download.html [2] http://poppler.freedesktop.org/ Otherwise, typing “pdf to text” in your favourite web search engine should give you plenty of results. HTH, Vincent fopit wrote: > No, really, plain-text file. > > You're right, I should have done it before. > So, here's a part of the code, in fact, the first part of it : > > > <xsl:import href="include/ds-documents-util.xslt" /> > <xsl:import > href="../../../etc/reports-xsl/css-xslt/ds-documents-bin-css.xslt" /> > <xsl:output method="xml" indent="yes"/> > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > <xsl:template match="document"> > <xsl:variable name="uri" select="concat($parameter,'_',@number,'.fo')"/> > <exsl:document href="{$adressfo}/{$uri}" method="xml"> > <fo:root> > <fo:layout-master-set> > <fo:simple-page-master master-name="page" margin="2cm" > xsl:use-attribute-sets="height" > > <fo:region-body margin="7cm 0 1.5cm 0" /> > <fo:region-before extent="7cm" /> > <fo:region-after precedence="true" extent="1cm" /> > </fo:simple-page-master> > </fo:layout-master-set> > <fo:page-sequence master-reference="page" line-height="1.5em"> > <fo:static-content flow-name="xsl-region-before"> > <fo:table width="100%" table-layout="fixed"> > <fo:table-column column-width="70%" /> > <fo:table-column column-width="30%" /> > <fo:table-body> > <fo:table-row> > <fo:table-cell number-columns-spanned="2"> > <fo:block xsl:use-attribute-sets="imageWhere > fontEnTete"> > <fo:external-graphic src="{$logo}" > xsl:use-attribute-sets="imageSize"/> > </fo:block> > </fo:table-cell> > </fo:table-row> > [..] > </fo:table-body> > </fo:table> > </fo:static-content> > <fo:static-content flow-name="xsl-region-after"> > [another table with a > apply-templates] > </fo:static-content> > <fo:flow flow-name="xsl-region-body"> > <fo:block> > <xsl:call-template name="entete"/> > </fo:block> > [some other calls the same way] > </fo:flow> > </fo:page-sequence> > </fo:root> > </exsl:document> > </xsl:template> > > And, there, are the templates, matches and names. > I think this are quite classical, in fact. > > So, thank you for yours answers, Georg > > > Regards > > > > Georg Datterl wrote: >> Hi fopit, >> >> I see. Instead of rendering a pdf you want a text file. Or RTF? I think, I >> read something lately about discontinuing the rtf functionality because >> nobody uses it, but I leave the topic to the experts, since I only render >> to pdf. Maybe you could post a shortened fo file and the text file so the >> experts can actually see what's wrong. >> >> Regards, >> >> Georg Datterl >> >> ------ Kontakt ------ >> >> Georg Datterl >> >> Geneon media solutions gmbh >> Gutenstetter Straße 8a >> 90449 Nürnberg >> >> HRB Nürnberg: 17193 >> Geschäftsführer: Yong-Harry Steiert >> >> Tel.: 0911/36 78 88 - 26 >> Fax: 0911/36 78 88 - 20 >> >> www.geneon.de >> >> Weitere Mitglieder der Willmy MediaGroup: >> >> IRS Integrated Realization Services GmbH: www.irs-nbg.de >> Willmy PrintMedia GmbH: www.willmy.de >> Willmy Consult & Content GmbH: www.willmycc.de >> -----Ursprüngliche Nachricht----- >> Von: fopit [mailto:[email protected]] >> Gesendet: Mittwoch, 30. September 2009 16:53 >> An: [email protected] >> Betreff: Re: AW: Text rendering with FOP >> >> >> Hello Georg, and thank you for answering, >> >> In fact, that's not exactly what I want. >> I explain : >> I have indeed an XML file, and an XSL file, that create an FO file, which >> I use to create a PDF, with FOP. Without any problem. >> >> But I want to use the same XSL file, and so, the same FO file, to create a >> plain-text document, that will be a kind of a viewer of the PDF for the >> user. >> And using FOP is not a success, for I only have what correspond to the >> beginning of my PDF. >> >> To resume, I want, from the same XSL, to have a PDF and a plain-text >> documents, where the plain-text is not as "beautiful" as the pdf. I >> successly create the pdf, but, in the text-version, I only have the >> beginning of it. >> >> Is it clearer? >> Thanks >> >> >> Georg Datterl wrote: >>> Hello fopit, >>> >>> I'm not sure I understand what you want. Let me rephrase and tell me, >>> if I'm correct: >>> >>> * You have an XML file and a XSL file and generate PDFs. >>> * You want to generate a PDF, where only the first few lines of a text >>> are displayed >>> * You want to use the same XML file and the same XSL file >>> >>> If that is correct, you can reuse your XML file, but need a slightly >>> different transformation in which the text is shortend. That's not >>> correct xsl code, but in place of >>> <fo:block>$variable_holding_long_text</fo:block> >>> you would need a <fo:block>substring($variable_holding_long_text, 1, >>> $variable_holding_number_of_characters_to_display</fo:block> >>> >>> Regards, >>> >>> Georg Datterl >>> >>> ------ Kontakt ------ >>> >>> Georg Datterl >>> >>> Geneon media solutions gmbh >>> Gutenstetter Straße 8a >>> 90449 Nürnberg >>> >>> HRB Nürnberg: 17193 >>> Geschäftsführer: Yong-Harry Steiert >>> >>> Tel.: 0911/36 78 88 - 26 >>> Fax: 0911/36 78 88 - 20 >>> >>> www.geneon.de >>> >>> Weitere Mitglieder der Willmy MediaGroup: >>> >>> IRS Integrated Realization Services GmbH: www.irs-nbg.de >>> Willmy PrintMedia GmbH: www.willmy.de >>> Willmy Consult & Content GmbH: www.willmycc.de >>> -----Ursprüngliche Nachricht----- >>> Von: fopit [mailto:[email protected]] >>> Gesendet: Mittwoch, 30. September 2009 16:03 >>> An: [email protected] >>> Betreff: Text rendering with FOP >>> >>> >>> Hello there >>> >>> First of all, as english is not my natural tongue, i beg you to excuse >>> faults or nonsense that would eventually come. >>> >>> I'm using FOP to create PDF from XML. Nothing particular, and it works >>> great. >>> But I also want to use it - and the same XSL-FO - to create a text >>> from the XML, a simple viewer of the PDF for final users, and there, >>> problems begin : >>> it's like having a very size-limited buffer, only the beginning of my >>> text is render. >>> >>> I read here and there that fop wasn't the best thing to do >>> text-rendering, but, really, I just want a viewer, nothing complicate or >>> fancy. >>> >>> So, I wonder, why do fop render me only the beginning of my text, and >>> is there anything to do to change that? >>> >>> Thanks >>> -- >>> View this message in context: >>> http://www.nabble.com/Text-rendering-with-FOP-tp25681687p25681687.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/Text-rendering-with-FOP-tp25681687p25682690.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] >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
