RE: FOP Extension to handle Wiki Syntax

2011-06-15 Thread Theresa Jayne Forster
We see what you are trying to do,  what would be probably better rather than 
creating an extension, 
How about a more helpful / generic pre-processor 

Wiki -- XML
And then you can add your own pre-processor extensions to say add 
BBCode-XML

Then you can use your wiki-XML to change the wiki page into a valid XML 
document to be transformed into FO by xsl and then to pdf.

Example:
**this is a header**   --  para style=header2this is a header/para


Kindest regards


Theresa Forster
Senior Software Developer



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Table cell not wrapping - how to insert zero width space?

2011-06-15 Thread Chetan Shirol
I came to know from the other discussion forum that table cell text not wrapping
can be solved by inserting zero width space. 

I want to know how to implement this and if there is any example then it will
help. Please note that the text to be put in PDF in our case is dynamic.

Thanks in advance.

Regards,
Chetan V S


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Table cell not wrapping - how to insert zero width space?

2011-06-15 Thread Rob Sargent

Or maybe hyphenation.  Working well for me.

Cheers,


On 06/15/2011 08:42 AM, Chetan Shirol wrote:

I came to know from the other discussion forum that table cell text not wrapping
can be solved by inserting zero width space.

I want to know how to implement this and if there is any example then it will
help. Please note that the text to be put in PDF in our case is dynamic.

Thanks in advance.

Regards,
Chetan V S


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP Extension to handle Wiki Syntax

2011-06-15 Thread kalgon

Thanks for your answer,

Today, I made a working prototype with Saxon by using 
http://www.saxonica.com/documentation/extensibility/integratedfunctions.xml
ExtensionFunctionCall s. It's a bit complicated since Saxon-HE 9.3 (or was
it 9.2?) dropped support for calling static java methods from the
stylesheet. It's also a pity that javax.xml.transform API does not provide a
standard way to register additional functions, I will have to make specific
extensions for Xalan AND Saxon and usage within stylesheets will differ too
based on the transformer library you will use.

Well, I know those problems are not directly related to FO(P) but I just
wanted to rant a bit about it.

Regards,

Kalgon


