Overlaying 2 docs different colors

Overlaying 2 docs different colors

Forum member · Mar 28, 2016
Is there anyway to overlay 2 documents one as green and one as red to show the differences in the files. When red and green are combined they make black typically so the differences will show in red and green. I figured to use ImportPageData to merge the two pages but I don't know how to change color or transparency as well. Is this possible?

Re: Overlaying 2 docs different colors

Support · Mar 29, 2016
Hello, You can import the contents of an existing PDF and add it to new page using ImportedPageData class and also you can apply transparency to it using TransparencyGroup class of DynamicPDF API. You will need to create TransparencyGroup class object by setting the desired alpha value, then add the ImportedPageData object to it and add the TransparencyGroup object to the new page. You can refer to the documentation on TransparencyGroup class here . Below is the code sample for it. Document document = new Document(); Page page = new Page(); document.Pages.Add(page); PdfDocument pdfDocument = new PdfDocument(@"Path of an input PDF"); ImportedPageData impPageData = new ImportedPageData(pdfDocument.GetPage(1),0,0); TransparencyGroup groupObj = new TransparencyGroup(0.3F); groupObj.Add(impPageData); page.Elements.Add(groupObj); document.Draw(@"D:\temp\MyDocument.pdf"); Also it is not possible to change or set the colors for the imported contents using DynamicPDF Merger API. Thanks, ceTe Software Support Team.

Re: Overlaying 2 docs different colors

Forum member · Mar 29, 2016
Is there a way to use another component to create a color layer or print to a PDF using print component and set color. the transparency was really secondary to the color.

Re: Overlaying 2 docs different colors

Support · Mar 29, 2016
Hello, We don’t have any other components that would allow you to change the color of the PDF content. Thanks, ceTe Software Support Team.

Re: Overlaying 2 docs different colors

Forum member · Mar 29, 2016
Can we output it as a picture and then change the color and insert back into a PDF.

Re: Overlaying 2 docs different colors

Support · Mar 30, 2016
Hello, You could output the PDF page to an image using DynamicPDF Rasterizer and add that image back into a PDF using DynamicPDF Merger’s Image class. However, neither Merger nor Rasterizer (or any of our other products) have the capability to change the color of a PDF and/or an image. Thanks, ceTe Software Support Team.