-
Notifications
You must be signed in to change notification settings - Fork 599
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android support #118
Comments
hello, I am also interested in android compatibility. I want to modify this library, to replace awt with android specific code.
|
@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 |
@andob @Daniele-Comi @andreasrosdal |
Hello @andob @Daniele-Comi @andreasrosdal |
I don't have the skill to have this support Android, so hoping someone takes this one soon. |
This comment has been minimized.
This comment has been minimized.
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? |
@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? |
Can you please post a description about how to use OpenPDF with android-awt? |
@andreasrosdal On Android we use Gradle, which is fully compatible with maven.
On Maven this can be configured as
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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. |
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? |
@udittmer Please update
And add these rules to your
|
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? |
@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. |
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. |
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! |
|
There is no official android support in OpenPDF, so using |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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?
The text was updated successfully, but these errors were encountered: