How do you create PDF file from ZERO (without frameworks)?

Asked

Viewed 682 times

3

Well, I’m analyzing some possibilities to generate PDF’s on Android (offline), and none is fully satisfying, either by the license, features, large size framework, or support version of Android (there’s the Pdfdocument, which is available from Android API 19, but my minTarget=14).

So as I need so far is to generate a simple PDF, (almost .txt, only text, without much firula), only one requirement of the client is that it is in PDF (clients, you know right). So I thought about creating my own PDF, from the source, only I did a lot of research and I didn’t find anything about PDF source templates, for example, how it has to be the header, how to create a paragraph, etc. I only appear in the frameworks searches, and but frameworks.

So I wonder if someone knows something and can show me an example of ZERO creation of a PDF, very simple, with headers, a title and a paragraph, and bonus a table (it is the most complex part of the pdf I have to generate), this would be excellent already.

And I also eat as far as I know PDF is from Adobe, then maybe you might have some problem or license with that.

  • Fernando, have a look at iText? http://www.vogella.com/tutorials/JavaPDF/article.html

  • @Guest, but I’ve even tested this one, only it besides having a certain size, works on AGPL license, which is not the way I want to go, since, intended nor use frameworks.

  • I’ve been looking for some here and, really, they all have some kind of license. = ( I haven’t seen any open source, so you can see how it works...

  • pdfDocument Maybe you can watch the Android widget itself and try to develop yours, no?

  • @Guest, I’ve tried but he extends other’s class native is if I extend from it, I do not have access to some resources, Internal (not visible outside the package). Dai can’t implement my Pdfdocument-based library.

  • @Guest, some time ago I even posted that question here even at Sopt, but I was unsuccessful and gave up the implementation.

  • This is very complicated. Even because your client requires API 14, but the native class of android is only available for API19 (Pathetic) and even more, all current libs are paid! Yeah... that’s pretty boring. I’m going to study these libs a little bit and, try, do some lib with a totally open-source license.

  • @Guest, yes, very complicated, my clients already use devices with version of Android 4.0 (API 14), currently I developed for the first delivery the HTML report, more in the future I will have to migrate to PDF. He hoped that Google itself would perhaps provide a support API for earlier versions, with a copy of Pdfdocument. The iText I’ve even tried, and it’s pretty cool, it worked.

  • There is no way you can try to generate the report for HTML and then pass it to PDF?

  • It could be a good one. You generate the HTML on the device, send it to a server on the WEB that you will receive, change it to PDF, and send it back as PDF. The client doesn’t need to know this... hahaha.

  • @Guest, I’ve seen it, but then, it’s on the server, and in my case I have to generate offline, for even offline it already have access to the PDF, and can send to a printer or save in your files.

  • Yeah. Really, really messed up! Anyway, if I find any lib that’s useful to you, I’m in charge here.

  • Pdfreader-Writer Look at this one. I think can be what you want.

  • @Guest, I will take a look at this lib and if you give goal, put a feed here. Thanks for the tip.

  • just a warning, she’s not quite a lib, more like a app that you were made for this. I think it may be even better for you, because then you can do it your way and with some changes and etc. Good luck and hugs!

Show 10 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.