-
Notifications
You must be signed in to change notification settings - Fork 13
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
Having issues importing and using #32
Comments
Hi, my knowledge about building Android applications is limited. However, I spotted an error in the badges, so now the right version number is displayed. For historical reasons I needed to make a breaking change from v3 to v4 so that both the package name and the artifact name were altered (adding a Starting from v6 I reverted to the "original" system of using just "ph-pdf-layout", so for Java 8 please use:
and for Java 11 onwards use
Hope that makes a bit of sense :) |
@phax Now I have a different issue. In addition, there is BufferedImage used for PLImage. On Android, there is android.graphics.Bitmap , Or I could just provide 2-dimentional array of Integers (each is a pixel in ARGB form), or any other thing you wish. Are there alternative to those in this library? |
@phax Maybe you know of an alternative to this library, that could work even on Android? |
No, I am not aware of really similar libraries that I can recommend. Let me see if can operate this class away - give me some days. I am on vacation atm |
That would be awesome ! |
No, it's not too hard. Its just a backwards incompatible change... |
I hope you succeed. |
Please see release 7.3.0 - removes java.awt.color. |
@phax You succeeded?
? |
Ah yes - for color use the new class |
@phax About PLColor, thank you. Seems it support RGB. Does it support alpha too? Or PDF doesn't support such a thing? About PLImage2 , I can't find it after changing the dependency. Sure it's there? |
PDF does support alpha channel - may be later. I used Color also just in RGB mode. Regarding |
@phax You mean I should extend from AbstractPLImage ? I don't see how to get away from awt when the classes are very strict... |
I have no idea if it is possible or not. I don't know the Android runtime. You need to do some investigations... |
@phax I didn't talk about Android being the issue. I'm sure that in every framework, there is the Bitmap representation as an array of pixels, with width and/or height being input too. I can see org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory.createFromRGBImage , for example |
@phax After trying to avoid to use the image usages (maybe will try this later), the IDE claims there are duplicate classes:
How come? Maybe because I use Kotlin too? About
For
And for
|
Ah yes - both I prefer using Your solution depends on the Kotlin default logging - I don't know it. Most likely you need to exclude either |
@phax Do you know how to do such a thing in gradle kts ? How did you get it to work? Maybe I can use what you did? |
I use Maven - Maven has an explicit https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html#sec:excluding-transitive-deps seems like what you need |
@phax Can you please copy-paste what you used in maven? |
I mean your own code (maven snippets), of which ones you've excluded. |
I was looking, but couldn't find something in my dependencies - I am always very cautious with them, so usually there is no need to exclude stuff Edit: for logging I am only including |
Odd that it works fine for you. Multiple modules with same classes and paths to them... |
Ah, I see what you mean, because
Looks weird, but guarantees that the API requirements of PDFBox are fulfilled, but no "implementation" is present |
Shouldn't it be the opposite? 1.2 is newer... |
The API is a subset and hasn't changed. Only some implementation specific parts have changed in the 1.2 implementation release. Se the different artifact IDs |
OK so I tried this:
And got even more duplicates for some reason: And I tried this:
And got even more duplicates for some reason: I think they are identical. :( |
I meant
or so - whatever the right syntax is |
Still duplicates: |
There is still some |
It prevents from building the app (no output APK file to install and run), so I can't ignore. |
Maybe you can post the full build file here, or send it by email |
Here, both: |
Remove |
@phax It's commented (with |
You are true. |
No idea - sorry. Check if you can list the transitive dependencies.... |
Too bad |
I wanted to see how to create hyperlinks, so there are these sample PDF files:
https://github.com/phax/ph-pdf-layout/tree/master/example-files/plexternallink
And also a sample code:
https://github.com/phax/ph-pdf-layout/blob/master/src/test/java/com/helger/pdflayout/element/link/PLExternalLinkTest.java
So I copied this a bit into a new Android app project, and I also tried to use this in the gradle file (kts formant):
It can't find the classes.
The docs say to use it this way.
Also it's mentioned here:
https://search.maven.org/artifact/com.helger/ph-pdf-layout4/5.2.2/jar?eh=
But it's weird because the latest version is also said to be 7.1.0...
Attached the problematic sample project. I can also use Java if you wish. Kotlin should be fine though, as it can handle Java easily.
I also tried to reach Jitpack as it might be able to fetch the library, but it failed:
https://jitpack.io/#phax/ph-pdf-layout
What is going on ? What should I use? Maybe the docs weren't updated?
My Application.zip
The text was updated successfully, but these errors were encountered: