Haxe for a new project

265 views
Skip to first unread message

filipes

unread,
May 3, 2016, 4:31:02 PM5/3/16
to Haxe
Hello,

we are considering Haxe or Freepascal/Lazarus for a new project, that we want to have cross-platform - Windows desktop first, then Android mobiles and tablets, then web...

I have no Haxe experience, but I like the Haxe concept.

Part of the project would be generate pdf documents from the app.
Is it possible and reasonably easy with Haxe?

Thanks

Cambiata

unread,
May 3, 2016, 5:28:14 PM5/3/16
to Haxe

Part of the project would be generate pdf documents from the app.
Is it possible and reasonably easy with Haxe?

I've been working on Haxe externs for PDFKit (http://pdfkit.org/) so if you can use client js or node that should work fine.
I haven't put it up on github yet, but I will do that if anyone's interested.

There's also a Haxe port of AS3 AlivePDF in the making: https://github.com/ngrebenshikov/openfl-alivepdf
Don't know if it's possible to use it without OpenFL though.

Jonas

Axel Huizinga

unread,
May 3, 2016, 11:10:50 PM5/3/16
to haxe...@googlegroups.com



Am 03.05.2016 um 23:28 schrieb Cambiata:

Part of the project would be generate pdf documents from the app.
Is it possible and reasonably easy with Haxe?

I've been working on Haxe externs for PDFKit (http://pdfkit.org/) so if you can use client js or node that should work fine.
I haven't put it up on github yet, but I will do that if anyone's interested.

Yes please :)
There's also a Haxe port of AS3 AlivePDF in the making: https://github.com/ngrebenshikov/openfl-alivepdf
Don't know if it's possible to use it without OpenFL though.

Jonas
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.


Philippe Elsass

unread,
May 4, 2016, 1:43:05 AM5/4/16
to Haxe

The safest/simplest choice nowadays to make cross platform application (not game) is using web technologies (think Atom, VS Code, Github desktop...).
Eg. Haxe JS, and using a node-webkit or Electron container for running on desktop.

You could use React for the view and for Android you'd have the option to go Cordova (webview) or React-native.

If runtime performance is an absolute necessity then it's another story.

Philippe

--

JLM

unread,
May 4, 2016, 4:46:47 AM5/4/16
to Haxe
There is a reader in format library but it looks like a base rather than something as extensive as a alivepdf
https://github.com/HaxeFoundation/format/tree/master/format/pdf

It would be a lot of work to get alivepdf working outside of openfl/nme

You could probably use -java-lib to use this library http://mirror.ox.ac.uk/sites/rsync.apache.org/pdfbox/2.0.1/pdfbox-app-2.0.1.jar
There is java example use here
https://github.com/apache/pdfbox/blob/trunk/examples/src/main/java/org/apache/pdfbox/examples/interactive/form/FillFormField.java
but that would not be cross platform and it lookes like a lot of work to port ( and rather java bloated perhaps ).
But it's normally a bit easier to port as3 code.
https://code.google.com/archive/p/as3-pdfreader/

For c# target you might be able to use -net-lib  and perhaps something like http://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library-Version-WPF
this type of approach may seem not useful for javascript but you might be able to get typescript output?  Maybe not.

To write something really optimal you probably need to explore creating c++ externs http://snowkit.org/2015/08/24/announcing-linc/ for something like
http://libharu.org/ although that mentions cross target and seems to have c# examples so you can perhaps use it with -net-lib flag for some testing prior to maybe writing some externs.

Not sure if these additonal links are helpful, if you do look to a haxe solution certainly would be good to post your progress as it looks to be an area not explored that widely currently.

filipes

unread,
May 4, 2016, 4:48:03 PM5/4/16
to Haxe
It should be a standalone app and investor wants to protect it,
so we think that web apps (desktop/mobile JS) would keep too vulnerable,
but we were (without deeper knowledge) considering OpenFL and HaxeUI.

filipes

