PDF generation

57 views
Skip to first unread message

Bryan Buchanan

unread,
Dec 21, 2016, 7:18:06 PM12/21/16
to CodenameOne Discussions
I'm considering http://pdfjet.com/ to generate PDF's in Android (and other platforms I guess).

AFAIK, the commercial version just ships the .jar file. Is this all CN1 needs to build with ?

Steve Hannah

unread,
Dec 21, 2016, 7:59:53 PM12/21/16
to codenameone...@googlegroups.com
You'll need to either do the PDF stuff server-side, or you'll have to do it with native interfaces.  I've never used this lib, but they say that it is compatible with Android and WinPhone.  It isn't clear whether their .Net version works on UWP.  In either case, you'll need to do those using native interfaces.  You'd need to find a different lib for iOS.  

The easiest solution would be to do it server-side.

Steve

On Wed, Dec 21, 2016 at 4:18 PM, Bryan Buchanan <bry...@webbtide.com> wrote:
I'm considering http://pdfjet.com/ to generate PDF's in Android (and other platforms I guess).

AFAIK, the commercial version just ships the .jar file. Is this all CN1 needs to build with ?

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/45c00118-bb7b-4357-87c1-eadfecac6dbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

Bryan Buchanan

unread,
Dec 21, 2016, 8:11:08 PM12/21/16
to CodenameOne Discussions
Not sure I understand why it needs native code of server-side stuff.

It's just a library producing a text file, it's all Java. When I create a CN1 app, doesn't just the byte code of my app get sent to the build server ?

In any case, I just checked the PDFJet Open Source code, and it's (unsurprisingly) source code, so I could include that with my code for my CN1 app, so CN1 can build as per usual (for all platforms), and check with the PDFJet guys that doing this but purchasing a commercial licence was an OK option.

Steve Hannah

unread,
Dec 21, 2016, 8:54:47 PM12/21/16
to codenameone...@googlegroups.com
On Wed, Dec 21, 2016 at 5:11 PM, Bryan Buchanan <bry...@webbtide.com> wrote:
Not sure I understand why it needs native code of server-side stuff.

It's just a library producing a text file, it's all Java. When I create a CN1 app, doesn't just the byte code of my app get sent to the build server ?
The jar they produce is for Android, as they say.  This likely uses Android specific APIs not available in Codename One.  You'd need to include the jar in the native/android directory so that it would be referenced only for the Android build - you could then write a native interface that used their functionality.   Many libraries are fairly simple to port over to Codename One if you have the source.  The chances of an arbitrary jar just working are slim to none.  That is why we have the cn1lib format.
 

In any case, I just checked the PDFJet Open Source code, and it's (unsurprisingly) source code, so I could include that with my code for my CN1 app, so CN1 can build as per usual (for all platforms), and check with the PDFJet guys that doing this but purchasing a commercial licence was an OK option.

You can give that a try.  Usually I start a new Codename One project, and copy the java source files into it.  Then start fixing errors as they come up.  With something like PDF, you're likely to get in deep pretty fast.  Which is why I suggested that doing it server-side is the easiest way.

Steve

 


On Thursday, December 22, 2016 at 10:59:53 AM UTC+10, Steve Hannah wrote:
You'll need to either do the PDF stuff server-side, or you'll have to do it with native interfaces.  I've never used this lib, but they say that it is compatible with Android and WinPhone.  It isn't clear whether their .Net version works on UWP.  In either case, you'll need to do those using native interfaces.  You'd need to find a different lib for iOS.  

The easiest solution would be to do it server-side.

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

Bryan Buchanan

unread,
Dec 21, 2016, 10:19:11 PM12/21/16
to CodenameOne Discussions


On Thursday, December 22, 2016 at 11:54:47 AM UTC+10, Steve Hannah wrote:
You can give that a try.  Usually I start a new Codename One project, and copy the java source files into it.  Then start fixing errors as they come up.  With something like PDF, you're likely to get in deep pretty fast.  Which is why I suggested that doing it server-side is the easiest way.

I see what you mean - LOL.  That said, it doesn't look like it would be too big of a  task to tweak the code to compile. I think I'll contact to the PDFjet guys to see if doing this is OK from a licencing pov before I dive in.
Reply all
Reply to author
Forward
0 new messages