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

Michael Klink commented on PDFBOX-4797:
---------------------------------------

If your PDFs do not themselves switch blend modes, you can get get a better 
view of the differences by switching the blend mode from the default to 
*Darken* or *Multiply* like this (here Multiply is only applied to the last 
page):

{code}
        try (   PDDocument document1 = ...;
                PDDocument document2 = ...;
                Overlay overlayer = new Overlay()) {
            overlayer.setInputPDF(document1);
            overlayer.setAllPagesOverlayPDF(document2);
            try (   PDDocument result = 
overlayer.overlay(Collections.emptyMap()) ) {
                try (   PDPageContentStream canvas = new 
PDPageContentStream(result, result.getPage(5), AppendMode.PREPEND, false, 
false)) {
                    PDExtendedGraphicsState extGState = new 
PDExtendedGraphicsState();
                    extGState.setBlendMode(BlendMode.MULTIPLY);
                    canvas.setGraphicsStateParameters(extGState);
                }
                result.save(...);
            }
        }
{code}

_([OverlayDocuments|https://github.com/mkl-public/testarea-pdfbox2/blob/master/src/test/java/mkl/testarea/pdfbox2/merge/OverlayDocuments.java#L48]
 test {{testOverlayWithMultiply}})_

In case of your documents one now sees both the 4 and the 5 after the 11.7 in 
the final result.

> Overlayed PDF file do not shows the difference 
> -----------------------------------------------
>
>                 Key: PDFBOX-4797
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4797
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.19
>         Environment: Java Maven
>            Reporter: Andrei Toropov
>            Priority: Major
>         Attachments: 10.pdf, 114.pdf, 1583843507134004.overlay.PDF, 
> 2020-03-10_10-34-56.png, screenshot-1.png, screenshot-2.png
>
>
> There are two differences in this two files, in the table on last page and in 
> the table on the previous page the second row, column "% since inception" has 
> values 11.74 in one pdf and 11.75 in another one. The textual html diff picks 
> up and shows both cases. However, visual overlay shows this on page 5, but 
> doesn't show on page 6.  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to