unread,
May 4, 2016, 4:55:35 PM5/4/16
to Haxe
Hi,

fortunately the runtime performance should not be a problem,
but are those web technologies safe from copying/reverse engineering/cracking the app?

Rafael Oliveira

unread,
May 4, 2016, 5:09:23 PM5/4/16
to Haxe
If you are considering Openfl and HaxeUI (it can be StablexUI too), you should check the state of the text input. Some time ago I made a very good mobile app with Openfl and StablexUI, but I had to forget because the text input couldn't handle accents and text from other languages. But the Openfl team made some improvements so is good to check.

About the app itself, it was very fast with Openfl.

Ashiq A.

unread,
May 4, 2016, 5:13:41 PM5/4/16
to haxe...@googlegroups.com
Those technologies are as safe as whatever they compile to. At worst, for Flash (for example), you can decompile the Actionscript code. But, it'll be messy (it's generated from Haxe code), so it's not that useful.

Haxe also compiles to C++, which is great if you don't want people decompiling your app. I don't know if Haxe on Android uses Java or C++, though.

--

filipes

unread,
May 4, 2016, 5:40:34 PM5/4/16
to Haxe
Hi,

thanks for mentioning those options.

I will try to explore the externs/linc/libharu options.
This seems to fit the desktop, mobile path
and to prepare for the later web version, could be the same library (libharu) used for web target?

Anyway this sentence:

"if you do look to a haxe solution certainly would be good to post your progress"

is quite encouraging...

JLM

unread,
May 4, 2016, 8:47:44 PM5/4/16
to Haxe
Haxe frameworks that target Android ( openfl, nme, kha, snowkit ) use C++ mostly with java shim from what I understand, but you can target Android Java from Haxe if you prefer ( https://github.com/Boltmade/haxe-android-skeleton ).

Robert Konrad

unread,
May 5, 2016, 7:58:22 PM5/5/16
to Haxe
Kha has both options of course.

hosey hosey

unread,
May 6, 2016, 3:46:05 PM5/6/16
to haxe...@googlegroups.com

We used wkpdftohtml to convert temporary HTML files into PDF.  We embedded svg into the html pages when needed so we could have vector drawings.  Took some work but it is fast.  We write framework to call graphics.  For example sprite.graphics.drawRect will draw to screen and to svg, so what you see on screen is what you get in svg....

--

Adrian Veith

unread,
May 7, 2016, 3:14:00 PM5/7/16
to haxe...@googlegroups.com
Hi,

you can even consider to use freepascal together with Haxe. On windows
you have either the option to put some fpc units inside a .dll and write
Haxe externs for it, or you embed the Haxe code inside a Lazarus
application (neko and/or javascript). On Android you could compile the
freepascal to Java and link it with your Haxe code compiled to Java too.

If you want to embed Neko inside a Lazarus Application you should look
at my pascal4neko repository at https://github.com/AdrianV/pascal4neko.
It is only tested on Delphi 2007, but it should work with fpc/Lazarus as
well - at least on Windows 32bit. There is no documentation and it is
still a mess - but if you need help, feel free to ask.

Embedding Haxe/javascript inside a Lazarus application can be done by
embedding the Internet Explorer and write the front-end as Web app in
Haxe/javascript. You can communicate between the Javascript front-end
and freepascal back-end with OLE-automation.

Cheers, Adrian.

Adrian Veith

unread,
May 7, 2016, 3:14:00 PM5/7/16
to haxe...@googlegroups.com
Hi,

if you want to combine Haxe and Pascal, you might be interested in my
pascal4neko repository.https://github.com/AdrianV/pascal4neko. It is
only tested on Delphi 2007, so it should work with fpc/Lazarus as well -
at least on Windows 32bit. There is no documentation and it is still a
mess - but if you need help, feel free to ask.

Cheers, Adrian.

Am 03.05.2016 um 22:31 schrieb filipes:
Reply all
Reply to author
Forward
0 new messages