pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4298) NullPointerException when doing overlay
Date Wed, 22 Aug 2018 16:10:00 GMT

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

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

Commit 1838652 from tilman@apache.org in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1838652 ]

PDFBOX-4298: avoid NPE; use similar text

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


Mime
View raw message