in-app PDF conversion - alternatives

I don’t think there’s a way for a non-Enterprise user to create a PDF in-app. I was wondering if there’s an alternative approach that can provide the following:

The screen consists of a form - several text fields, and a rectangular area at the bottom containing a signature

Normally I’d like to send an email with a PDF attachment containing this form , that can be printed out nice and neatly.

Is there a way to implement this without in-app conversion to PDF ? For example, what form would the attachment take, if it wasn’t an easy to print PDF?

Just thought I’d ask the question, as we probably won’t see in-app PDF conversion appear any time soon, for non-Enterprise users. Enterprise is way out of my budget.

Incidentally, I DON’T wish to use server-side code to solve this. It adds an extra level of reliability/cost/maintenance to the equation. I’d prefer to keep it all in-app.

You could populate the image and filled-in fields in the same layout as your required PDF, capture the screen at high-resolution and send the JPEG/PNG file that way.

While not that interesting, it most likely would be one of the more simple ways without using server code.

I think I may be over-thinking this. Is there any reason I can’t send an email from the app, constructed purely of HTML / CSS ? The app would allow the user to “draw” a signature onto the tablet and the app would save this as a png and include it in the HTML / CSS?

That’s possible isn’t it?

I don’t see why you couldn’t do that. I wasn’t sure if your need for the PDF standard was due to having a file type that technically wasn’t “editable”, so if it isn’t, you should be all set with that solution.

Thank you. I’ll give it a try.

Also, don’t let my sweet avatar fool you. I am far from an expert. If you give it a few days you might get more nuanced response from one of our certified-genius Corona devs.

Panc is correct.

You can insert images from your corona project (or images you have generated from your code) into your html.

If you get stuck i can post some sample code. If you reply to this message, I’ll see it in my inbox in the morning and that will remind me.

Cheers

Thank you.

Not, to mention your name conjures happy memories from my childhood! Can’t beat a bit of Monty Mole!

Indeed, my company aims to carry on the great name.

As for the code, i completely forgot about this…

But here it is. You first have to get the full path to the file, like so:

local imagePath = system.pathForFile( "yourImage.png", system.DocumentsDirectory )

You would then do something like this (when writing out your html to a file) to generate a valid image tag:

"\<img src=" .. imagePath .. "\>"

That would show your image in a html page, when you write that out to a file (using lua’s io library if course)

Hope this helps

Thank you, that’ll give me a head start.

You could populate the image and filled-in fields in the same layout as your required PDF, capture the screen at high-resolution and send the JPEG/PNG file that way.

While not that interesting, it most likely would be one of the more simple ways without using server code.

I think I may be over-thinking this. Is there any reason I can’t send an email from the app, constructed purely of HTML / CSS ? The app would allow the user to “draw” a signature onto the tablet and the app would save this as a png and include it in the HTML / CSS?

That’s possible isn’t it?

I don’t see why you couldn’t do that. I wasn’t sure if your need for the PDF standard was due to having a file type that technically wasn’t “editable”, so if it isn’t, you should be all set with that solution.

Thank you. I’ll give it a try.

Also, don’t let my sweet avatar fool you. I am far from an expert. If you give it a few days you might get more nuanced response from one of our certified-genius Corona devs.

Panc is correct.

You can insert images from your corona project (or images you have generated from your code) into your html.

If you get stuck i can post some sample code. If you reply to this message, I’ll see it in my inbox in the morning and that will remind me.

Cheers

Thank you.

Not, to mention your name conjures happy memories from my childhood! Can’t beat a bit of Monty Mole!

Indeed, my company aims to carry on the great name.

As for the code, i completely forgot about this…

But here it is. You first have to get the full path to the file, like so:

local imagePath = system.pathForFile( "yourImage.png", system.DocumentsDirectory )

You would then do something like this (when writing out your html to a file) to generate a valid image tag:

"\<img src=" .. imagePath .. "\>"

That would show your image in a html page, when you write that out to a file (using lua’s io library if course)

Hope this helps

Thank you, that’ll give me a head start.