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

Andreas Lehmkühler edited comment on PDFBOX-5483 at 8/2/22 3:17 PM:
--------------------------------------------------------------------

Unfortunately, yes. If people have to use a (moved) method with the same 
signature they expect a similar behaviour just like before but they won't get 
it. I already had to explain the differences twice and it is understandable, i 
don't want to blame the users. I'm pretty sure everybody will be frustrated if 
we don't change that. The users because they won't get what they expect and the 
devs because they have to explain why users don't get what they expect.

When migrating to 3.0.0 people have to change the load-call in any case and 
IMHO it isn't that hard to change the type of the source as well. We are going 
to document that in the migration guide.


was (Author: lehmi):
Unfortunately, yes. If people have to use a (moved) method with the same 
signature they expect a similar behaviour just like before but they won't get 
it. I already had to explain the differences twice and it is understandable; i 
don't want to blame the users. I'm pretty sure everybody will be frustrated if 
we don't change that. The users because they won't get what they expect and the 
devs because they have to explain why users don't get what they expect.

When migrating to 3.0.0 people have to change the load-call in any case and 
IMHO it isn't that hard to change the type of the source as well. We are going 
to document that in the migration guide.

> Replace methods using an InputStream from Loader.loadPDF
> --------------------------------------------------------
>
>                 Key: PDFBOX-5483
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5483
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Parsing
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Andreas Lehmkühler
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>             Fix For: 3.0.0 PDFBox
>
>
> As discussed on dev@pdfbox
> {quote}
> We have to remove the loadPDF variants using InputStream and replace them 
> with RandomAccessRead.
> If it comes to InputStreams users have to decide how to procide:
> * copy the InputStream to memory by using RandomAccessReadBuffer
> * copy the InputStream to a file and use RandomAccessReadBufferedFile or 
> RandomAccessReadMemoryMappedFile
> This would make it more transparent what happens under the hood when using 
> the different kinds of loadPDF methods:
> * a byte array as source is already in memory and the obvious choice is to 
> use RandomAccessReadBuffer as a wrapper
> * a file as source targets a local file and the most obvious choice is to use 
> RandomAccessReadBufferedFile as a wrapper. We should document that as the 
> other alternative RandomAccessReadMemoryMappedFile is offered in this case
> * RandomAccessRead as source is the most obvious one and the user decides how 
> to create it. Additionally is ist possible to implement some own caching 
> loading and/or mechanism
> {quote}
> see PDFBOX-5462 and [High memory usage with pdfbox 
> 3|https://lists.apache.org/thread/6mmgp23v8b2yztj4hghkgkd14s1gzs8g] as well



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to