You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Mikita Geer (JIRA)" <ji...@apache.org> on 2018/08/23 09:04:00 UTC
[jira] [Comment Edited] (PDFBOX-4298) NullPointerException when
doing overlay
[ https://issues.apache.org/jira/browse/PDFBOX-4298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16589932#comment-16589932 ]
Mikita Geer edited comment on PDFBOX-4298 at 8/23/18 9:03 AM:
--------------------------------------------------------------
Thank you, Tilman.
I've tried to download the latest snapshot via maven but there is a typo in parent pom [https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-parent/2.0.12-SNAPSHOT/maven-metadata.xml]
2.0.12-20180822.22225*9*-66 should be 2.0.12-20180822.22225*8*-66 I guess.
Anyway I've seen that NullPointerException is fixed but now there is IOException thrown. The question is: why contentArray is built and page's content is checked even if this page isn't overlayed?
was (Author: mikita.geer):
Thank you, Tilman.
I've tried to download the latest snapshot via maven but there is a typo in parent pom https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-parent/2.0.12-SNAPSHOT/maven-metadata.xml
2.0.12-20180822.22225*9*-66 should be 2.0.12-20180822.22225*8*-66 I guess.
Anyway I've seen that NullPointerException is fixed but now there is IOException thrown. The question is: why contentArray is built and page's content is checked even if this page isn't overlayed?
> NullPointerException when doing overlay
> ---------------------------------------
>
> Key: PDFBOX-4298
> URL: https://issues.apache.org/jira/browse/PDFBOX-4298
> Project: PDFBox
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 1.8.15, 2.0.11
> Reporter: Mikita Geer
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 1.8.16, 2.0.12, 3.0.0 PDFBox
>
> Attachments: NPE.pdf, pdf2.pdf
>
>
> When input pdf file for overlay contains empty page (with contents == null) like NPE.pdf file we get NullPointerException in Overlay.addOriginalContent method. It occurres even if we overlay over other than this empty page.
> Here's some sample code to reproduce the problem:
> {code:java}
> Overlay overlayObj = new Overlay();
> File file1 = new File("NPE.pdf");
> PDDocument originalDoc = PDDocument.load(file1);
> overlayObj.setOverlayPosition(Overlay.Position.FOREGROUND);
> overlayObj.setInputPDF(originalDoc);
> Map<Integer, String> ovmap = new HashMap<>();
> File file2 = new File("pdf2.pdf");
> ovmap.put(2, file2.getPath());
> overlayObj.overlay(ovmap);
> originalDoc.save("test__result.pdf");
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org