[ 
https://issues.apache.org/jira/browse/PDFBOX-5716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785272#comment-17785272
 ] 

AD_LB commented on PDFBOX-5716:
-------------------------------

[~tilman] The request is to split it to avoid using it directly.
People will still have their file-formats to be supported, as they had so far.
The dependency usage could become as such:

To have it depend on AWT :

org.apache.pdfbox:pdfbox:3.0.0

To have it independent:

org.apache.pdfbox:pdfboxcore:3.0.0

And then you could either provide it what it needs, or use one of these:

org.apache.pdfbox:pdfboxawt:3.0.0

org.apache.pdfbox:pdfboxandroid:3.0.0

About the file-formats, I don't understand what you mean. These are also 
supported on Android but again not using AWT.
Un the end, what you get is a bitmap representation, an array of pixels, 
because that's after the decoding is done.
There is no much difference between PNG, WEBP, TIF, JPEG after you've decoded 
them, except that some might have pixels with alpha channel. 

Also, what happens if you wish to support some file-format that's not supported 
by AWT ? What then would you do?

The issue isn't just images, BTW. The crash occurs right on the creation of the 
class PDDocument.


> Request: offer Android to also use this library, by removing all usages of AWT
> ------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5716
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5716
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: FontBox
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: AD_LB
>            Priority: Major
>         Attachments: 2023-11-12_02-31-29.png, pdfTest.zip
>
>
> I'm a newb to PDFBox, so I just wanted to try it out, to see how to create 
> texts, hyperlinks, and images.
> Sadly, even with the most basic thing, of creating a new instance of 
> PDDocument, this library fails to be used on Android, as it requires AWT for 
> many things, including this simple creation.
> Android barely has anything related to AWT, as it has its own implementations 
> of color, bitmaps, etc...
> I've also noticed that it's used for images (and probably colors and fonts as 
> well), which makes it hard to overcome on Android.
> I think there is only one library out there that is "forked" out of PDFBox 
> and works for Android, but it's barely maintained and is stuck in the past:
> https://github.com/TomRoush/PdfBox-Android
> Please offer some way to still use this library even on Android, without 
> weird workarounds.
> Maybe offer some common things that are shared between the platforms.
> For color/pixel, for example, it can be one that has ARGB values, and for 
> bitmap, it can be an array of such pixels, with definition to get 
> width&height of the bitmap.
> Perhaps look at the library's implementation and see what can be common and 
> what can be an additional dependency.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to