Loading...

Draw transparent image on PDF

Support for GdPicturePDF Plugin.

Draw transparent image on PDF

Postby MarcVeit » Fri Feb 03, 2012 4:45 pm

Hi,

I would like to draw a transparent image on a pdf. I'm using the following code:

Code: Select all
  Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.jpg")
  oGdPicturePDF.SelectPage(1) 'Selecting first page
  oGdPictureImaging.SetTransparency(ImageID, -100)

  Dim image_res_name As String = oGdPicturePDF.AddImageFromGdPictureImage(ImageID, False, False)
  oGdPicturePDF.DrawImage(image_res_name, 10, 10, imageWidth, imageHeight)
  oGdPictureImaging.ReleaseGdPictureImage(ImageID)
  oGdPicturePDF.SaveToFileInc("c:\test.pdf")
  oGdPicturePDF.CloseDocument()



This draws the image on the pdf, however, the transparency is lost. What am I doing wrong?

Any help is appreciated. Best regards,

Marc
MarcVeit
 
Posts: 6
Joined: Tue Jan 24, 2012 9:25 pm

Re: Draw transparent image on PDF

Postby Loïc » Fri Feb 03, 2012 5:00 pm

Hello Marc,

The transparency model in PDF is not the same at all as in raster image. While in image you just "play' with an alpha channel, in PDF you have to deal with softmask, blending mode, groups, composting mode and some other hell.

Currently we support only mask image. Therefore, you will not blend your image to a PDF page in an other way than defining a single fully transparent color.

We are already working on the full transparency support since 6 months now ,for rasterization, printing & writing purpose. The task is 50-60% done, and we expect to be ready for GdPicture 9.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture PDF Plugin

Who is online

Users browsing this forum: No registered users and 1 guest