Replies: 22 comments
-
hello, I am also interested in android compatibility. I want to modify this library, to replace awt with android specific code.
|
Beta Was this translation helpful? Give feedback.
-
@andob Well yeah that would be great, I thought to do it myself after asking for compatibility but I later realized I have already too much work to do at college. However I resolved this missing compatibility by bypassing it : deployed a Servlet on AWS' Elastic Beanstalk using Apache Tomcat and then getting via HTTP response the processed PDF in the Android app Yeah that's quite a trip, so I hope there'll be android support soon |
Beta Was this translation helpful? Give feedback.
-
@andob @Daniele-Comi @andreasrosdal |
Beta Was this translation helpful? Give feedback.
-
Hello @andob @Daniele-Comi @andreasrosdal |
Beta Was this translation helpful? Give feedback.
-
I don't have the skill to have this support Android, so hoping someone takes this one soon. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
So let's list the tasks required for Android support: -Classes like awt.Color, Point, Dimensiom can be easily replaced. There is also: https://github.com/witwall/appengine-awt - Could we use this? |
Beta Was this translation helpful? Give feedback.
-
@andreasrosdal @BobbyRuby I forked it into It worked! :) This is a hack but it seems to work :D. At least with the features I used: generating PDFs with paragraphs, tables, images and normal / bold text with the default font. @BobbyRuby can you test this on your project and post the issues you found on my repo? |
Beta Was this translation helpful? Give feedback.
-
Can you please post a description about how to use OpenPDF with android-awt? |
Beta Was this translation helpful? Give feedback.
-
@andreasrosdal On Android we use Gradle, which is fully compatible with maven.
On Maven this can be configured as
|
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
I'll give this a shot... Hoping it will do the trick for filling forms. Won't be tonight but will try to get it tested before end of next week. |
Beta Was this translation helpful? Give feedback.
-
What do I need to add to my ProGuard setup to make this work? While the code works fine -many thanks to all involved!- in the debug build, the release build fails at the transformClassesAndResourcesWithProguardForRelease step, with the last message being Warning: there were 143 instances of library classes depending on program classes. But I'm not sure how to avoid those? |
Beta Was this translation helpful? Give feedback.
-
@udittmer Please update
And add these rules to your
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, but adding that didn't make a difference. I'm not sure why it would, anyway: suppressing warnings in ProGuard doesn't address the issue it complains about (about library classes depending on program classes), does it? Is there a demo app (or any app that uses android-awt) available somewhere that shows how it all fits together? |
Beta Was this translation helpful? Give feedback.
-
@udittmer well I couldn't replicate your exact error There are some missing classes from If you want to use bouncycastle with OpenPDF, you sould import it in your build.gradle file, otherwise If you don't use bouncycastle features, you should add OpenPDF also uses I made a quick sample project: OpenPDFAndroidSample. Can you clone my repo and run / build for debug / release the sample? On my environment (Android Studio 3.5) works fine. |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the help, I appreciate it. I can build the sample code fine, and after upgrading my tool chain to the latest Gradle version (I was still using 4.10.2), so does my app. Maybe something internal to Gradle changed along the way. Anyway, the problem is solved. |
Beta Was this translation helpful? Give feedback.
-
I just saw the samples and was going to share it here! Thanks andob! I will be putting this to good use I think. I'll report back any problems or issues I may find! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
There is no official android support in OpenPDF, so using |
Beta Was this translation helpful? Give feedback.
-
android-awt adds several MB of overhead to an app, so -as much as I like OpenPDF- on Android I'd advise to look into https://sourceforge.net/projects/apwlibrary/, which is a small library that can generate PDFs (obviously with a lot fewer features than OpenPDF, but it gets the job done for simple PDFs). |
Beta Was this translation helpful? Give feedback.
-
Android support wiki article:
https://github.com/LibrePDF/OpenPDF/wiki/Android-support
So let's list the tasks required for Android support:
-Classes like awt.Color, Point, Dimensiom can be easily replaced.
-Classes like PdfGraphics2D need to be rewritten from scratch, since they use so much awt logic.
-All the rendering logic is done with awt and needs to be rewritten, retested etc.
There is also: https://github.com/witwall/appengine-awt
https://github.com/bedatadriven/appengine-export
The original issue submission here:
Hi, thank you for your great work.
Just learnt how to use your library with a sample Java application
Then I used some classes I made thanks to your library in an Android environment but disocovered your library is using only AWT without no android.graphics packages suppport.
Any suggestion on how could I move on?
Beta Was this translation helpful? Give feedback.
All reactions