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

Tilman Hausherr edited comment on PDFBOX-4375 at 11/10/18 2:14 PM:
-------------------------------------------------------------------

I don't see how this fixed the real problem you have. The real problem is a 
(felt?) lack of flexibility, i.e. that seeminly the PDFs must come from 
filenames. But if you make the described change, you'd still have a name. You 
would use complicated strategy to load from something else. This adds too much 
complexity IMHO.

At least the input PDF can come from a PDDocument, see {{setInputPDF()}}. I've 
seen other setters like {{setLastPageOverlayPDF()}}. Wouldn't these be better?


was (Author: tilman):
I don't see how this fixed the real problem you have. The real problem is a 
(felt?) lack of flexibility, i.e. that seeminly the PDFs must come from 
filenames. But if you make the described change, you'd still have a name. You 
would use some dummy name and then load from something else. This doesn't look 
clean to me IMHO.

At least the input PDF can come from a PDDocument, see {{setInputPDF()}}. I've 
seen other setters like {{setLastPageOverlayPDF()}}. Wouldn't these be better?

> Change visibility of Overlay#loadPDF to protected
> -------------------------------------------------
>
>                 Key: PDFBOX-4375
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4375
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0.12
>            Reporter: Wiktor Kwapisiewicz
>            Priority: Minor
>              Labels: Overlay
>         Attachments: 
> 0001-Change-visibility-of-Overlay-loadPDF-to-protected.patch
>
>
> Overriding loadPDF allows subclasses to load overlays from sources different 
> than File objects, for example from InputStreams or byte arrays (mostly 
> through PDDocument.load overloads).
> For example:
> {code:java}
> Overlay overlay = new Overlay() {
>     @Override
>     protected PDDocument loadPDF(String pdfName) throws IOException {
>         return PDDocument.load(overlayStreams.get(pdfName));
>     }
> };
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to