Print from webapp

Hi
I’m making a web app to help write a CV-type page.
The manual says "…use the simple MsgBox … or … dialog box by creating a WebDialog.

I want to show a preview, then open a standard print dialog - not possible?

Thanks.

It is possible, but you’ll have to lay out the page the way you want it to print. Make sure you use the correct dimensions (minus some space for margins) for the default paper size in the user’s region (Letter for U.S., A4 for Europe last time I checked). Just take the dimensions and multiply by 72 to get the full page size.

8.5x11 = 612x792

Page breaks are trickier. You can do them, but you’ll need to use HTML and CSS.

Yes - I’d like to format a single page for printing - bold text, font size, new paragraph etc.
But I can’t use “g as graphics” way. Not easy as most of the manual is for desktop.

[quote=320684:@Gary Dalal]Yes - I’d like to format a single page for printing - bold text, font size, new paragraph etc.
But I can’t use “g as graphics” way. Not easy as most of the manual is for desktop.[/quote]
You could if you place a webcanvas on the page.

How about creating a PDF document that you then make available for download to the user? You dispose of it after download.

Most everyone has one or another PDF reader, so that should generally work and do what you want. Depending on your specific needs, there are several options to generate a PDF on multiple platforms (the server platform).

I got to format text on the webcanvas - thanks! Nice to see it previewed before print. (PDF would be better? How would I format text etc to a PDF please?)

Also, once I have all my text on the webcanvas formatted is there a simple Print dialog for web? or I need to create one?!!

I routinely create formatted PDF documents, with included pictures, tables, etc. There are several options, I have used Debenu (I am walking away from it. It was acquired by FoxIT and is now outrageously expensive) and the MBS DynaPDF plugin. The MBS solution works on Mac, Windows, Linux and RaspberryPi. Take a look at the documentation. There are functions for pretty much anything you need to do to a PDF.

It is just one option. If you are happy with the webcanvas option, all the better.

Found this on a forum and put it on a button - it prints out the webcanvas (to printer or pdf)

ExecuteJavaScript “print();”

my gPDF class works with XOJO Web (as well as desktop and console apps)

http://www.rdS.com/gpdf/

due to technical difficulties… the demo isn’t available, but if interested, send me a PM and we can work out something :slight_smile:

Text looks good onscreen but when I print it’s pixelated (webcanvas is 595 x 842, A4 size).
I’ve tried making the canvas huge (3 times scaled up) - doesn’t improve. any ideas?
Is that why I need a plugin?
thanks, G