You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Tilman Hausherr <TH...@t-online.de> on 2018/11/10 05:37:17 UTC

Re: Working with non-File based Overlays / changing loadPDF to "protected"

Sorry for not answering earlier, I also saw your JIRA issue... for *me*, 
there are three types of requests: 1) great, will do. 2) bad idea, won't 
do. 3) not sure, can't decide, must think about it. Yours is (3). I must 
look at the source code in a quiet moment to decide. Changing visibility 
is a somewhat special request because I have read the chapter in 
"Effective Java" that warns about the risks.

Tilman

Am 19.10.2018 um 12:29 schrieb Wiktor Kwapisiewicz:
> Hi Pdfbox dev ML!
>
> I'm working with org.apache.pdfbox.multipdf.Overlay class to... well...
> add overlays to PDFs and the functionality is great but I have a minor
> issue with the API - it's completely filename-based and even though
> PDDocument.load, that is used internally, has a lot of useful overloads
> I don't see a workaround to load InputStream or a byte array as an overlay.
>
> I see one place that all strings (that Overlay accepts) are converted to
> PDDocuments, the loadPDF method:
>
>      private PDDocument loadPDF(String pdfName) throws IOException
>      {
>          return PDDocument.load(new File(pdfName));
>      }
>
> If that method was at least "protected" I could override it in my own
> subclass and return my own PDDocuments, loaded from InputStream or byte
> arrays.
>
> Do you think it would be a good idea?
>
> If not, what would be the a better one? (Except copying the class and
> modifying it myself, that I'm also considering :) ).
>
> Thank you for your time!
>
> Kind regards,
> Wiktor
>


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