Print Page | Close Window

How to print a transparent png file on top of text

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3796
Printed Date: 25 Apr 24 at 10:56PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How to print a transparent png file on top of text
Posted By: frederik
Subject: How to print a transparent png file on top of text
Date Posted: 18 Mar 20 at 2:57PM
I am working with quick pdf 17. Working/printing images works fine. But not I want to print a signature.png file (which is transparent) on top of text that is generated and printed on the pdf page. 
The result should look like a company/stamp signature on top of the text. 

I tried 
.SetPNGTransparencyColor(255 / 256, 255 / 256, 255 / 256)'
and
.SetImageMask(1, 1, 1, 0.1, 0.1, 0.1)
but is does not change... the image is printed with a fixed white background and destroying the text. 

I use the following simple code: 

   Call .AddImageFromFile(FileNameOfImageFile, 0)
   Call .SetPNGTransparencyColor(255 / 256, 255 / 256, 255 / 256)
   Call .FitImage(topX, topY, SizeWidth, SizeHeight, 1, 1, 0)




Replies:
Posted By: Ingo
Date Posted: 18 Mar 20 at 5:15PM
Hi Frederik,

png isn't easy stuff.
Try this link from the online ressources:
http://www.quickpdf.org/forum/displaying-transparent-bmp-files_topic2276.html
Yes. I know... bmp... but try it.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: frederik
Date Posted: 26 Mar 20 at 5:09PM
Hi Ingo. thank you very much, the transparent bmp files did the trick when using the setimagemask

I added this line just before the .fitimage call: 

Call .SetImageMask(0.9, 0.9, 0.9, 1, 1, 1)
Call .FitImage(x,y,width,height, 1, 1, 0)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk