Hi,
I have used the TransperancyGroup to print a jpg image as background image.
The template looks good with draft background image behind the text content but the draft background image doesn't get printed behind the image content.
Is there any way to fix this issue?
DynamicPDF.Template watermarkTemplate = new DynamicPDF.Template();
Report.Template = watermarkTemplate;
PageElements.TransparencyGroup group = new PageElements.TransparencyGroup(0.5f);
group.Add(new PageElements.BackgroundImage(HttpContext.Current.Server.MapPath("../Static/Images/Draft.jpg")));
watermarkTemplate.Elements.Add(group);
Thanks.
Transparent JPG Image
Re: Transparent JPG Image
Support · Dec 3, 2009Hello,
You said "the draft background image doesn't get printed behind the image content", Are you adding two images in the background, one below the other? Or are you expecting to see the background image through an image page element present in the page? If so it is not possible as the image page element on the page is not transparent. You will have to make it transparent to see the elements behind the image element.
If this does not help you then please be more specific about your requirement and send over the exact code, the images you are using to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further.
Thanks,
ceTe Software Support Team.
Re: Transparent JPG Image
Forum member · Dec 3, 2009Hi,
I am expecting to see the background image through an image page element present in the page.
I have lot of image page elements present in the page but still want to show the background image watermark. Is there any way that I can do it?
Thanks.
Re: Transparent JPG Image
Support · Dec 3, 2009Honestly, from what you described, it almost sounds like you should be using the StampTemplate instead of the Template (the stamp template will take any Page Elements and draw them out over top of all other elements on the page).
Try taking your watermark image file, create an Image object (I don't think you will need to use BackgroundImage in this case), add that Image to a TransparencyGroup then add that trans group to the StampTemplate of the Document.
Essentially it sounds like you were trying to place a watermark behind all your other elements, meaning that all the elements of the page would have needed to be transparent in order to see your watermark sitting in the background. But in this case, all the elements can be on the page at normal transparency and just the watermark needs transparency and can be "stamped" on top the PDF.
If that did not get it for you then go ahead and send over the files that you are working with to our support email address, [^a|mailto:support@cete.com|support@cete.com^].
Please include:
- The input PDF (if you are using an existing PDF document)
- The image you are trying to use as the BackgroundImage
- The code you are using to add the BackgroundImage to the page
- The output PDF document (Make sure to point out exactly where the desired behavior is not being achieved)
I think we can get a better picture of what you are trying to do just to see the files.
Thanks,
ceTe Software Support Team