Generate PDF in Play Framework Scala - scala

I'm using Play framework 2.2.x and I'm looking for some plugin/lib for generating PDF.
I found this plugin:
https://github.com/joergviola/play20-pdf,
but it's for Java and is not supported already
Do u know some repository with this library? Or some alternatives for Scala and Play Framework?
=== Update
I found some fork, but still no working repository
https://github.com/alias1/play2pdf

Try this one https://github.com/Kaliber/scala-pdf. It is really easy to use, and you can define your own css or even use bootstrap.

This seems to be a very good solution : https://github.com/cloudify/sPDF
Otherwise, I highly recommend http://www.html2pdf.it/

Well javascript can be easy solution . You can use jspdf .

Related

Generating Captcha code in play framework with scala

I want to generate Captcha code in play framework with scala.
Please tell me how to solve this problem, I am not able to find the Image.captcha in my play.libs._ package.
I suppose you are talking about play.libs.Images which is relevant for Play framework 1.x only. Play framework 2.x has no built in captcha-generating mechanism so you should use some external captcha generators.
Consider reading this post: How to use Captcha in Play Framework 2.1.3

RichTextToolbar in GWT 2.3

I'm trying to create a RichTextArea (following the GWT Showcase : link )
When I do a code completion of RichTextToolbar, I'm not able to find it. Is this an external library?
And then I googled and found this : google code link. Is this the same library in the Google Showcase? Or is the RichTextToolbar is an old implementation that not being brought to version 2.3?
Update:I tested this and what I feel is although the implementation the same, the UI looks different though.
It seems that they created their own version of RichTextToolbar.
This class is part of the GWT Showcase.
Here is a decent explanation to get the RichTextToolbar working. You take the source code from showcase basicaly.
http://www.jeanhsu.com/2010/06/10/how-to-use-richtexttoolbar-in-gwt/

How to use omnigroup framework in an iOS project?

I need to be able to write and read from a rtf file in iOS.
The omnigroup framework has the 2 classes i am looking for :
OmniUI/iPad/RTF/OUIRTFReader
OmniUI/iPad/RTF/OUIRTFWriter
I managed to build the frameworks but i cant figure out how to integrate theses classes in my own project.
I had the following frameworks to my project :
OmniAppKit.framework
OmniFoundation.framework
OmniBase.framework
I still get some undefined identifier such as :
RCS_ID("$Id$");
OBINITIALIZE
OMNI_POOL_START
Has anybody been able to use the omnigroup framework in your own project ?
Thanks,
Vincent
We do need some better documentation for this, but the TextEditor example app in OmniUI/iPad/Examples/TextEditor may be a good starting point for seeing how we include the frameworks in our apps.
In this particular case, you may prefer to pull out the OUIRTFReader class and any dependencies it needs from OmniAppKit and OmniFoundation into your project. updating the #imports to be "..." instead of <OmniThis/AndOmniThat.h>.
Perhaps you could try following the instructions given as part of this thread on the Omni Group forums. They appear to have been able to build the framework under the iOS 4.2 SDK.
I don't think you want the OmniAppKit framework, as that is just for the Mac.

GWT RequestFactory examples?

Do you know where i can find some code examples for the new GWT 2.1 RequestFactory? Google's tutorial is not good enough to begin with.
please check this
http://javaasylum.blogspot.com/2010/11/gwt-21-request-factory.html
and from googler :
https://wave.google.com/wave/?pli=1#restored:wave:googlewave.com!w%252BWU4iAICkI.1
And written in 2011 there are these tutorials which use ServiceLocators and show how to split the server side code using DAOs.
http://cleancodematters.wordpress.com/2011/06/04/tutorial-gwt-request-factory-part-i/
http://turbomanage.wordpress.com/2011/03/25/using-gwt-requestfactory-with-objectify/
Have a look at the DynaTableRf sample from a GWT 2.1 distribution.
Here is the Simple example for Gwt Request Factory...
code is here
AND WORKING URL IS
here

What is the use GWT generator?

I have seen that GWT framework is having generator feature.
In what case we have to use gwt generator option and why it is needed?
Can anyone tell me simply why,what is gwt generator? Done some googling. But not much helpful stuffs...
From this tutorial:
Generators allow the GWT coder to generate Java code at compile time and have it then be compiled along with the rest of the project into JavaScript.
This tutorial uses the example of generating a Map of values at compile time based on a properties file.
I've done GWT development for 3 years now and I've written one generator :) I've written a couple of linkers for experimental purposes so I think they are more common, though still rare. The classic case is where you want to write
X x = GWT.create(X.class)
and have the particular subclass or implementation of X constructed at compile time based on, perhaps, annotations in the provided X class or interface. GWT uses them for things like the CSSResource.
Search for "GWT Generator Experiments" site:development.lombardi.com on google for some info about what I did.
One of the use cases is to mimic reflection on the client side by building a factory class on the fly. I remember answering a question posted by you earlier on how to do this
How to create new instance from class name in gwt?
So i guess you already know the application. What else are you looking for? Can you be precise?
I've started using GWT Generators where I needed Java Reflection. I've documented One of the use cases for using GWT generators here:
http://jpereira.eu/2011/01/30/wheres-my-java-reflection/
Hope it helps.
If you refer to code generator, yes, there will a tool supporting GWT 2.1 code generation. For more details and a quick start, see http://www.springsource.org/roo/start
A general roo intro is here http://blog.springsource.com/2009/05/01/roo-part-1/
Another visual tutorial is at http://www.thescreencast.com/2010/05/how-to-gwt-roo.html
Check out this implementation:
http://samuelschmid.blogspot.com/2012/05/using-generator-for-generic-class.html
You can create new Instances of classes on client with foo.newInstance("fully.qualified.class.name");