class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
upload_files = self.get_uploads('File')
blob_info = upload_files[0]
fotos = FOTO()
fotos.link = blob_info.key()
fotos.Tlink = images.get_serving_url(fotos.link, 94)
fotos.Glink = images.get_serving_url(fotos.link, 800)
fotos.put()
from google.appengine.api import conversion
# Create a conversion request from HTML to PNG.
asset = conversion.Asset("text/html", "<b>some data</b>", "test.html")
conversion_obj = conversion.Conversion(asset, "image/png")
result = conversion.convert(conversion_obj)
if result.assets:
# Note: in most cases, we will return data all in one asset.
# Except that we return multiple assets for multiple pages image.
for asset in result.assets:
doSomethingWithAsset(asset.data)
else:
handleError(result.error_code, result.error_text)
Jeff
> --
> 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/-/BDSZMmVUHJAJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
You must use the Files API to write the generated image to the blobstore.Jeff
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
Hi Mike,
I'm sorry but the conversion Api doesn't work. I'm working on a alternative way, but appengine is facing big problem with the PDF management.
Max
--
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/-/CAg65cARtncJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
class FAX(db.Expando):
date = db.DateTimeProperty(auto_now_add=True)
class LogSenderHandler(InboundMailHandler):
def receive(self, mail_message):
for elemento in mail_message.attachments:
asset = conversion.Asset("application/pdf", str(elemento[1]), "Fax.pdf")
conversion_obj = conversion.Conversion(asset, "image/png")
result = conversion.convert(conversion_obj)
for elemento2 in result.assets:
fax = FAX()
fax.immagine = elemento2.data
fax.put()
def main():
application = webapp.WSGIApplication([LogSenderHandler.mapping()], debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == '__main__':
main()