Andreas L. Delmelle wrote:
 
 On 14 Jun 2011, at 16:46, Glenn Adams wrote:
 
 You know, given the time spent answering questions about XSL and the
 XML+XSL - XSL-FO front-end (convenience mechanism) in FOP, I sometimes
 wonder if it would be better to rip out that function. Perhaps then folks
 would understand better that FOP is fundamentally an XSL-FO - output
 format processor.
 
 FOP did start that way, if I recall correctly. There was a time when
 including the possibility to feed XML+XSLT as input was considered a big
 win. I actually think going back makes little sense, especially given that
 the usage pattern for embedding is basic JAXP. Even if you feed FOP plain
 FO, an identity transformation is used nowadays, also when invoking via
 the CLI.
 Way back when, using the CLI with plain FO actually did not use the XSLT
 processor at all, just the XML parser.
 
 Another point would be that XSL-FO itself defines nearly all its examples
 in terms of XSLT that transforms semantic XML to FO... *shrug* 
 It is easy to see how newcomers get confused. Ultimately, we could just
 respond with a link to the website, where it is darn' well explained what
 the recommended practice is in case of problems (i.e. submit FO, not XSLT;
 if the problem is XSLT, go to Mulberry etc.). 
 Nonetheless, I'll probably never get tired of pointing it out to people
 --even if they do seem to lack the most basic web browsing skills
 sometimes... ;-)
 
 On 14 Jun 2011, at 12:09, kalgon wrote:
 
 snip /
 What I would like to know is how I can build a tree of FONodes (blocks,
 text, table...) programmatically while parsing my wiki text and feed that
 tree to the FOP engine. I've been looking at ElementMapping, XMLHandler
 and
 the likes but I can't get a good grip at how those are working.
 
 If somebody could point me to a good and complete tutorial on FOP
 extensions
 or send me a nice example of how to do it, that would help me a lot!
 
 In this particular case, I would agree with the assessment that a FO
 extension would not be the most efficient/productive choice. While I can
 explain how to insert a new Block into the stream, I still would not
 encourage it. The quick and dirty approach, with probably the highest
 probability of success, would be to just send the appropriate SAX events
 back to the FOTreeBuilder.
 So, your code would have to be full of:
 
 Attributes myAttrs = new AttributesImpl();
 myAttrs.addAttribute(, font-weight, font-weight, CDATA, bold);
 ...
 builder.startElement(FO_URI, block, fo:block, myAttrs);
 ...
 builder.endElement(FO_URI, block, fo:block, myAttrs);
 
 I am not entirely certain it will always work, but I don't immediately see
 another way that would cheaply allow you to get potential property
 inheritance right, or have your content behave properly if it is contained
 in a fo:marker...
 
 This shows that FOP's API simply isn't designed with that in mind.
 Internally, it is meant to parse formatting objects from XML source. FO
 extensions only allow you to go so far. The extension mechanism is mainly
 meant to allow you to handle custom, foreign XML (= non-FO, e.g. to plug
 in a handler for your custom child object of fo:instream-foreign object;
 prime examples SVG, MathML, Barcode4J...). Translating flat text markup
 into FO (or more generally: XML), not so much.
 
 Don't get me wrong. I like the whole idea of being able to translate
 MediaWiki fragments directly into FO. Seems a very useful thing to have,
 however...
 
 Given the power of XSLT/XPath 2.0 to handle regex processing of unparsed
 text and consistent generation of valid XML(FO) nodes (even when the
 nesting levels get too difficult to follow for the human mind and its
 programming logic), this seems like THE weapon of choice for such a job.
 With a bit of imagination, one can easily keep this generic enough to work
 for a multitude of source XMLs. Just write a small stylesheet library to
 translate arbitrary MediaWiki markup into the corresponding FO syntax, and
 plug it into the main stylesheet. Sequences and xsl:functions are truly
 powerful stuff!
 
 If you feel generous, make it publicly available for everyone to try
 out/correct/extend... I'm quite sure it will get all the attention it
 deserves. We would gladly link to it from our website 

Re: Complex Script Support

2011-06-15 Thread Simon Pepping
I am pleased to inform you that Glenn Adams updated his work with a
new patch. This patch includes the following:

* bug fixes
* new layout engine tests for right-to-left writing mode
* new generic indic script processing support
* new devanagari script processing support

See milestone Patch 4 at http://skynav.trac.cvsdude.com/fop/report/6 for
further details.

The update has been imported into FOP's code in the
Temp_ComplexScripts branch. The new code is available at the URLs
cited below.

You can download the binary distribution or the fop jar file from
http://people.apache.org/~spepping/.

You can check out the source code from FOP's subversion repository,
http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts.

You can follow the work at FOP's Bugzilla, bug nr. 49687,
https://issues.apache.org/bugzilla/show_bug.cgi?id=49687.

Simon Pepping

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Problems with FOP and image

2011-06-15 Thread Oscar.Flores

Hi thanks for the help yeah i haven see that its was .java and not .class, ok
then if i follow correctly what you are saying then it has to be something
like this 

BufferedImage newImage = new BufferedImage (C:\Logo.jpg)
ImageIO.write(BufferedImage, JPEG, jpegImageFile) jpegImageFile will be
the XML call rigth something like C:\Logo.jpg)

and another thing 

  Warning(1979/26): fo:table, table-layout=auto is currently not supported
by FOP 
but in my xslt it ike this fo:table table-layout=fixed width=100%  so
i dont now what its causing the ploblem

 

