[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-11 Thread Wiktor Kwapisiewicz (JIRA)


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

Wiktor Kwapisiewicz commented on PDFBOX-4375:
-

{quote}Did you have any troubles without that line or did you make that change 
because it looked as it had been forgotten?
{quote}
Yep, mainly that, I didn't think about manually closing the document and 
without that line I got a lot of unclosed document warnings. Also you used 
{{specificPageOverlayPage}} but then placed {{doc}} instead of 
{{getLayoutPage(doc)}} so I thought that was a minor issue. Now it works with 
only this line:
{code:java}
specificPageOverlayPage.put(e.getKey(), getLayoutPage(doc));
{code}
Of course I'm closing PDDocuments in the client of the {{overlay}} method but 
that's not a problem.
 I see you did some extra modifications, I've checked the top revision and it 
looks fine.
 Thanks a lot for taking the time to work with me on this issue, I really 
appreciate it!

Kind regards,
 Wiktor

> 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
>Assignee: Tilman Hausherr
>Priority: Minor
>  Labels: Overlay
> Fix For: 2.0.13, 3.0.0 PDFBox
>
> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-11 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846335 from til...@apache.org in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1846335 ]

PDFBOX-4375: use a Set instead of a Map

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-11 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846337 from til...@apache.org in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1846337 ]

PDFBOX-4375: add method that works with documents

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-11 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846338 from til...@apache.org in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1846338 ]

PDFBOX-4375: add method that works with documents

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-11 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846333 from til...@apache.org in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1846333 ]

PDFBOX-4375: better variable name

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846336 from til...@apache.org in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1846336 ]

PDFBOX-4375: use a Set instead of a Map

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on PDFBOX-4375:
-

Commit 1846334 from til...@apache.org in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1846334 ]

PDFBOX-4375: better variable name

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Tilman Hausherr (JIRA)


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

Tilman Hausherr commented on PDFBOX-4375:
-

I agree with the renaming, but the line
{code:java}
specificPageOverlay.put(e.getKey(), doc);{code}
was removed by me on purpose, because that map is just to make sure that the 
documents get closed. However because in the new method documents are passed, 
these should be closed by the caller. Did you have any troubles without that 
line or did you make that change because it looked as it had been forgotten?

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Wiktor Kwapisiewicz (JIRA)


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

Wiktor Kwapisiewicz commented on PDFBOX-4375:
-

Hi Tilman,

Yes, now I've seen the mail (I unsubscribed in the meantime due to high volume 
and I see I was not CC'ed). No worries, I'm glad that we can finally discuss 
and I'll post to {{users}} next time!

As for the code I did 2 adjustments and run it over my overlaying code and it 
works.

The adjustments: changing method name to {{overlayDocuments}} (overload won't 
work on generic maps due to type erasure :( ) and adding a line to put layout 
page, as the original does.

The final code: 
{code:java}
public PDDocument overlayDocuments(Map 
specificPageOverlayDocuments) throws IOException
{
loadPDFs();
for (Map.Entry e : 
specificPageOverlayDocuments.entrySet())
{
PDDocument doc = e.getValue();
if (doc != null)
{
specificPageOverlay.put(e.getKey(), doc);
specificPageOverlayPage.put(e.getKey(), getLayoutPage(doc));
}
}
processPages(inputPDFDocument);
return inputPDFDocument;
}
{code}
Now, the code is very similar to the original {{overlay}}, the only difference 
is String vs PDDocuments and the fact that the original has a "cache" of 
overlays (keyed on the String value).

Do you think it would be good to refactor these two methods to use the same 
code (in some kind of third, helper method)?

{quote}Changing visibility is a somewhat special request because I have read 
the chapter in "Effective Java" that warns about the risks.{quote}

Okay, I just finished reading 3rd edition of Effective Java, a lot of new 
interesting stuff since the 2nd!

Have a nice evening!
Wiktor

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Tilman Hausherr (JIRA)


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

Tilman Hausherr commented on PDFBOX-4375:
-

I did send a reply this morning with an apology for not responding, but I did 
see the post a few weeks ago. You can write to the mailing list, the best is 
usually the users mailing list.

Please come back here when you've tested your implementation (with a copy of 
the class). My little implementation is really a quickie, so I may have 
forgotten something.

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Wiktor Kwapisiewicz (JIRA)


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

Wiktor Kwapisiewicz commented on PDFBOX-4375:
-

Yep, looks good and solves my problem nicely! (although I can't test the 
implementation right now)

By the way I sent an e-mail about this thing some time ago to the dev mailing 
list but (probably due to high traffic there) I never got a reply. Is 
contacting dev mailing list good for discussing changes or should I just file 
Jira tickets?

Thanks a lot for help!

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Tilman Hausherr (JIRA)


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

Tilman Hausherr commented on PDFBOX-4375:
-

Yeah, it make more sense IMHO to add a method {{overlay(Map specificPageOverlayDocuments)}} … This would look somewhat like 
this:
{code:java}

    public PDDocument overlay(Map 
specificPageOverlayDocuments) throws IOException
    {
    loadPDFs();
    for (Map.Entry e : 
specificPageOverlayDocuments.entrySet())
    {
    if (doc != null)
    {
    specificPageOverlayPage.put(e.getKey(), doc);
    }
    }
    processPages(inputPDFDocument);
    return inputPDFDocument;
    }{code}
 

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Wiktor Kwapisiewicz (JIRA)


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

Wiktor Kwapisiewicz commented on PDFBOX-4375:
-

Hi Tilman,

Yes, Overlay is riddled with Strings that are paths. Unfortunately I need to 
specify different overlays per different pages. I'm using the {{overlay}} 
method (that takes a {{Map}} where Integer points to a page 
number and String is a File path).

Maybe a different solution would be an overload that takes a {{Maps}} (or a {{List}} where {{null}} means no overlay for 
that page).

Changing the visibility to {{protected}} was a smallest backwards-compatible 
change that allowed me to use inputs that are not Files per page, making 
{{String}} objects identifiers (as you point out).

What do you think would be the best approach here?

Thank you for your time!

Kind regards,

Wiktor

> 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



[jira] [Commented] (PDFBOX-4375) Change visibility of Overlay#loadPDF to protected

2018-11-10 Thread Tilman Hausherr (JIRA)


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

Tilman Hausherr commented on PDFBOX-4375:
-

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