create a PDF faster??

179 views
Skip to first unread message

Der_V

unread,
Mar 6, 2011, 11:59:38 AM3/6/11
to play-framework
Hey,

I try out PDF-module in play! It's easy to install (with the info to
use eclipsify again, perhaps it should be in the documentary at the
play-homepage) and easy to use!
But there is a big BUT... It takes over a minute to create a PDF-doc
from only one little Template...Ok, there are some styles an grafics
in it... but I'm shocked, that it took soooo long.

Is there any better way to convert an play-Template into a pdf-doc or
a way to convert the template much faster??

I've got an other question. I used the method writePDF. The first
parameter ist the new File I want to create, but i didn't see the
possibilty to tell the class which template it has to use. It looks
after the default-Template (class/method). How can i tell the method,
which template it has to convert??

Thanks for the answers! :)
Greetz
V

Nicolas Leroux

unread,
Mar 6, 2011, 12:07:48 PM3/6/11
to play-fr...@googlegroups.com, play-framework
Hi,

I am due to release a new version, this issue has been fixed. In fact the lib
we are using is validating using a dtd that does not exist anymore at the w3c.org web site and thus time out...


Nicolas Leroux
he

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

Der_V

unread,
Mar 6, 2011, 12:14:38 PM3/6/11
to play-framework
Thank's for the realy fast answer!!!
I'm looking forward to the new version and hope that it's as fast as
your answer ;)

And how can I tell which template should be converted?

Have a nice day!
Greetz
V

On 6 Mrz., 18:07, Nicolas Leroux <leroux.nico...@gmail.com> wrote:
> Hi,
>
> I am due to release a new version, this issue has been fixed. In fact the lib
> we are using is validating using a dtd that does not exist anymore at the w3c.org web site and thus time out...
>
> Nicolas Leroux
> he

Nicolas Leroux

unread,
Mar 6, 2011, 4:46:48 PM3/6/11
to play-fr...@googlegroups.com
Hi,

I have put a new version. Can you try to upgrade and tell me if that works better?
(play install again).

Thanks,

Nicolas

Der_V

unread,
Mar 7, 2011, 1:22:54 AM3/7/11
to play-framework
Hey Nicolas,

I installed the new versions. It's much faster. Not realy super fast,
but's ok. I will doing some tests with bigger Templates in the
evening...

Can you tell me, how i can tell the class, which template it should
use when it want to write a PDF-file? Or am i Doing something wrong?
Thanks for all your work!!!

Greetz
V

Der_V

unread,
Mar 7, 2011, 12:40:27 PM3/7/11
to play-framework
Hey,

I have to correct my last post... it's realy fast :) It try out some
bigger templates and it's realy a good time!!

Thank you very much!!! :D

I still need an idea to tell the method writePDF(), which template it
has to use!!!
Greetz
V

robfig

unread,
Mar 7, 2011, 10:12:54 PM3/7/11
to play-framework
Both renderPDF and writePDF follow the same convention as the usual
Controller methods.

class Application extends Controller {
public static showInvoice() {
renderPDF();
}
}

will look for app/views/Application/showInvoice.html (writePDF does
the same, except it takes an OutputStream or File as the first
parameter).

You can also provide an explicit name, e.g

writePDF(outputStream, "Application/myPdf.html");

will render app/views/Application/myPdf.html.


Hope this helps,
Rob
Reply all
Reply to author
Forward
0 new messages