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

Andreas Lehmkühler edited comment on PDFBOX-2525 at 11/27/14 9:31 PM:
----------------------------------------------------------------------

It looks like you are using the old and deprecated overlay class. 

Have a look at the new one OverlayPDF 
[1.8-branch|http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/OverlayPDF.java?view=markup]
 or 
[trunk|http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java?view=markup].


was (Author: lehmi):
It looks like you are using the old and deprecated overlay class. 

Have a look at the new one OverlayPDF 
[1.8-branch|http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/OverlayPDF.java?view=markup]
 or 
[trunk|http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java?view=markup].

> Overlay: data black & white after import
> ----------------------------------------
>
>                 Key: PDFBOX-2525
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2525
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.8.7, 1.8.8, 2.0.0
>            Reporter: Marcus Ilgner
>
> After overlaying two documents, everything in the source is black & white 
> only. I uploaded a screenshot to 
> https://oc.evopark.de/public.php?service=files&t=0d7e4e172c30c23b260d3c96cc4986b5
> May relate to PDFBOX-2401.
> Some more details: I'm doing everything in-memory, not operating on files. 
> This is the sample code:
> {code:java}
>     public static byte[] mergeOntoLetterhead(byte[] originalPdf) throws 
> IOException, COSVisitorException {
>         PDDocument pdf = PDDocument.load(new 
> ByteArrayInputStream(originalPdf));
>         if (pdf.getNumberOfPages() == 0) {
>             return originalPdf;
>         }
>         PDDocument template = readTemplate();
>         if (null != template) {
>             Overlay overlay = new Overlay();
>             pdf = overlay.overlay(template, pdf);
>         } else {
>             logger.error("Could not load letterhead PDF");
>             return originalPdf;
>         }
>         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
>         pdf.save(outputStream);
>         return outputStream.toByteArray();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to