pdfcrowd/pdfcrowd-python

nginx issue

Closed this issue · 2 comments

hello,

I´m trying to generate a pdf using the stable API

import pdfcrowd

try:
    # create an API client instance
    client = pdfcrowd.Client(my user, myKey)

    output_file = open('html.pdf', 'wb')
    html="<head></head><body>My HTML Layout</body>"
    client.convertHtml(html, output_file)
    output_file.close()

except pdfcrowd.Error, why:
    print('Failed: {}'.format(why))

but I´m getting the following error

Failed: 301 - <html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

but using the API beta and the following code

import pdfcrowd
 try:
  # create the API client instance
  client = pdfcrowd.HtmlToPdfClient("*****", "*****")

     # run the conversion and write the result to a file
     client.convertStringToFile('<html><body><h1>Hello World!</h1></body></html>', 'HelloWorld.pdf')
 except pdfcrowd.Error as why:
     print 'Failed:', why

it works. I need to use the stable API because the beta API has some restrictions at the moment, any suggestions?

thank you so much

Hi,

Thanks for reporting the issue. This should be fixed now in 4.0.1. Could you please try again and let me know if it helps? Thank you.

Solved in 4.0.1