tracker issue : CF-3626704

select a category, or use search below
(searches all categories and all time range)
Title:

CFPDF action="addWatermark" replaces alpha channel on ARGB images with black

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Chris Davais / Chris Davais (Zamboni1138)

Created: 09/04/2013

Components: Document Management, PDF manipulation

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Linux RH Enterprise 6

Vote Count: 1

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on May 18, 2018 using build 2016.0.01.298513
Related Bugs:
3673381 - Similar to	CT Gibson


Problem Description: 

I am using CFIMAGE to make an ARGB image with a transparent background. When I use CFPDF action="addWatermark" to add the image to a PDF the alpha channel is being replaced with all black. I can use CFIMAGE action="writeToBrowser" and verify that the image has a transparent background and appears correct before being applied as a watermark.

Steps to Reproduce:

1) Make a PDF using CFDOCUMENT
2) Put HTML into the CFDOCUMENT to make a solid color background (green or blue, etc...)
3) Make an ARGB image, 50x50 pixels using CFIMAGE, with no background color
4) Draw a red line through the middle of the image using ImageSetDrawingColor and ImageDrawLine
5) Use CFPDF action="addWatermark" to add the image to the PDF made is steps 1-2
6) Use CFCONTENT to send final PDF with watermark to the browser

Actual Result:

I get a PDF with the HTML content from step 2 and a non-transparent black box with a red line through the middle. If I skip steps 5-6 above and write the image to the browser I get a transparent box with a red line through the middle. 

Expected Result:

A PDF with the HTML content from step 2 with a transparent 50x50 box in the middle of the PDF page with a red line through the middle.

Any Workarounds:

None that I can find. I tried ImageMakeColorTransparent(imgTest, "black"), but that didn't do anything.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3626704

External Customer Info:
External Company:  
External Customer Name: Zamboni1138
External Customer Email:  
External Test Config: My Hardware and Environment details:



ColdFusion: 10,0,11,285437

Linux: 2.6.32-220.23.1.el6.x86_64

Java/JVM: 1.6.0_29 20.4-b02

Attachments:

Comments:

Code to replicate the error. <!--- make an initial test PDF with a large green background and some black text at the top left ---> <cfdocument format="PDF" name="pdfInitial"> <!DOCTYPE html> <html> <head> <title>PDF Test</title> <style type="text/css"> ##divTest { height: 100%; width: 100%; background: green; color: black; } </style> </head> <body> <div id="divTest"> This is the test div area. </div> </body> </html> </cfdocument> <!--- start a new image, 50Wx50H, with alpha channel and no background ---> <cfset imgTest = ImageNew("", 50, 50, "argb") /> <!--- set the drawing color for the image to red ---> <cfset ImageSetDrawingColor(imgTest, "red") /> <!--- draw a horizontal line at the middle from the left to the right edges ---> <cfset ImageDrawLine(imgTest, 0, 25, 50, 25) /> <!--- at this point a black background is magically getting added to the ARGB image, attempt to remove (does not work) <cfset imgTest = ImageMakeColorTransparent(imgTest, "black") /> ---> <!--- add image as a watermark to the pdf, in the foreground fully opaque (defaults to centered on all pages) ---> <cfpdf action="addwatermark" source="pdfInitial" image="#imgTest#" foreground="yes" opacity="10" name="pdfFinal" /> <!--- send the final pdf content to the browser as a pdf ---> <cfcontent type="application/pdf" variable="#ToBinary(pdfFinal)#" />
Comment by External U.
14585 | September 04, 2013 03:28:42 PM GMT
The bug has been reported to the Gibson team. Bug no:3673381
Comment by Suchika S.
14586 | November 22, 2013 01:31:48 AM GMT
same issue here, all my generated documents are blocked !
Vote by External U.
14590 | December 03, 2013 03:02:40 AM GMT
The third party bug we logged is fixed . So we need to merge the changes to fix the above bug.
Comment by Suchika S.
14587 | December 05, 2014 04:36:23 AM GMT
Attached the testcase.
Comment by Suchika S.
14588 | December 05, 2014 04:37:15 AM GMT
This is not fixed in the new jar though the given changelist is present in the latest jar. Need to reopen the Gibson bug. (Comment added from ex-user id:vadiraja)
Comment by Adobe D.
14589 | September 25, 2015 12:51:20 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
27864 | May 18, 2018 06:27:05 AM GMT