Hi all,
I'm only just now testing with HTML5 for a client (so a bit of a newbie to this side of LC) with the aim of porting their existing LC projects over to become WebApps (Win/Mac Desktop only). What would be the way to output PDFs from a series of cards generated in LC?
Currently, the desktop app gathers all the data to produce a report or proposal document over a series of cards which are added one by one to a pdf using the pdf library. But I understand that this library has not been converted for Emsripten usage.
So, perhaps there is a method using JS or similar that someone can give hints to outputting either a series of cards or snapshots or canvas areas for print via the print() js to the native Windows/Mac print dialogue for PDF creation. (??)
Thanks in advance
Sean
Pi Digital
WebApp PDF creation?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: WebApp PDF creation?
You can't access the browsers print dialogue directly with LC-content from a HTML5 standalone.
Of course you can write to the webpage that calls the HTML5 standalone. So you could write images/text or even a self-created pdf output to a special div there and then print that div, all using javaScript.
p.s. You have in mind that MS IE/Edge can NOT be used for HTML5 standalones?
Of course you can write to the webpage that calls the HTML5 standalone. So you could write images/text or even a self-created pdf output to a special div there and then print that div, all using javaScript.
p.s. You have in mind that MS IE/Edge can NOT be used for HTML5 standalones?
shiftLock happens
Re: WebApp PDF creation?
Thanks H,
Yes, I'm aware of the weird (and unexplained) lack of IE support. We will need to insist our clients use chrome or safari (There is no way IT departments will install Safari on business machines so we have to hope they are ok with Chrome instead).
What did you mean by 'a self-created pdf output'?
Yes, I'm aware of the weird (and unexplained) lack of IE support. We will need to insist our clients use chrome or safari (There is no way IT departments will install Safari on business machines so we have to hope they are ok with Chrome instead).
What did you mean by 'a self-created pdf output'?
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: WebApp PDF creation?
There are javaScript libraries for creating pdf-output in a webpage (client-side pdf printing). The input is text or images.seaniepie wrote:What did you mean by 'a self-created pdf output'?
I have (90% finished) a sample stack "PDFWriter" that uses pdfMake in a browser widget. So it's very similar (and clear that it will work) to do that in the browser from a HTML5 standalone.
p.s. AFAIK the lacking support of MS IE/Edge is due to Emscripten, not due to LiveCode.
On Windows is Firefox also OK, sometimes even faster than Chrome with HTML5 standalones.
shiftLock happens
Re: WebApp PDF creation?
Ok. I can work with that. I’ll script an LC to pdfMake conversion library as well as the mySQL lib we need.
Thanks for the excellent tips. And all your other examples on the forum too
Thanks for the excellent tips. And all your other examples on the forum too