[jira] [Commented] (PDFBOX-4371) Improve ExtractText utility so that it can extract rotated text automatically

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


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

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

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

PDFBOX-4371: improve javadoc

> Improve ExtractText utility so that it can extract rotated text automatically
> -
>
> Key: PDFBOX-4371
> URL: https://issues.apache.org/jira/browse/PDFBOX-4371
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Text extraction, Utilities
>Affects Versions: 2.0.12, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.13, 3.0.0 PDFBox
>
> Attachments: ExtractAngledText.java
>
>
> In a first step, detect all rotations by analyzing the effective text 
> rendering matrix. In a second step, do a text extraction for each rotation by 
> prepending an appropriate transform to the page content stream (so that our 
> text has angle == 0) and then filtering any rotated text. Test file: the file 
> from PDFBOX-4368.



--
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-4371) Improve ExtractText utility so that it can extract rotated text automatically

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


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

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

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

PDFBOX-4371: improve javadoc

> Improve ExtractText utility so that it can extract rotated text automatically
> -
>
> Key: PDFBOX-4371
> URL: https://issues.apache.org/jira/browse/PDFBOX-4371
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Text extraction, Utilities
>Affects Versions: 2.0.12, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.13, 3.0.0 PDFBox
>
> Attachments: ExtractAngledText.java
>
>
> In a first step, detect all rotations by analyzing the effective text 
> rendering matrix. In a second step, do a text extraction for each rotation by 
> prepending an appropriate transform to the page content stream (so that our 
> text has angle == 0) and then filtering any rotated text. Test file: the file 
> from PDFBOX-4368.



--
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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: add comment to empty method for SonarQube

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: add comment to empty method for SonarQube

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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] [Comment Edited] (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 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



[jira] [Updated] (PDFBOX-4335) Overlay should implement Closeable

2018-11-10 Thread Tilman Hausherr (JIRA)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-4335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-4335:

Labels: Overlay  (was: )

> Overlay should implement Closeable
> --
>
> Key: PDFBOX-4335
> URL: https://issues.apache.org/jira/browse/PDFBOX-4335
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Utilities
>Affects Versions: 2.0.12
>Reporter: Wiktor Kwapisiewicz
>Assignee: Tilman Hausherr
>Priority: Major
>  Labels: Overlay
> Fix For: 2.0.13, 3.0.0 PDFBox
>
> Attachments: 
> 0001-PDFBOX-4335-Implement-java.io.Closeable-in-Overlay.patch
>
>
> `org.apache.pdfbox.multipdf.Overlay` class has `close` method but it doesn't 
> implement Closeable interface. Other classes, such as PDDocument, do 
> implement it.
> Attached patch.



--
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] [Updated] (PDFBOX-4294) Scratch file already closed when redoing overlay

2018-11-10 Thread Tilman Hausherr (JIRA)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-4294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-4294:

Labels: Overlay  (was: )

> Scratch file already closed when redoing overlay
> 
>
> Key: PDFBOX-4294
> URL: https://issues.apache.org/jira/browse/PDFBOX-4294
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.11
>Reporter: Adrian Sándor
>Priority: Major
>  Labels: Overlay
> Attachments: MyOverlay.java, overlay-v2.zip, overlay.zip
>
>
> Here's some sample code to reproduce the problem:
>  
> {code:java}
> final String path = "orig.pdf";
> final String stampPath = "stamp.pdf";
> final PDDocument doc = PDDocument.load(new File(path));
> final Overlay o = new Overlay();
> o.setInputPDF(doc);
> o.setOverlayPosition(Position.FOREGROUND);
> final HashMap m = new HashMap<>();
> m.put(0, stampPath);
> PDDocument res = o.overlay(m);
> res.close();
> res = o.overlay(m);
> {code}
> Basically I'm doing an overlay, closing the resulting document, then doing it 
> again (normally I would make some changes first, but I didn't include that 
> for the sake of brevity).
> The last line throws java.io.IOException: Scratch file already closed
> If I remove "res.close()" then the code works, but if I do the overlay 
> multiple times, I get warnings like: org.apache.pdfbox.cos.COSDocument - 
> Warning: You did not close a PDF Document
> which suggests that I should actually close the document when I'm done with 
> it.
>  



--
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] [Updated] (PDFBOX-4120) Overlay process forcing bounding box to 0,0, clipping overlayed page.

2018-11-10 Thread Tilman Hausherr (JIRA)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-4120:

Labels: Overlay  (was: )

> Overlay process forcing bounding box to 0,0, clipping overlayed page.
> -
>
> Key: PDFBOX-4120
> URL: https://issues.apache.org/jira/browse/PDFBOX-4120
> Project: PDFBox
>  Issue Type: Improvement
>Affects Versions: 2.0.8
>Reporter: Gregg
>Priority: Major
>  Labels: Overlay
>
> Hello,
> I am using the overlay functionality in PDFBox to stamp existing pdf file 
> pages with some test running up the left margin and across the footer of each 
> page. 
> I am creating an overlay page, based on the size, rotation, media and crop 
> boxes with the text to stamp.  I then call the overlay method with my overlay 
> pages to create the final document.   
> The overlay code creates a PDFormXObject representation of the overlay page 
> to apply to the source page.  Overlay.createOverlayXObject() sets the 
> bounding box of the new PDFormXObject using the source page media box, but it 
> forces the x,y to 0,0. 
> The issue I have is when the original page has a media/crop box that starts 
> in a negative quadrant, the overlay is clipped so some of the text is 
> missing. The work around I am doing is to go through the results pages after 
> the overlay method completes and update the bounding boxes of the 
> PDFormXObject to be the media box as the source page. 
> I think it would be helpful if we could tell the overlay process whether it 
> should manipulate the bounding box or not.



--
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] [Updated] (PDFBOX-3358) Incorrect PDFOverlay positioning

2018-11-10 Thread Tilman Hausherr (JIRA)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-3358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-3358:

Attachment: W-9_0.pdf
CenterLines.pdf

> Incorrect PDFOverlay positioning
> 
>
> Key: PDFBOX-3358
> URL: https://issues.apache.org/jira/browse/PDFBOX-3358
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.1
> Environment: Ubuntu 16.04, Java 1.8.0, 64-bit
>Reporter: Stephen Eisenhauer
>Priority: Major
>  Labels: Overlay
> Attachments: CenterLines.pdf, W-9_0.pdf
>
>
> Some PDFs have atypical media/crop boxes, and this seems to cause the 
> OverlayPDF command in pdfbox-app to produce unexpected results.
> To reproduce:
> {code}
> wget https://www.colorado.gov/pacific/sites/default/files/W-9_0.pdf
> wget http://stepheneisenhauer.com/files/CenterLines.pdf
> java -jar pdfbox-app-2.0.1.jar OverlayPDF W-9_0.pdf out.pdf
> {code}
> In this example, W-9_0.pdf has the unusual traits (when opened in Inkscape, 
> objects outside the media box can be seen), and CenterLines.pdf is just a 
> normal PDF with lines centered on the page. Both pages have the same media 
> size, yet out.pdf shows the lines shifted (though they are still their 
> original size).



--
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] [Updated] (PDFBOX-3358) Incorrect PDFOverlay positioning

2018-11-10 Thread Tilman Hausherr (JIRA)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-3358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-3358:

Labels: Overlay  (was: )

> Incorrect PDFOverlay positioning
> 
>
> Key: PDFBOX-3358
> URL: https://issues.apache.org/jira/browse/PDFBOX-3358
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.1
> Environment: Ubuntu 16.04, Java 1.8.0, 64-bit
>Reporter: Stephen Eisenhauer
>Priority: Major
>  Labels: Overlay
>
> Some PDFs have atypical media/crop boxes, and this seems to cause the 
> OverlayPDF command in pdfbox-app to produce unexpected results.
> To reproduce:
> {code}
> wget https://www.colorado.gov/pacific/sites/default/files/W-9_0.pdf
> wget http://stepheneisenhauer.com/files/CenterLines.pdf
> java -jar pdfbox-app-2.0.1.jar OverlayPDF W-9_0.pdf out.pdf
> {code}
> In this example, W-9_0.pdf has the unusual traits (when opened in Inkscape, 
> objects outside the media box can be seen), and CenterLines.pdf is just a 
> normal PDF with lines centered on the page. Both pages have the same media 
> size, yet out.pdf shows the lines shifted (though they are still their 
> original size).



--
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=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=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



Build failed in Jenkins: PDFBox-Trunk-jdk9 #667

2018-11-10 Thread Apache Jenkins Server
See 

--
Started by user tilman
Running as tilman
[EnvInject] - Loading node environment variables.
FATAL: java.io.IOException: Unexpected termination of the channel
java.io.EOFException
at 
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
at 
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
at 
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
at java.io.ObjectInputStream.(ObjectInputStream.java:358)
at 
hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:48)
at 
hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to H32
at 
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.Request.call(Request.java:202)
at hudson.remoting.Channel.call(Channel.java:954)
at hudson.FilePath.act(FilePath.java:1131)
at 
org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:64)
at 
org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:80)
at 
org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:44)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
at hudson.model.Run.execute(Run.java:1794)
at 
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at 
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused: hudson.remoting.RequestAbortedException
at hudson.remoting.Request.abort(Request.java:340)
at hudson.remoting.Channel.terminate(Channel.java:1038)
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
ERROR: Step ?Archive the artifacts? failed: no workspace for PDFBox-Trunk-jdk9 
#667
ERROR: H32 is offline; cannot locate JDK 1.9 (latest)
ERROR: H32 is offline; cannot locate Maven 3.5.4
ERROR: H32 is offline; cannot locate JDK 1.9 (latest)
ERROR: H32 is offline; cannot locate Maven 3.5.4
ERROR: H32 is offline; cannot locate JDK 1.9 (latest)
ERROR: H32 is offline; cannot locate Maven 3.5.4
ERROR: H32 is offline; cannot locate JDK 1.9 (latest)
ERROR: H32 is offline; cannot locate Maven 3.5.4

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



[jira] [Comment Edited] (PDFBOX-4120) Overlay process forcing bounding box to 0,0, clipping overlayed page.

2018-11-10 Thread Tilman Hausherr (JIRA)


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

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

Is this similar to PDFBOX-3358? Could you please attach your PDFs and some 
simple code?


was (Author: tilman):
Is this similar to PDFBOX-3358? Could you please attach your PDFs?

> Overlay process forcing bounding box to 0,0, clipping overlayed page.
> -
>
> Key: PDFBOX-4120
> URL: https://issues.apache.org/jira/browse/PDFBOX-4120
> Project: PDFBox
>  Issue Type: Improvement
>Affects Versions: 2.0.8
>Reporter: Gregg
>Priority: Major
>  Labels: Overlay
>
> Hello,
> I am using the overlay functionality in PDFBox to stamp existing pdf file 
> pages with some test running up the left margin and across the footer of each 
> page. 
> I am creating an overlay page, based on the size, rotation, media and crop 
> boxes with the text to stamp.  I then call the overlay method with my overlay 
> pages to create the final document.   
> The overlay code creates a PDFormXObject representation of the overlay page 
> to apply to the source page.  Overlay.createOverlayXObject() sets the 
> bounding box of the new PDFormXObject using the source page media box, but it 
> forces the x,y to 0,0. 
> The issue I have is when the original page has a media/crop box that starts 
> in a negative quadrant, the overlay is clipped so some of the text is 
> missing. The work around I am doing is to go through the results pages after 
> the overlay method completes and update the bounding boxes of the 
> PDFormXObject to be the media box as the source page. 
> I think it would be helpful if we could tell the overlay process whether it 
> should manipulate the bounding box or not.



--
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



Build failed in Jenkins: PDFBox-Trunk-jdk9 #665

2018-11-10 Thread Apache Jenkins Server
See 


Changes:

[tilman] PDFBOX-4371: improve javadoc

[tilman] PDFBOX-4071: add comment to empty method for SonarQube

[tilman] PDFBOX-4374: remove log4j

[tilman] PDFBOX-4374: remove log4j

--
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H32 (ubuntu xenial) in workspace 

Cleaning up 
Deleting 
Deleting 

Deleting 

Deleting 

Deleting 

Deleting 
Deleting 

Deleting 
Deleting 

Deleting 

Deleting 

Deleting 

Updating http://svn.apache.org/repos/asf/pdfbox/trunk at revision 
'2018-11-10T15:27:09.548 +'
D preflight/src/test/resources/log4j.xml
U tools/src/main/java/org/apache/pdfbox/tools/ExtractText.java
U preflight-app/pom.xml
U debugger-app/pom.xml
U app/pom.xml
At revision 1846317

Parsing POMs
Established TCP socket on 46861
maven35-agent.jar already up to date
maven35-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[trunk] $ /home/jenkins/tools/java/latest1.9/bin/java -Xmx1g -cp 
/home/jenkins/jenkins-slave/maven35-agent.jar:/home/jenkins/tools/maven/apache-maven-3.5.4/boot/plexus-classworlds-2.5.2.jar:/home/jenkins/tools/maven/apache-maven-3.5.4/conf/logging
 jenkins.maven3.agent.Maven35Main /home/jenkins/tools/maven/apache-maven-3.5.4 
/home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven35-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 46861
Java HotSpot(TM) 64-Bit Server VM warning: INFO: 
os::commit_memory(0xc000, 1073741824, 0) failed; error='Not enough 
space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing 
reserved memory.
# An error report file with more information is saved as:
# 
ERROR: Failed to launch Maven. Exit code = 1
Archiving artifacts

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



Build failed in Jenkins: PDFBox-Trunk-jdk9 #666

2018-11-10 Thread Apache Jenkins Server
See 

--
Started by user tilman
Running as tilman
[EnvInject] - Loading node environment variables.
Building remotely on H32 (ubuntu xenial) in workspace 

Cleaning up 
Deleting 

Updating http://svn.apache.org/repos/asf/pdfbox/trunk at revision 
'2018-11-10T15:45:11.996 +'
At revision 1846317

No changes for http://svn.apache.org/repos/asf/pdfbox/trunk since the previous 
build
Parsing POMs
Established TCP socket on 33556
maven35-agent.jar already up to date
maven35-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[trunk] $ /home/jenkins/tools/java/latest1.9/bin/java -Xmx1g -cp 
/home/jenkins/jenkins-slave/maven35-agent.jar:/home/jenkins/tools/maven/apache-maven-3.5.4/boot/plexus-classworlds-2.5.2.jar:/home/jenkins/tools/maven/apache-maven-3.5.4/conf/logging
 jenkins.maven3.agent.Maven35Main /home/jenkins/tools/maven/apache-maven-3.5.4 
/home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven35-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 33556
Java HotSpot(TM) 64-Bit Server VM warning: INFO: 
os::commit_memory(0xc000, 1073741824, 0) failed; error='Not enough 
space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing 
reserved memory.
# An error report file with more information is saved as:
# 
ERROR: Failed to launch Maven. Exit code = 1
Archiving artifacts

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



Jenkins build is back to normal : PDFBox-Trunk-jdk9 #668

2018-11-10 Thread Apache Jenkins Server
See 


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



[jira] [Commented] (PDFBOX-3017) Improve document signing

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


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

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

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

PDFBOX-3017: copy certificate chain verifier from trunk, remove jdk7 
improvements

