pombreda / xhtml2pdf

Automatically exported from code.google.com/p/xhtml2pdf
GNU General Public License v2.0
0 stars 0 forks source link

Pdf generation delays #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi everyone, I hope that someone can give us some help, then we will be
very pleased because his bothered us for many days.

We want to use pisa to convert xhtml files to pdf files, which we would
like to be returned immediately. 

However the problem is that when "pisa.CreatePDF(something)" ---- the code
finished running and the client side started to receive the generated file,
the actual file hadn't finished being generated yet (I can see the whole
process that it is from a unrecognised file to a pdf file in its
directory.). There is about 20 seconds delay from the code finished
running, the client start receiving pdf attachment to the actual file
really generated. No matter how big the size of the file is, the initial
time varies from 5 sec to 1 minute depends on its size but after the code
finished running (It said that it generated) there is always 20 seconds
overhead to complete the real file generation.

This is the code we wrote by using SOAP technology:

################################################################################
###################################################

Hi everyone, I hope that someone can give us some help, then we will be
very pleased because his bothered us for many days.

We want to use pisa to convert xhtml files to pdf files, which we would
like to be returned immediately. 

However the problem is that when "pisa.CreatePDF(something)" ---- the code
finished running and the client side started to receive the generated file,
the actual file hadn't finished being generated yet (I can see the whole
process that it is from an unrecognised file to a pdf file in its
directory.). There is about 20 seconds delay from the code finished
running, the client start receiving pdf attachment to the actual file
really generated. No matter how big the size of the file is, the initial
time varies from 5 sec to 1 minute depends on its size but after the code
finished running (It said that it generated) there is always 20 seconds
overhead to complete the real file generation.

This is the method we wrote:

def xhtml2pdf(request):

    pdf = newfilepath.replace(ext, 'pdf')
    pisa.CreatePDF(                       
        file(filepath),
        file(pdf, 'wb'),
        log_warn = 1,
        log_err = 1,
        path = filepath,
        #link_callback = pisa.pisaLinkLoader(filepath).getFileName
        )

    return HttpResponse(foo.data, mimetype = "application/pdf" )

If you need further details please don't hesitate to let me know.

Many thanks, guys!

Kind regards,

Joe

Original issue reported on code.google.com by zhuxiyu...@googlemail.com on 22 Oct 2009 at 10:40

GoogleCodeExporter commented 9 years ago
Some time ago Pisa AKA XHTML2PDF has been rereleased under the completely free 
Apache License. Since I personally don't have the time and resources to 
continue the project like before I would kindly ask you to fork the project on 
GitHub and add your patches etc. Maybe someone likes to create a new unified 
version and publish it on PyPI. If you need more help on this get in contact 
with me or write to the XHTML2PDF mailing list. Thank you all very much for 
your effort!

Project on GitHub:
http://github.com/holtwick/xhtml2pdf

Original comment by dirk.holtwick on 23 Aug 2010 at 5:27

GoogleCodeExporter commented 9 years ago
I have the same issue. Any news on that?

Original comment by tobias.f...@googlemail.com on 4 Nov 2014 at 2:20