Rob Sargent-4 wrote:
 
 
 
 On 06/14/2011 11:06 AM, Oscar.Flores wrote:
 Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment is
 just
 Having the file in the ...sources.jar won't do the runtime world much 
 good. You need the jar of .class files for jai-imageio, not .java files
 windows xp, and the bufferedImage will be the path of the image??
 No, the bufferedImage is an in-memory instance of BufferedImage holding 
 the bits of the image.  In the case that you have to read it from one 
 place and write it to another.
 Rob Sargent-4 wrote:
 Did you go through all your jars looking for  'CLibJPEGImageReaderSpi'.
 My greatest suspicion is that you don't have all your jars lined up.
 Which jar(s) do you think supplies these?

 What is your environment: just windows or do you have any tools like
 cygwin?

 The jpegImageFile would be the filename in your xsl the
 external-resource.  If you're just using a file that is already in place
 you don't have to re-write it.



 On 06/14/2011 08:29 AM, Oscar.Flores wrote:
 No i dont, and that weird jejeje netbeans seems to do that for me, so
 the
 calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i
 have
 to
 do it in every image that i put in the pdf?? and the image is gererate
 directly in the pdf??how can i do it??

 Rob Sargent-4 wrote:
 Some jar to which netbeans has access has those classes.  Look in the
 output of jar tvfeach of your jars   and see if any of those has the
 named classes.  If you find a jar with those classes make sure it's
 part
 of your classpath for you app.

 Are you making any calls like ImageIO.write(BufferedImage, JPEG,
 jpegImageFile)?

 On 06/13/2011 05:31 PM, Oscar.Flores wrote:
 ok i made a test and tell me that the class is missign but maybe what
 you
 say
 its rigth and it register the handler
 so i gonna register the services so i do this

 public static void main(String[] args) throws Exception {
 DOMConfigurator.configure(D:/Mis
 documentos/NetBeansProjects/Factura/src/factura/log4j.xml);
 logger.info(Entering application.);

 IIORegistry.getDefaultInstance().registerServiceProvider(new
 CLibJPEGImageReaderSpi());

 IIORegistry.getDefaultInstance().registerServiceProvider(new
 CLibJPEGImageWriterSpi());

 also after register my services it telling me that the class
 CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but
 only
 in
 command

 after register mi service, something more has to be done??


 Rob Sargent-4 wrote:
 I'm not sure I'm following correctly: does removing the xmlgraphics
 jar
 cause netbeans to behave the same as the command-line run of you
 app?
 If
 so, I suspect netbeans is registering services for you.  Your own
 code
 will have to make a call to one of the
 IIORegistry.registerServiceProvider() methods.

 On 06/13/2011 05:02 PM, Oscar.Flores wrote:
 Ok  i get it, actually the ImageIO library i added because i
 read
 in
 the
 xmlgrapics that if something like the message
 org.apache.xmlgraphics.image.loader.ImageException: Cannot load
 image
 (no
 suitable loader/converter combination available)appear i have to
 add
 the
 jar
 file to the classpath but that all it say no configuration or
 anything,
 then
 i delete the imagenIO libs and still i have the same output in
 netbeans
 so
 xmlgrapics seem to have the problem in the plugins or i have to
 configure
 something

 Rob Sargent-4 wrote:
 Then it seems to me netbeans (if it's producing good output ==
 assumptionA) is still using something that the command-line isn't.

 And given assumptionA, you're java code is correct in terms of FOP
 and
 your configuration isn't for ImageIO.  Show your ImageIO related
 code
 and are you sure it's in your app.  Use the logger to show a
 message
 when you add  your loader.  Or list all ImageIO services:
 IIORegistry.getServiceProviders()

 On 06/13/2011 03:01 PM, Oscar.Flores wrote:
 ok well i put the xml in scr of my proyect i see that i still
 have
 the
 same
 issues of the image render of any image i dont now if the xml its
 in
 place i
 put the code down to see if something its missing

 15:45:07,827 ERROR [render] Error while processing image:
 c:\cfd\nombregp.bmp (i
 mage/bmp)
 org.apache.xmlgraphics.image.loader.ImageException: Cannot load
 image
 (no
 suitab
 le loader/converter combination available) for
 c:\cfd\nombregp.bmp