> Improve document signing
> 
>
> Key: PDFBOX-3017
> URL: https://issues.apache.org/jira/browse/PDFBOX-3017
> Project: PDFBox
>  Issue Type: Improvement
>  Components: AcroForm, Signing
>Affects Versions: 2.0.0, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Fix For: 3.0.0 PDFBox
>
> Attachments: PDFBOX-3017_certificate_chain.diff, 
> PDFBOX-3017_certificate_chain_Screenshot.png, QV_RCA1_RCA3_CPCPS_V4_11.pdf, 
> pdfa_signed_insivible.pdf
>
>
> Improve signing code:
> - incremental save only works for signatures and doesn't respect certificates 
> such as Adobe Extended Usage Rights
> - -{{prepareNonVisualSignature}} clears the AcroForm DR 
> {{acroForm.setDefaultResources(null)}} which is not good if there are other 
> form fields-
> - visual/nonVisualSignature should move into the {{interactive.forms}} 
> package and be handled within the signature field
> - -verify signature (to have tests that go full circle)- done June 2016
> - document or refactor / rewrite visible labyrinthine signature code
> - why is it not possible to pass only the signatureField to addSignature, 
> instead having to create a COSDocument with a page and annotations that has 
> the signature field, and that must be searched for in 
> {{prepareVisibleSignature()}}?
> - -support rotated pages (see 
> https://stackoverflow.com/questions/34012293/pdfbox-sign-landscape-file-error/34359956#34359956
>  )- done in PDFBOX-3671
> - -make sure that signed PDF/A files are still PDF/A (see 
> http://www.pdfa.org/wp-content/uploads/2011/08/tn0006_digital_signatures_in_pdfa-1_2008-03-14.pdf
>  ); /ID possibly not OK; /Annots is possibly required ([~tilman] removed this 
> for invisible signatures); test signed files with PDF-Tools and with 
> preflight- tested, they are OK with PDF-Tools and preflight
> - test whether "bad" signatures are detected by preflight (search in old 
> issues)
> - -PDFBOX-3363 - why is the stream cached in a file? Should it be done in 
> memory?- done on July 15, 2016
> - remove {{setVisualSignature(PDVisibleSigProperties 
> visSignatureProperties)}} from SignatureOptions.java, all it does is to call 
> {{visSignatureProperties.getVisibleSignature()}} which returns an 
> {{InputStream}}, and this is already available
> - {{checkSignatureField}} violates the "do one thing" rule
> - -decide whether the whole certificate chain should be passed in the sample 
> code, instead of only the first one- yes the whole chain is stored
> - -check certificate chain, revocation lists, etc,- only if needed by users, 
> code 
> [here|https://svn.apache.org/repos/asf/cxf/tags/cxf-2.4.1/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/cert/]
> - deprecate / remove all PDVisibleSignDesigner constructors except those with 
> a PDDocument object, to avoid a file being opened twice
> - ... your ideas...



--
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] [Updated] (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:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-4375:

Labels: Overlay  (was: )

> 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-4120) Overlay process forcing bounding box to 0,0, clipping overlayed page.

2018-11-10 Thread Tilman Hausherr (JIRA)


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

Tilman Hausherr commented on PDFBOX-4120:
-

Is this similar to PDFBOX-3358? Could you please attach your PDFs?

> Overlay process forcing bounding box to 0,0, clipping overlayed page.
> -
>
> Key: PDFBOX-4120
> URL: https://issues.apache.org/jira/browse/PDFBOX-4120
> Project: PDFBox
>  Issue Type: Improvement
>Affects Versions: 2.0.8
>Reporter: Gregg
>Priority: Major
>  Labels: Overlay
>
> Hello,
> I am using the overlay functionality in PDFBox to stamp existing pdf file 
> pages with some test running up the left margin and across the footer of each 
> page. 
> I am creating an overlay page, based on the size, rotation, media and crop 
> boxes with the text to stamp.  I then call the overlay method with my overlay 
> pages to create the final document.   
> The overlay code creates a PDFormXObject representation of the overlay page 
> to apply to the source page.  Overlay.createOverlayXObject() sets the 
> bounding box of the new PDFormXObject using the source page media box, but it 
> forces the x,y to 0,0. 
> The issue I have is when the original page has a media/crop box that starts 
> in a negative quadrant, the overlay is clipped so some of the text is 
> missing. The work around I am doing is to go through the results pages after 
> the overlay method completes and update the bounding boxes of the 
> PDFormXObject to be the media box as the source page. 
> I think it would be helpful if we could tell the overlay process whether it 
> should manipulate the bounding box or not.



--
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



[jira] [Comment Edited] (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 edited comment on PDFBOX-4375 at 11/10/18 3:43 PM:
---

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())
    {
PDDocument doc = e.getValue();
    if (doc != null)
    {
    specificPageOverlayPage.put(e.getKey(), doc);
    }
    }
    processPages(inputPDFDocument);
    return inputPDFDocument;
    }{code}
 


was (Author: tilman):
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 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=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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: simplify

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: remove condition that is always true

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: remove condition that is always true

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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-4071) Improve code quality (3)

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


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

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

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

PDFBOX-4071: simplify

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
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