Hi,
I'm trying to develop a service where I get a pdf from an email and I store 
it in the blobstore as a png.
The code is not working, but I have no error logs. I can't understand why.
The logic is:
I get the email -> Conversion from PDF to PNG -> Store in the blobstore 
(and in a database to work with the files).
Where is the problem with the code? Someone could help me?
I mixed my knowledge with the Appengine guide.

class LogSenderHandler(InboundMailHandler):
    def receive(self, mail_message):
        for elemento in mail_message.attachments:
            asset = conversion.Asset("application/pdf", str(elemento[1]), 
"test.pdf")
            conversion_obj = conversion.Conversion(asset, "image/png")
            result = conversion.convert(conversion_obj)
            if result.assets:
                for asset in result.assets:
                    file_name = 
files.blobstore.create(mime_type='application/octet-stream')
                    with files.open(file_name, 'a') as f:
                        f.write(asset)
                    files.finalize(file_name)
                    blob_key = files.blobstore.get_blob_key(file_name)
                    fax = FAX()
                    fax.link = blob_key
                    fax.Tlink = images.get_serving_url(fax.link, 94)
                    fax.Glink = images.get_serving_url(fax.link, 800)
                    fax.put()

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/qYUXSZripjAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to